[R-sig-dyn-mod] Multiple ODE with Variable Coefficients

Daniel Reed reeddc at umich.edu
Tue Aug 27 15:34:20 CEST 2013


Hi Mujal:

If k2 was simply a function of time, I'd recommend implementing it as a forcing function (see ?forcings). However, since it's also a function of y2, I wonder if it'd be best to differentiate your function for k2 with respect to time (i.e., to get dk2/dt) and then solve that along with all the other equations? Just a thought.

Cheers,
Daniel

_______________________________
Daniel C. Reed, PhD.
Postdoctoral Fellow,
Dept. of Earth & Environmental Sciences,
University of Michigan,
Ann Arbor, MI, USA.
email: reeddc at umich.edu
web: www.danielreed.org



On Aug 27, 2013, at 8:02 AM, Munjal  Patel <munjalpatel85 at gmail.com> wrote:

> Hello ,
> I want to use deSolve package for the following set of ODE with Initial
> Conditions Provided.
> 
> At  t=0 y1=200,y2=0,y3=0
> I want to track my Variable coefficient k2(t) at every steps.say for
> example like below
> 
> time  y1   y2    y3   k2(t)
> 0      200  0     0     **
> 0.01  **    **    **     **
> 0.02  **    **    **     **
> 
> 
> ** is the value calculated at every end of iteration.
> k2(t)= function (t,y2)
> 
> 
> dy1
> dt = k1  y1 + k2 (t) y2  y3
> dy2
> dt = k1  y1 + k2(t) y2  y3  -k3  y2  y2
> dy3
> dt = k3  y2  y2
> 
> 
> thank you
> -- 
> Munjal Patel
> PhD Student
> Division of Pharmaceutical Sciences
> Long Island University
> Brooklyn,NY
> Cell: 201 707 3301
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-dynamic-models mailing list
> R-sig-dynamic-models at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-dynamic-models



More information about the R-sig-dynamic-models mailing list