You can also append "compartments" to the model. Because of the ODE solving internals, you cannot add fake compartments to the model until after all the differential equations are defined.
For example this is legal:
ode.1c.ka <- function(){ model({ C2 = center/V d / dt(depot) = -KA * depot d/dt(center) = KA * depot - CL*C2 cmt(eff) }) } ode.1c.ka <- ode.1c.ka() print(ode.1c.ka)
You can see this more clearly with the underlying classic rxode2
model:
ode.1c.ka$simulationModel
But compartments defined before all the differential equations is not supported; So the model below:
ode.1c.ka <- rxode2({ cmt(eff) C2 = center/V; d / dt(depot) = -KA * depot d/dt(center) = KA * depot - CL*C2 })
will give an error:
Error in rxModelVars_(obj) : Evaluation error: Compartment 'eff' needs differential equations defined.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.