ImplicitDiscreteSystem
System Constructors
ModelingToolkit.ImplicitDiscreteSystem
— Typestruct ImplicitDiscreteSystem <: ModelingToolkit.AbstractDiscreteSystem
An implicit system of difference equations.
Fields
tag
: A tag for the system. If two systems have the same tag, then they are structurally identical.
eqs
: The difference equations defining the discrete system.iv
: Independent variable.unknowns
: Dependent (state) variables. Must not contain the independent variable.ps
: Parameter variables. Must not contain the independent variable.tspan
: Time span.var_to_name
: Array variables.observed
: Observed states.name
: The name of the system
description
: A description of the system.
systems
: The internal systems. These are required to have unique names.
defaults
: The default values to use when initial conditions and/or parameters are not supplied inImplicitDiscreteProblem
.
guesses
: The guesses to use as the initial conditions for the initialization system.
initializesystem
: The system for performing the initialization.
initialization_eqs
: Extra equations to be enforced during the initialization sequence.
preface
: Inject assignment statements before the evaluation of the RHS function.
connector_type
: Type of the system.
parameter_dependencies
: Topologically sorted parameter dependency equations, where all symbols are parameters and the LHS is a single parameter.
metadata
: Metadata for the system, to be used by downstream packages.
gui_metadata
: Metadata for MTK GUI.
tearing_state
: Cache for intermediate tearing state.
substitutions
: Substitutions generated by tearing.
namespacing
: If false, thensys.x
no longer performs namespacing.
complete
: If true, denotes the model will not be modified any further.
index_cache
: Cached data for fast symbolic indexing.
parent
: The hierarchical parent system before simplification.
isscheduled
Example
using ModelingToolkit
using ModelingToolkit: t_nounits as t
@parameters σ=28.0 ρ=10.0 β=8/3 δt=0.1
@variables x(t)=1.0 y(t)=0.0 z(t)=0.0
k = ShiftIndex(t)
eqs = [x ~ σ*(y-x(k-1)),
y ~ x(k-1)*(ρ-z(k-1))-y,
z ~ x(k-1)*y(k-1) - β*z]
@named ide = ImplicitDiscreteSystem(eqs,t,[x,y,z],[σ,ρ,β]; tspan = (0, 1000.0))
Composition and Accessor Functions
get_eqs(sys)
orequations(sys)
: The equations that define the implicit discrete system.get_unknowns(sys)
orunknowns(sys)
: The set of unknowns in the implicit discrete system.get_ps(sys)
orparameters(sys)
: The parameters of the implicit discrete system.get_iv(sys)
: The independent variable of the implicit discrete systemdiscrete_events(sys)
: The set of discrete events in the implicit discrete system.
Transformations
ModelingToolkit.structural_simplify
— Functionstructural_simplify(sys; ...)
structural_simplify(
sys,
io;
additional_passes,
simplify,
split,
allow_symbolic,
allow_parameter,
conservative,
fully_determined,
kwargs...
)
Structurally simplify algebraic equations in a system and compute the topological sort of the observed equations in sys
.
Optional Arguments:
- optional argument
io
may take a tuple(inputs, outputs)
. This will convert allinputs
to parameters and allow them to be unconnected, i.e., simplification will allow models wheren_unknowns = n_equations - n_inputs
.
Optional Keyword Arguments:
- When
simplify=true
, thesimplify
function will be applied during the tearing process. allow_symbolic=false
,allow_parameter=true
, andconservative=false
limit the coefficient types during tearing. In particular,conservative=true
limits tearing to only solve for trivial linear systems where the coefficient has the absolute value of $1$.fully_determined=true
controls whether or not an error will be thrown if the number of equations don't match the number of inputs, outputs, and equations.sort_eqs=true
controls whether equations are sorted lexicographically before simplification or not.
Problem Constructors
SciMLBase.ImplicitDiscreteProblem
— MethodImplicitDiscreteProblem(
sys::ImplicitDiscreteSystem;
...
) -> Any
ImplicitDiscreteProblem(
sys::ImplicitDiscreteSystem,
u0map;
...
) -> Any
ImplicitDiscreteProblem(
sys::ImplicitDiscreteSystem,
u0map,
tspan;
...
) -> Any
ImplicitDiscreteProblem(
sys::ImplicitDiscreteSystem,
u0map,
tspan,
parammap;
eval_module,
eval_expression,
kwargs...
) -> Any
Generates an ImplicitDiscreteProblem from an ImplicitDiscreteSystem.
Missing docstring for ImplicitDiscreteFunction(sys::ImplicitDiscreteSystem, args...)
. Check Documenter's build log for details.
Discrete Domain
ModelingToolkit.Shift
— Typestruct Shift <: Symbolics.Operator
Represents a shift operator.
Fields
t
: Fixed Shiftsteps
Examples
julia> using Symbolics
julia> Δ = Shift(t)
(::Shift) (generic function with 2 methods)