Skip to content
Prev 568 / 696 Next

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

Dear David,

I see two possibilities:

1. Solve the ODE to get (u, v). Then use multiroot() from the rootSolve
package to solve the equations

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

with respect to (q, p) with the solution u(t), v(t) for each time point
t separately.

2. You could include the equations for (q, p) into the ODE:

dp/dt = df/du du/dt + df/dq dq/dt
dq/dt = dg/dp dp/dt + dg/dv dv/dt

Let x = (p, q) and y = (u, v). Then we get

dx/dt = A dx/dt + B dy/dt

with matrices A and B. Then solve the equations with respect to dx/dt:

(1-A) dx/dt = B dy/dt
dx/dt = (1-A)^(-1) B dy/dt

To get the inverse of (1-A) you could use solve() within your R
function defining the ODE. The initial conditions for x = (p, q) are
determined from your equations for (p, q) and the initial conditions
for (u, v).

I wish you success.

Best regards,
Daniel



On Fri, 20 Oct 2017 14:54:03 +0200
Granjon David <dgranjon at ymail.com> wrote: