Functions for manipulating ODEs
Creating ODE systems
ExactODEReduction.@ODEsystem
— Macro@ODEsystem
Macro for creating an ODE from a list of equations. Also injects all variables into the global scope. This macro accepts a sybolically written ODE system and generates an ODE
structure instance.
Example:
ode = @ODEsystem(
x1'(t) = -k1 * x1(t),
x2'(t) = -k2 * x2(t)
)
[ Info: Summary of the model:
[ Info: State variables: x1, x2
[ Info: Parameters: k1, k2
x1'(t) = -x1(t)*k1
x2'(t) = -x2(t)*k2
ExactODEReduction.ODE
— TypeODE{P}
The main structure that represents input ODE system. Stores information about states, initial conditions, and the equations. This structure is constructed via the @ODEmodel
macro.
Accessing ODE data
ModelingToolkit.equations
— Methodequations(ode::ODE)
Returns the array of equations of the given ODE system.
ModelingToolkit.states
— Methodstates(ode::ODE)
Returns the array of states of the given ODE system.
ModelingToolkit.parameters
— Methodparameters(ode::ODE)
Returns the array of parameters of the given ODE system.
ExactODEReduction.initial_conditions
— Methodinitial_conditions(ode::ODE)
Returns the array of initial conditions of the given ODE system.
ExactODEReduction.parameter_values
— Methodparameter_values(ode::ODE)
Returns the array of parameter values of the given ODE system.
AbstractAlgebra.vars
— Methodvars(ode::ODE)
Returns the array of polynomial variables of the given ODE system.
ExactODEReduction.to_state
— Functionto_state(ode::ODE, p)
Returns a new ODE in which the parameter p
is a state with zero dynamics.
ExactODEReduction.to_parameter
— Functionto_parameter(ode::ODE, x)
Returns a new ODE in which the state x
with zero dynamics is a parameter.
Converting ODE to MTK.jl
and back
ExactODEReduction.ODEtoMTK
— FunctionODEtoMTK(ode::ODE)
Converts an ODE
object to an ModelingToolkit.ODESystem
object and (!) inserts the MTK variables into the global scope.
Input:
ode
- ODE object
Output:
ModelingToolkit.ODESystem
object
ExactODEReduction.MTKtoODE
— FunctionMTKtoODE(de::ModelingToolkit.ODESystem)
Converts an ModelingToolkit.ODESystem
object to an ODE
object.
Input:
de
-ModelingToolkit.ODESystem
, a system to be converted
Output:
ODE
object suitable for finding reductions