Re: [R] Differential equations

2017-02-26 Thread Thomas Petzoldt
Hi, yes, the suggestion of Peter Dalgaard is correct, and it can also be done using the "event" mechanism of deSolve, see: library("deSolve") ?events ... or the slides from our talk given at useR-2011 http://desolve.r-forge.r-project.org/slides/petz_soet2011.pdf ... or the tutorial from L.A

Re: [R] Differential equations

2017-02-08 Thread peter dalgaard
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 Fe

[R] Differential equations

2017-02-08 Thread Fanny Gallais
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 dru

Re: [R] Differential Equations there use in R (population modeling)

2008-08-11 Thread Roland Rau
Hi, stephen sefick wrote: e1 <- function(x,b,t){ d<-(x)*(b^t) plot(d) } e1(2, 2,seq(from=0, to=6, by=1)) Is there a way to do this with a change in time. I would like to use differential equations. I am trying to model a population with an initial value, fecundity per time st

Re: [R] Differential Equations there use in R (population modeling)

2008-08-11 Thread Ben Bolker
There was a spurious tilde in the code coming from my digital signature -- oops. ignore the tilde in the function: library(odesolve) ## in general x, b are state and parameter VECTORS e1B <- function(t,x,b) { list(x*b^t,NULL) } L1 = lsoda(y=1,times=seq(0,1,by=0.02),func=e1B,parms=c(b=0.

Re: [R] Differential Equations there use in R (population modeling)

2008-08-11 Thread stephen sefick
thanks On Mon, Aug 11, 2008 at 2:18 PM, Ben Bolker <[EMAIL PROTECTED]> wrote: > > There was a spurious tilde in the code coming > from my digital signature -- oops. ignore the > tilde in the function: > > library(odesolve) > > ## in general x, b are state and parameter VECTORS > e1B <- function(

Re: [R] Differential Equations there use in R (population modeling)

2008-08-11 Thread stephen sefick
error in isoda(y = 1, times = seq(0, 1, by = 0.02), func = e1B, parms = c(b = 0.9)) : Model function must return a list this is the error message I get when I try and paste in the code. Stephen Sefick On Mon, Aug 11, 2008 at 1:36 PM, Ben Bolker <[EMAIL PROTECTED]> wrote: > -BEGIN PGP SIGNE

Re: [R] Differential Equations there use in R (population modeling)

2008-08-11 Thread Ben Bolker
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 stephen sefick wrote: | population# = (initialvalue @ t) - (death rate) + (fecundtity per individual) dt | to be able to vary the values of the inputs death rate and fecundity | with time using initial value @ t from the previous time step to | eval

Re: [R] Differential Equations there use in R (population modeling)

2008-08-11 Thread stephen sefick
population# = (initialvalue @ t) - (death rate) + (fecundtity per individual) dt to be able to vary the values of the inputs death rate and fecundity with time using initial value @ t from the previous time step to evaluate the function at the present time step. On Mon, Aug 11, 2008 at 9:43 AM, Be

Re: [R] Differential Equations there use in R (population modeling)

2008-08-11 Thread Ben Bolker
stephen sefick gmail.com> writes: > > e1 <- function(x,b,t){ > d<-(x)*(b^t) > plot(d) > } > > e1(2, 2,seq(from=0, to=6, by=1)) > > Is there a way to do this with a change in time. I would like to use > differential equations. I'm not sure what you mean by "do this with a chan

[R] Differential Equations there use in R (population modeling)

2008-08-10 Thread stephen sefick
e1 <- function(x,b,t){ d<-(x)*(b^t) plot(d) } e1(2, 2,seq(from=0, to=6, by=1)) Is there a way to do this with a change in time. I would like to use differential equations. I am trying to model a population with an initial value, fecundity per time step, and a death rate. The ab

Re: [R] Differential Equations

2008-06-18 Thread Spencer Graves
I just got 37 hits from RSiteSearch('differential equation', 'fun') including odesolv{fda}, rk4{deSolve}, rk4{odesolve}, in addition to lsoda{odesolve} and the Rsundials package. hope this helps. Spencer Graves Michael Lawrence wrote: On Tue, Jun 17, 2008 at 6:25 PM, David Ar

Re: [R] Differential Equations

2008-06-17 Thread Michael Lawrence
On Tue, Jun 17, 2008 at 6:25 PM, David Arnold <[EMAIL PROTECTED]> wrote: > All, > > I've found odesolve and lsoda. > > Any other packages for differential equations? > There's Rsundials, which gives you an algebraic ode solver. > > Any good tutorials on using R and solving differential and part

Re: [R] Differential Equations

2008-06-17 Thread Peng Jiang
hi , David. I think odesolve is what you need , do you ever try it ? Solving differential equations is not a strong function of R, that means, maybe you should try to write your own procedure using your own numerical method for your own specific equation . regards. On 2008-6-18, at 上午9:25,

[R] Differential Equations

2008-06-17 Thread David Arnold
All, I've found odesolve and lsoda. Any other packages for differential equations? Any good tutorials on using R and solving differential and partial differential equations? D. __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/lis