JumpSystem
System Constructors
ModelingToolkit.JumpSystem — Typestruct JumpSystem{U<:RecursiveArrayTools.ArrayPartition} <: AbstractTimeDependentSystemA system of jump processes.
Fields
tag: tag: a tag for the system. If two systems have the same tag, then they are structurally identical.
eqs: The jumps of the system. Allowable types areConstantRateJump,VariableRateJump,MassActionJump.
iv: The independent variable, usually time.states: The dependent variables, representing the state of the system. Must not contain the independent variable.ps: The parameters of the system. Must not contain the independent variable.var_to_name: Array variables.observedname: The name of the system. . These are required to have unique names.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
discrete_events: discreteevents: AVector{SymbolicDiscreteCallback}that models events. Symbolic analog toSciMLBase.DiscreteCallbackthat executes an affect when a given condition is true at the end of an integration step. *Note, one must make sure to call `resetaggregated_jumps!(integrator)` if using a custom affect function that changes any state value or parameter.*
metadata: metadata: metadata for the system, to be used by downstream packages.
gui_metadata: gui_metadata: metadata for MTK GUI.
complete: complete: if a modelsysis complete, thensys.xno longer performs namespacing.
Example
using ModelingToolkit, JumpProcesses
@parameters β γ
@variables t S(t) I(t) R(t)
rate₁ = β*S*I
affect₁ = [S ~ S - 1, I ~ I + 1]
rate₂ = γ*I
affect₂ = [I ~ I - 1, R ~ R + 1]
j₁ = ConstantRateJump(rate₁,affect₁)
j₂ = ConstantRateJump(rate₂,affect₂)
j₃ = MassActionJump(2*β+γ, [R => 1], [S => 1, R => -1])
@named js = JumpSystem([j₁,j₂,j₃], t, [S,I,R], [β,γ])Composition and Accessor Functions
get_eqs(sys)orequations(sys): The equations that define the jump system.get_states(sys)orstates(sys): The set of states in the jump system.get_ps(sys)orparameters(sys): The parameters of the jump system.get_iv(sys): The independent variable of the jump system.
Transformations
ModelingToolkit.structural_simplify — Functionstructural_simplify(sys)
structural_simplify(sys, io; simplify, kwargs...)
Structurally simplify algebraic equations in a system and compute the topological sort of the observed equations. When simplify=true, the simplify function will be applied during the tearing process. It also takes kwargs allow_symbolic=false and allow_parameter=true which limits the coefficient types during tearing.
The optional argument io may take a tuple (inputs, outputs). This will convert all inputs to parameters and allow them to be unconnected, i.e., simplification will allow models where n_states = n_equations - n_inputs.
Analyses
Problem Constructors
Missing docstring for SciMLBase.DiscreteProblem(sys::JumpSystem,args...). Check Documenter's build log for details.
Missing docstring for JumpProcesses.JumpProblem(sys::JumpSystem,args...). Check Documenter's build log for details.