help-octave
[Top][All Lists]
Advanced

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

Re: Help with ODE solver


From: Marco Antoniotti
Subject: Re: Help with ODE solver
Date: Thu, 12 Sep 2002 13:28:12 -0400

> X-Authentication-Warning: bevo.che.wisc.edu: list set sender to 
> address@hidden using -f
> From: "John W. Eaton" <address@hidden>
> Date: Thu, 12 Sep 2002 09:19:13 -0500
> cc: help-octave mailing list <address@hidden>
> Resent-From: address@hidden
> X-Mailing-List: <address@hidden> 
> X-Loop: address@hidden
> Resent-Sender: address@hidden
> 
> On 12-Sep-2002, Martin Senator <address@hidden> wrote:
> 
> | Is there a way to use the interpolation feature of LSODE when the
> | function
> | xdot = f(x,t) changes abruptly at a particular value of one of the
> | components of the dependent variable?  There is no problem with
> | integrating past the change using the old value of the function.  I have
> | been leaving the integration routine and doing the interpolations myself
> | and would be happy to find a way to let LSODE handle the job.
> 
> If I understand your question correctly, then this is exactly what the
> tcrit argument for lsode is all about.  Perhaps my previous message
> wasn't clear.  Use the tcrit argument to tell lsode about the
> discontinuities.  If you want to ensure that tout includes all those
> points too, then do something like the following:
> 
>   tout = (0:100)';  ## or whatever;
>   tcrit = [ some; list; of; points; where; rhs; function; changes ];
>   ## now, merge the to sets of output points, delete duplicates, and
>   ## make sure they are in ascending order:
>   tout = sort (create_set ([tout, tcrit]));
>   x = lsode ('f', x0, tout, tcrit);
> 
> Now, x will contain solutions at all the tout points.  In this
> example, tout includes all the tcrit points, but it is not necessary
> to merge them unless you want to see the output at those points too.
> You do not have to break up the interval and call lsode multiple times
> in a loop -- lsode will reset itself when it hits the tcrit points.


I think I understand that,  however, how are you going to code the
changing of the RHS at the points in 'tcrit'?

Thanks



-- 
Marco Antoniotti ========================================================
NYU Courant Bioinformatics Group        tel. +1 - 212 - 998 3488
715 Broadway 10th Floor                 fax  +1 - 212 - 995 4122
New York, NY 10003, USA                 http://bioinformatics.cat.nyu.edu
                    "Hello New York! We'll do what we can!"
                           Bill Murray in `Ghostbusters'.



-------------------------------------------------------------
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]