[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help with lsode
From: |
Ben Sapp |
Subject: |
Re: Help with lsode |
Date: |
Mon, 11 Feb 2002 09:07:07 +0700 |
Hi,
Here is a simple example starting at t = 3.5 and going to t = 20. Some lines
have been cut out because they were used by me to check that I was doing
things correctly. (Like checking that my function worked.)
octave:2> function xdot = f(x,t)
> xdot(1) = x(1) + x(2) + exp(-t);
> xdot(2) = x(1);
> endfunction
octave:6> x0 = [4;pi]
x0 =
4.0000
3.1416
octave:8> t = 3.5:0.05:20;
octave:9> x = lsode("f",x0,t);
octave:10> plot (t,x)
On Monday 11 February 2002 1:54 am, Louie Strigari wrote:
> Hi,
> I'm new octave, first of all.
> I am trying to solve a first order ODE xdot = f(x,t) with initial
> conditions t0 = some number that's not zero, x0 = some number. I have
> reviewed the syntax for entering functions and using lsode, but the only
> thing I can find is where the initial condition t0 = 0 is used.
> Can some please show me the syntax for starting at a random initial time,
> t0 not necessarily = 0.
> Thanks.
>
>
>
> -------------------------------------------------------------
> 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
> -------------------------------------------------------------
--
Ben Sapp Los Alamos National Laboratory
email: <mailto:address@hidden> Phone: (505)667-3277
Fax: (505)665-7920 URL: http://www.neutrino.lanl.gov/
--
-------------------------------------------------------------
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
-------------------------------------------------------------
- Help with lsode, Louie Strigari, 2002/02/10
- Re: Help with lsode,
Ben Sapp <=