help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lsode+sin problems


From: John W. Eaton
Subject: lsode+sin problems
Date: Thu, 24 Nov 2005 10:42:48 -0500

On 24-Nov-2005, Staszek Pitucha wrote:

| I'm trying to solve a simple differential eq.:
| 
| function xdot = f(x); xdot=sin(pi/180*x); endfunction;
| t=linspace(0,360,2000);
| s=lsode("f", -1, t);
| 
| and I don't exactly what I want. plot(t,s) isn't cos()... Am I missing 
| something?

I think you want to solve some variation of

  function xdot = f (x, t); xdot = sin (t); endfunction
  t = linspace (0, 2*pi, 2000);
  s = lsode ("f", -1, t);
  plot (t, s);

jwe



-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]