Skip to contents

System() is the single system type of ModelingToolkit 11. A system with an independent variable iv describes differential (or differential algebraic, stochastic, jump, delay or discrete) equations; without one it describes a nonlinear system, or an optimization problem when costs are given.

Usage

System(
  eqs = list(),
  iv = NULL,
  unknowns = NULL,
  ps = NULL,
  brownians = NULL,
  name = NULL,
  systems = list(),
  observed = list(),
  bindings = NULL,
  initial_conditions = NULL,
  guesses = NULL,
  defaults = NULL,
  initialization_eqs = list(),
  continuous_events = list(),
  discrete_events = list(),
  constraints = list(),
  costs = list(),
  consolidate = NULL,
  noise_eqs = NULL,
  jumps = list(),
  poissonians = NULL,
  connector_type = NULL,
  assertions = list(),
  metadata = list(),
  description = "",
  tspan = NULL,
  tstops = list(),
  inputs = list(),
  outputs = list(),
  state_priorities = NULL,
  irreducibles = NULL,
  is_discrete = FALSE,
  discover_from_metadata = TRUE,
  checks = TRUE,
  frame = NULL,
  fixed_point = NULL
)

Arguments

eqs

Equations: Equation objects, formulas such as D(x) ~ -x, connections, or a list of them.

iv

The independent variable, or NULL.

unknowns, ps

Unknowns and parameters, or NULL to infer them.

brownians

Brownian variables appearing in eqs.

name

The system name, a string. Required.

systems

A list of subsystems.

observed

Observed equations y ~ expression.

bindings, initial_conditions, guesses

Variable maps: lists of formulas x ~ 1, of pairs list(x, 1), or named lists.

defaults

Legacy name for initial_conditions.

initialization_eqs

Equations that hold only at the initial time.

continuous_events, discrete_events

Events, see SymbolicContinuousCallback() and SymbolicDiscreteCallback().

constraints, costs, consolidate

Constraints, costs and the function combining costs, for optimization and optimal control.

noise_eqs

Noise coefficients of a stochastic system.

jumps

Jumps of a jump system.

poissonians

Poissonian variables.

connector_type

Connector type, set by connector().

assertions

Named list mapping conditions to error messages.

metadata

A list of metadata.

description

A string.

tspan

Default time span c(t0, t1).

tstops

Extra integrator stop times.

inputs, outputs

Input and output variables.

state_priorities, irreducibles

State selection hints.

is_discrete

Whether the system is a discrete time system.

discover_from_metadata

Collect defaults and guesses from metadata.

checks

Run consistency checks.

frame, fixed_point

For the multibody System() of symcompR (SymPy's physics.mechanics): a call with no arguments, with a reference frame as its first argument or with frame or fixed_point goes to symcompR::System(), so attaching both packages is safe.

Value

A System.

Details

Unknowns and parameters are inferred from the equations when they are not given. Defaults declared on the variables become initial conditions (numbers) or bindings (expressions and NA), and guesses are collected the same way.

Examples

t <- t_nounits; D <- D_nounits
variables("x(t)")
parameters("tau")
sys <- System(list(D(x) ~ (1 - x) / tau), t, name = "sys")
sys
#> Model sys:
#> Equations (1):
#>   Derivative(x(t), t) ~ (1 - x(t))/tau
#> Unknowns (1): x(t)
#> Parameters (1): tau