symbolic systems module

class simupy.systems.symbolic.DynamicalSystem(state_equation=None, state=None, input_=None, output_equation=None, constants_values={}, dt=0, initial_condition=None, code_generator=None, code_generator_args={})[source]

Bases: simupy.systems.DynamicalSystem

DynamicalSystem constructor, used to create systems from symbolic expressions.

Parameters:
  • state_equation (array_like of sympy Expressions, optional) – Vector valued expression for the derivative of the state.
  • state (array_like of sympy symbols, optional) – Vector of symbols representing the components of the state, in the desired order, matching state_equation.
  • input (array_like of sympy symbols, optional) – Vector of symbols representing the components of the input, in the desired order. state_equation may depend on the system input. If the system has no state, the output_equation may depend on the system input.
  • output_equation (array_like of sympy Expressions) – Vector valued expression for the output of the system.
  • constants_values (dict) – Dictionary of constants substitutions.
  • dt (float) – Sampling rate of system. Use 0 for continuous time systems.
  • initial_condition (array_like of numerical values, optional) – Array or Matrix used as the initial condition of the system. Defaults to zeros of the same dimension as the state.
  • code_generator (callable, optional) – Function to be used as code generator.
  • code_generator_args (dict, optional) – Dictionary of keyword args to pass to the code generator.

By default, the code generator uses a wrapper for sympy.lambdify. You can change it by passing the system initialization arguments code_generator (the function) and additional keyword arguments to the generator in a dictionary code_generator_args. You can change the defaults for future systems by changing the module values. See the readme or docs for an example.

copy()[source]
equilibrium_points(input_=None)[source]
input
output_equation
prepare_to_integrate()[source]
state
state_equation
update_input_jacobian_function()[source]
update_output_equation_function()[source]
update_state_equation_function()[source]
update_state_jacobian_function()[source]
class simupy.systems.symbolic.MemorylessSystem(input_=None, output_equation=None, **kwargs)[source]

Bases: simupy.systems.symbolic.DynamicalSystem

A system with no state.

With no input, can represent a signal (function of time only). For example, a stochastic signal could interpolate points and use prepare_to_integrate to re-seed the data.

DynamicalSystem constructor

Parameters:
  • input (array_like of sympy symbols) – Vector of symbols representing the components of the input, in the desired order. The output may depend on the system input.
  • output_equation (array_like of sympy Expressions) – Vector valued expression for the output of the system.
state