Hello Acados community
I am new to acados
and I am working on developing an MHE example in MATLAB
on Windows. It is based on the Python
Pendulum on cart example which can be found here
For the estimation of states, the example uses the controls as parameters and state noise as controls which are based on the state covariance. The equations can be found inside the model file of MHE.
The OCP is compiled without any errors but does not produce results. It can be seen that acados
fails and return status β 1 β after the solve function is called. I am not able to figure out the reason for this failure.
The developed MATLAB
code can be found here
There are 2 sets of files (6 in total) in the folder.
-
Pend_on_cart_example_ocp.m: This is the main simulation file that uses the model function (export_pendulum_ode_model.m) and a function for setup the
acados
problem for the simulation (setup_sim). It generates the states and the control to solve the OCP. This part of the problem is working fine and generates good results. The state and control outputs are saved to be used for the MHE estimation. -
Pend_on_cart_with_noisy_param_MHE.m: This is the main file for the MHE estimation which uses the model (export_mhe_ode_model_with_noisy_param.m) and the estimator is set up in the setup_estimator.m function also called in the main file.
It is here that acados
fails and does not generate results after the solve function is called. This is the output obtained from printing the status
iter res_stat res_eq res_ineq res_comp qp_stat qp_iter alpha
0 NaN NaN 0.000000e+00 0.000000e+00 0 0 0.000000e+00
The plots from the results are as below:
Looking forward to your support. Thank you!