[R] Differential equations

peter dalgaard pdalgd at gmail.com
Wed Feb 8 16:19:39 CET 2017


It's been a while, but I think I have gotten through this sort of situation by splitting the integration into intervals, i.e., you run from t=0 to t=20 witn initial condition c(100,0), yielding a value c(y1,y2), then you run from 20 to 40 with initial condition c(y1+100, y2), etc.

-pd

On 08 Feb 2017, at 11:10 , Fanny Gallais <gallais.fanny at gmail.com> wrote:

> Hi,
> 
> I'm working on a system of 2 differential equations. My initial condition
> (t=0) is c(100,0) and i'm using lsoda function (from package deSolve) to
> solve it.
> My system reprensents the evoution of drug concentration in two
> compartments throug time. Problem is I would like to model a repeated drug
> administration. That is to say, not only 100 at t=0 but also at t=20,40,...
> I can't find a solution to do so. I tried adding "100" to the first
> differential equation at the times of interest but it doesn't work. Do you
> have any idea?
> 
> Thank you
> F.G.
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



More information about the R-help mailing list