SteadyStateProblem(sys, op) asks for the steady state of a time
dependent system: the state where every derivative vanishes.
solve(prob, SSRootfind()) finds it by root finding from the initial
values, solve(prob, DynamicSS()) by integrating the differential
equations until the derivatives are small.
Usage
SteadyStateProblem(sys, op = list(), ..., u0 = NULL, p = NULL)Arguments
- sys
A complete time dependent
System, or an R functionf(u, p, t).- op
Operating point: values of unknowns and parameters.
- ...
Passed to
ODEProblem().- u0, p
Initial values and parameters for raw problems.
Examples
t <- t_nounits; D <- D_nounits
x <- Variable("x", t); k <- Parameter("k"); s <- Parameter("s")
sys <- mtkcompile(System(list(D(x) ~ s - k * x), t, name = "decay"))
prob <- SteadyStateProblem(sys, list(x ~ 1, k ~ 2, s ~ 3))
solve(prob, SSRootfind())$u
#> x(t)
#> 1.5
solve(prob, DynamicSS())$u
#> x(t)
#> 1.5