[R] Solution to differential equation

Ravi Varadhan rvaradhan at jhmi.edu
Fri Dec 17 21:28:58 CET 2010


The "quadrature method" that I demonstrated to the OP is quite flexible for
a single nonlinear ODE.  The Schaeffer-Pella-Tomlinson ODE that you are
referring to can be readily solved by the quadrature method. It should be
significantly more efficient (i.e. accuracy/speed trade-off) than numerical
ODE solvers.  

The only situation where the quadrature method will not work for a single
ODE is when the dependent variable and time cannot be separated, such as,
for example:

dy/dt = a*y^b*(1 - y) + g(t)

where g(t) is a non-autonomous forcing function, which can be any function
of time such that the solution is bounded as t goes to infinity.

Ravi.

-------------------------------------------------------
Ravi Varadhan, Ph.D.
Assistant Professor,
Division of Geriatric Medicine and Gerontology School of Medicine Johns
Hopkins University

Ph. (410) 502-2619
email: rvaradhan at jhmi.edu

-----Original Message-----
From: dave fournier [mailto:davef at otter-rsch.com] 
Sent: Friday, December 17, 2010 7:02 AM
To: Ravi Varadhan
Cc: r-help at r-project.org
Subject: Re: [R] Solution to differential equation

Ravi Varadhan wrote:

Because the numerical solution is more flexible. In the example I linked 
to the
population is being fished. This add an extra term which breaks your 
solution.
I don't know where the OP is going with this question, but flexibility 
might be
useful. Also I just like the idea of fitting models defined by DE's to 
data.

> When you can obtain `exact' (but not closed-form) solution, why would you
> want to use a numerical ODE solver, which has an approximation error of
the
> order O(dt) or O(dt^2), where `dt' is the time step? Furthermore, a
> significant advantage of an exact solution is that you can compute the
> solution at any given `t' in one shot, rather than having to march through
> time from t=t0 to t=t.  Numerical time-marching schemes make more sense
for
> systems of nonlinear ODEs.
>
> Ravi.
>
> -------------------------------------------------------
> Ravi Varadhan, Ph.D.
> Assistant Professor,
> Division of Geriatric Medicine and Gerontology School of Medicine Johns
> Hopkins University
>
> Ph. (410) 502-2619
> email: rvaradhan at jhmi.edu
>
>
> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org]
On
> Behalf Of dave fournier
> Sent: Friday, December 17, 2010 11:23 AM
> To: r-help at r-project.org
> Subject: Re: [R] Solution to differential equation
>
>
> It is not very difficult to integrate this DE numerically.
> For parameter estimation it is a good idea for
> stability to use a semi-implicit formulation. The idea is
> described here.
>
>      http://otter-rsch.com/admodel/cc4.html
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
>



More information about the R-help mailing list