[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Non homogeneous differential equations
From: |
John W. Eaton |
Subject: |
Re: Non homogeneous differential equations |
Date: |
Tue, 22 May 2007 15:00:09 -0400 |
On 22-May-2007, François Poulain wrote:
| Thank you for your help, but it doesn't work in octave : you can see the
| computation below. I already tried some things like that, and I didn't
| find any way to solve this problem ...
|
| octave:1> function xdot = f (x, t, uf, tauf)
| > persistent a = 1
| > persistent b = 1
| > u = uf (t);
| > xdot = [-a*x(4)*sin(x(3))+u(1);
| > -a*x(4)*cos(x(3))+u(2);
| > -x(4)+u(3);
| > b*(x(1)*sin(x(3))+x(2)*cos(x(3)))-tauf(t)];
| > endfunction
| octave:2> t = linspace (0, 1, 101);
| octave:3> x = lsode (@ (x, t) f (x, t, @ (t) t.^((0:2)'), @sin), zeros
| (4, 1),t);
| error: lsode: first arg should be a string or 2-element string array
| error: evaluating assignment expression near line 3, column 4
Newer versions of Octave will handle this.
jwe
Re: Non homogeneous differential equations, Jordi Gutierrez Hermoso, 2007/05/21