I am using the Matlab/Simulink Interface and run the code on a dSPACE Platform.
Until now everything worked really well.
Now my goal is to change the parameters of my model on runtime.
I implemented it and it works to the extend of compiling and running in real time, with the problem being that it gives bad behavior (which it didnt before I implemented the parametric version), e.g. solver status 1, 4 etc.
The within matlab simulation works and gives the same results as before.
For that I used the 2 additional lines of code (beside changing the modell ofc).
opt_p is the vector with my parameters and has a length of 40. I am aware that these 2 lines are somewhat redundant.
ocp_opts.set('parameter_values', opt_p); ocp.set('p', opt_p);
Now to the Simulink interface. Here I was a bit unsure of the names of the inputs and so on. Here is my code adaption:
simulink_opts = get_acados_simulink_opts; simulink_opts.inputs.parameter_traj = 1;
This generated an updated S-Function with a new input. The Info in the Matlab command window shows:
3) parameters - concatenated for all shooting nodes 0 to N+1, size 
which makes (some) sense, since N = 10, and my parameters have length 40. Shouldnt it be 12*40 if it were from 0 to N+1?
Anyways, I then connect a (for now to check the implementation) constant parameter vector of that length (440) to my s-function in Simulink, compile (which works) and run it.
I very certain that I am using the correct parameters (same as in the matlab simulation, which works)
Sadly this gives unexpected and bad behavior. It looks a little like the parameters which I give are not being actually applied in real time.
Thanks in advance!
With kind regards,