NonlinearSystem
System Constructors
ModelingToolkit.NonlinearSystem — Typestruct NonlinearSystem <: AbstractTimeIndependentSystemA nonlinear system of equations.
Fields
tag: tag: a tag for the system. If two systems have the same tag, then they are structurally identical.
eqs: Vector of equations defining the system.states: Unknown variables.ps: Parameters.var_to_name: Array variables.observedjac: Jacobian matrix. Note: this field will not be defined untilcalculate_jacobianis called on the system.
name: Name: the name of the system. These are required to have unique names.
systems: systems: The internal systems
defaults: defaults: The default values to use when initial conditions and/or parameters are not supplied inODEProblem.
connector_type: type: type of the system
metadata: metadata: metadata for the system, to be used by downstream packages.
gui_metadata: gui_metadata: metadata for MTK GUI.
tearing_state: tearing_state: cache for intermediate tearing state
substitutions: substitutions: substitutions generated by tearing.
complete: complete: if a modelsysis complete, thensys.xno longer performs namespacing.
Examples
@variables x y z
@parameters σ ρ β
eqs = [0 ~ σ*(y-x),
0 ~ x*(ρ-z)-y,
0 ~ x*y - β*z]
@named ns = NonlinearSystem(eqs, [x,y,z],[σ,ρ,β])Composition and Accessor Functions
get_eqs(sys)orequations(sys): The equations that define the nonlinear system.get_states(sys)orstates(sys): The set of states in the nonlinear system.get_ps(sys)orparameters(sys): The parameters of the nonlinear system.get_u0_p(sys, u0map, parammap)Numeric arrays for the initial condition and parameters givenvar => valuemaps.
Transformations
Missing docstring for structural_simplify. Check Documenter's build log for details.
Missing docstring for alias_elimination. Check Documenter's build log for details.
ModelingToolkit.StructuralTransformations.tearing — Functiontearing(sys; simplify=false)Tear the nonlinear equations in system. When simplify=true, we simplify the new residual equations after tearing. End users are encouraged to call structural_simplify instead, which calls this function internally.
Analyses
Missing docstring for ModelingToolkit.isaffine. Check Documenter's build log for details.
Missing docstring for ModelingToolkit.islinear. Check Documenter's build log for details.
Applicable Calculation and Generation Functions
calculate_jacobian
generate_jacobian
jacobian_sparsityProblem Constructors
SciMLBase.NonlinearFunction — MethodSciMLBase.NonlinearFunction{iip}(sys::NonlinearSystem, dvs = states(sys),
ps = parameters(sys);
version = nothing,
jac = false,
sparse = false,
kwargs...) where {iip}Create an NonlinearFunction from the NonlinearSystem. The arguments dvs and ps are used to set the order of the dependent variable and parameter vectors, respectively.
SciMLBase.NonlinearProblem — MethodDiffEqBase.NonlinearProblem{iip}(sys::NonlinearSystem, u0map,
parammap = DiffEqBase.NullParameters();
jac = false, sparse = false,
checkbounds = false,
linenumbers = true, parallel = SerialForm(),
kwargs...) where {iip}Generates an NonlinearProblem from a NonlinearSystem and allows for automatically symbolically calculating numerical enhancements.
Torn Problem Constructors
Missing docstring for BlockNonlinearProblem. Check Documenter's build log for details.
Expression Constructors
ModelingToolkit.NonlinearFunctionExpr — TypeSciMLBase.NonlinearFunctionExpr{iip}(sys::NonlinearSystem, dvs = states(sys),
ps = parameters(sys);
version = nothing,
jac = false,
sparse = false,
kwargs...) where {iip}Create a Julia expression for an ODEFunction from the ODESystem. The arguments dvs and ps are used to set the order of the dependent variable and parameter vectors, respectively.
ModelingToolkit.NonlinearProblemExpr — TypeDiffEqBase.NonlinearProblemExpr{iip}(sys::NonlinearSystem, u0map,
parammap = DiffEqBase.NullParameters();
jac = false, sparse = false,
checkbounds = false,
linenumbers = true, parallel = SerialForm(),
kwargs...) where {iip}Generates a Julia expression for a NonlinearProblem from a NonlinearSystem and allows for automatically symbolically calculating numerical enhancements.