On Thu, Apr 30, 2009 at 11:25 PM, John B. Thoo
<address@hidden> wrote:
Hi, everyone.
As a toy problem, I'm trying to solve du/dt = i*u, where i^2 = -1.
This is what I've tried and gotten:
octave-3.0.5:1> function udot = f (u, t)
> udot = I*u;
> endfunction
octave-3.0.5:2> u0 = 1;
octave-3.0.5:3> t = linspace (0, 5, 10);
octave-3.0.5:4> u = lsode ("f", u0, t);
warning: lsode: ignoring imaginary part returned from user-supplied
function
octave-3.0.5:5> plot (t, u)
octave-3.0.5:6>
Gnuplot gives the constant graph u = 1 for t = 0..5.
What am I doing wrongly?
Eventually, I'd like to solve a system like this:
udot(1) = -i*u(3)*u(2)' - i*u(2)*u(1)';
udot(2) = -2*i*u(3)*u(1)' - i*u(1)*u(1);
udot(3) = -3*i*u(2)*u(1);
(I'm using ' for complex conjugate. Is that correct?)
Thanks for any help you can give.
---John.
_______________________________________________
Help-octave mailing list
address@hidden
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave