system
- class system(f, nx, nu, system_type='discrete', sampling_rate=1.0, t0=0.0, method='cvodes')[source]
A class used to define the system dynamics of an optimal control problem.
The dynamics can be discrete or continuous. A discrete system is defined by a difference equation
\[x(t_{k+1}) = f(t_k,x(t_k),u(t_k))\]and a continous system is defined by the ordinary differential equation
\[\dot{x}(t_k)=f(t_k,x(t_k),u(t_k))).\]In the letter case the differential equation will be discretized by a choosen integration method.
- Parameters:
f (callable) – Function defining the right hand side of the system dynamics of the form \(f(t,x,u)\) or \(f(x,u)\) in the
autonomous
case. See alsof
.nx (int) – Dimension of the state. Must be a positive integer. See also
nx
.nu (int) – Dimension of the control. Must be a positive integer. See also
nu
.system_type (str, optional) – String defining if the given system dynamics are discrete or continuous. The default is ‘discrete’.
sampling_rate (float, optional) – Sampling rate defining at which time instances the dynamics are evaluated. The default is 1.
t0 (float, optional) – Initial time for the optimal control problem. The default is 0. See also
t0
.method (str, optional) – String defining which integration method should be used to discretize the system dynamics. The default is ‘cvodes’. For further informations about the provided integrators see
method
.
Attributes
If True, the system is time-invariant.
Right hand side \(f(t,x,u)\) of the system dynamics.
Sampling time \(h\) of the system.
Integration method for discretization of the dynamics.
Dimension of the control.
Dimension of the state.
String defining whether the dynamics are discrete or continuous.
Initial time of the optimal control problem.
Indicating whether the system dynamics are linear.
Methods
Initialize the system with linear dynamics.
Loads a nMPyC system object from a file.
Saving the system to a given file with dill.
Set options for the integration method.
Evaluate right hand side \(f(t,x,u)\) of the dynamics.
Evaluate discretized right hand side of the system dynamics.