ODESystem

System Constructors

ModelingToolkit.ODESystemType
struct ODESystem <: ModelingToolkit.AbstractODESystem

A system of ordinary differential equations.

Fields

  • eqs

    The ODEs defining the system.

  • iv

    Independent variable.

  • states

    Dependent (state) variables.

  • ps

    Parameter variables.

  • pins

  • observed

  • tgrad

    Time-derivative matrix. Note: this field will not be defined until calculate_tgrad is called on the system.

  • jac

    Jacobian matrix. Note: this field will not be defined until calculate_jacobian is called on the system.

  • Wfact

    Wfact matrix. Note: this field will not be defined until generate_factorized_W is called on the system.

  • Wfact_t

    Wfact_t matrix. Note: this field will not be defined until generate_factorized_W is called on the system.

  • name

    Name: the name of the system

  • systems

    systems: The internal systems

Example

using ModelingToolkit

@parameters t σ ρ β
@variables x(t) y(t) z(t)
@derivatives D'~t

eqs = [D(x) ~ σ*(y-x),
       D(y) ~ x*(ρ-z)-y,
       D(z) ~ x*y - β*z]

de = ODESystem(eqs,t,[x,y,z],[σ,ρ,β])
source

Composition and Accessor Functions

  • sys.eqs or equations(sys): The equations that define the ODE.
  • sys.states or states(sys): The set of states in the ODE.
  • sys.parameters or parameters(sys): The parameters of the ODE.
  • sys.iv or independent_variable(sys): The independent variable of the ODE.

Transformations

ModelingToolkit.ode_order_loweringFunction
ode_order_lowering(sys::ODESystem) -> ODESystem

Takes a Nth order ODESystem and returns a new ODESystem written in first order form by defining new variables which represent the N-1 derivatives.

source

Applicable Calculation and Generation Functions

calculate_jacobian
calculate_tgrad
calculate_factorized_W
generate_jacobian
generate_tgrad
generate_factorized_W
jacobian_sparsity

Problem Constructors

DiffEqBase.ODEFunctionType
function DiffEqBase.ODEFunction{iip}(sys::AbstractODESystem, dvs = states(sys),
                                     ps = parameters(sys);
                                     version = nothing, tgrad=false,
                                     jac = false,
                                     sparse = false,
                                     kwargs...) where {iip}

Create an ODEFunction from the ODESystem. The arguments dvs and ps are used to set the order of the dependent variable and parameter vectors, respectively.

source
DiffEqBase.ODEProblemType
function DiffEqBase.ODEProblem{iip}(sys::AbstractODESystem,u0map,tspan,
                                    parammap=DiffEqBase.NullParameters();
                                    version = nothing, tgrad=false,
                                    jac = false,
                                    checkbounds = false, sparse = false,
                                    simplify = true,
                                    linenumbers = true, parallel=SerialForm(),
                                    kwargs...) where iip

Generates an ODEProblem from an ODESystem and allows for automatically symbolically calculating numerical enhancements.

source