Model predictive control - Basics #1357
-
Hello, I have a question about the model predictive control - Basics Tutorial: https://yalmip.github.io/example/standardmpc/ The first parts were working fine for me, until the section Improving simulation performance comes up. After I implemented the suggested code:
and start to run the script again, ill get an error message that says: _Warning: No suitable solver Error in MPC_Basics (line 52) After I saw that i dont have a suitable solver i installed Mosek but that doesnt help. I use Matlab R2023b with the Optimization toolbox and Mosek installation. Here is my full code:
Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
It's
and Also, modern syntax of optimizer allows you to call it with values as any other function, i.e. |
Beta Was this translation helpful? Give feedback.
-
The code can be revised as B = [1;0]; nx = 2; % Num of States % MPC data Q = eye(2); % Initial State x0 = sdpvar(2,1); % Als optimierungsvariable definieren u = sdpvar(repmat(nu,1,N),repmat(1,1,N)); % repmat erstellt eine matrix mit dem Wert, dass das erste Argument hat, mit der Form zweites Argument X drittes Argument constraints = []; x = x0; for k = 1:N
end ops = sdpsettings('verbose',2); controller = optimize(constraints, objective); % Vorteil der Variante das erst hier x0 festegelegt wird ` |
Beta Was this translation helpful? Give feedback.
It's
controller = optimizer(...
and
Also, modern syntax of optimizer allows you to call it with values as any other function, i.e.
uk = controller(x);
which is more natural