[R-sig-dyn-mod] Issues with the implementation of a Guyton-based model

Granjon David dgranjon at ymail.com
Fri Oct 20 14:54:03 CEST 2017


Dear All,

I am currently working on some Guyton-like models. These models are composed of equations as well as ODEs. As there are usually more than 50 equations per model, I will consider a basic example. 

1) Assume the following system of equations with the corresponding parameters, initial conditions and integration time:

###########################

func <- function(time, y, parms) {
  with(as.list(c(parms, y)), {
    du <- a * u - b * u * v
    dv <- c * u * v - d * v
    list(c(du, dv))
  })
}

parms <- c(a = 1, b = 1, c = 0.1, d = 1)
y0 <- c(u=10, v=5)
times <- seq(0, 100, 0.1)
# out <- lsoda(y, times, func, parms)

###########################

Then suppose I introduce two variables, namely p and q, with the following properties:

 p = f(u,q)
 q = g(p,v)

Then, how to change the previous code to solve for u, v, p and q at the same time? 

My idea was to include equations related to p and q in the R code and set « starting » values for p and q, since they are not defined when t = 0. 

(In practice, I have to deal with up to 63 coupled equations as well as 6 ODEs, in which the previous equations have to be injected).


										**********


2) My other question concerns equation 47 and 51 of the model I am studying from «  Karaaslan et al., Annals of Biomedical Engineering, 33: 2005 »  (see also corrections provided by the authors, which are not available online):

How to implement them in R? For example, equation 31 (extracellular volume) can be easily switched from its integral form into differential equation ( dVecf/dt = Phi_win - Phi_u, with initial conditions).

Thanks in advance,

Best Regards

David Granjon














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