We can use the deSolve package in R for ordinary differential equations (ODE), however, I can't find a way to solve two nested ODE equations, suppose `
b'(t) = beta - k*b(t);
a'(t) = alpha -b(t)*gamma;
where ' means differentiation. How can we solve a and b then? as a' is a function of b, we have to solve a and b simultaneously.
I got an error:
Error in lsoda(y, times, func, parms, ...) : The used combination of solvers cannot be nested.
When I tried to add the solve for b inside the ode solution for a.