symbolic utils module

simupy.utils.symbolic.augment_input(system, input_=[], update_outputs=True)[source]

Augment input, useful to construct control-affine systems.

Parameters:
  • system (DynamicalSystem) – The sytsem to augment the input of
  • input (array_like of symbols, optional) – The input to augment. Use to augment only a subset of input components.
  • update_outputs (boolean) – If true and the system provides full state output, will also add the augmented inputs to the output.
simupy.utils.symbolic.grad(f, basis, for_numerical=True)[source]

Compute the symbolic gradient of a vector-valued function with respect to a basis.

Parameters:
  • f (1D array_like of sympy Expressions) – The vector-valued function to compute the gradient of.
  • basis (1D array_like of sympy symbols) – The basis symbols to compute the gradient with respect to.
  • for_numerical (bool, optional) – A placeholder for the option of numerically computing the gradient.
Returns:

grad – The symbolic gradient.

Return type:

2D array_like of sympy Expressions

simupy.utils.symbolic.lambdify_with_vector_args(args, expr, modules=({'ImmutableMatrix': <class 'numpy.matrixlib.defmatrix.matrix'>}, 'numpy', {'Mod': <ufunc 'remainder'>}))[source]

A wrapper around sympy’s lambdify where process_vector_args is used so generated callable can take arguments as either vector or individual components

Parameters:
  • args (list-like of sympy symbols) – Input arguments to the expression to call
  • expr (sympy expression) – Expression to turn into a callable for numeric evaluation
  • modules (list) – See lambdify documentation; passed directly as modules keyword.
simupy.utils.symbolic.process_vector_args(args)[source]

A helper function to process vector arguments so callables can take vectors or individual components. Essentially unravels the arguments.

class simupy.utils.symbolic.sinc

Bases: sympy.core.function.AppliedUndef

default_assumptions = {}
class simupy.utils.symbolic.step

Bases: sympy.core.function.AppliedUndef

default_assumptions = {}