result
- class result(x0, t0, h, N, K)[source]
Class used to store the simulation results of the MPC simulation.
To obtain the individual components of the simulation, such as closed loop and open loop results, the individual attributes need to be called.
Also the result object contains information about errors and other solver statistics, which can be used for further investigation of the simulation progress.
Additionally, this class provides a way to visualize the results in a suitable way with the
plot()
method.- Parameters:
x0 (array) – Initial state.
t0 (float) – Initial time.
h (float) – Sampling rate.
N (int) – MPC horizon.
K (int) – Number of MPC Interations.
Attributes
MPC horizon
Total ellapsed time for the closed loop simulation.
List containing the ellapsed time of every single itertaion of the closed loop simulation.
Error message with which the solver failed.
Stage costs evaluated at the closed loop trajectory and feedback.
List containing the stage costs evaluated at the open loop trajectories and controls of all MPC itertaions.
Sampling rate.
Name of the choosen optimization method.
True if the solver converged sucessfully in all MPC itertaions, false if the MPC loop abort prematurely.
Number of succesfull MPC iterations.
Initial time
Time sequence at which the closed loop states and controls are evaluated.
List containing the time sequences at which the closed loop states and controls are evaluated in the open loop simulations.
Closed loop feedback.
List containing the open loop optimal control values of all MPC itertaions.
Initial state.
Closed loop trajectory.
List containing the open loop trajectories of all MPC itertaions.
Methods
Loads a nMPyC result object from a file.
Plot the results of the MPC simulation.
Saving the result to a given file with dill.
Shows the errors that occurred during the simualtion.