Functions for manipulating ODEs

Creating ODE systems

ExactODEReduction.@ODEsystemMacro
@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
source
ExactODEReduction.ODEType
ODE{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.

source

Accessing ODE data

Converting ODE to MTK.jl and back

ExactODEReduction.ODEtoMTKFunction
ODEtoMTK(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
source
ExactODEReduction.MTKtoODEFunction
MTKtoODE(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
source