Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Matrix/vector mistake - wrong control input in NMPC Optimization

1 回表示 (過去 30 日間)
pozmogov
pozmogov 2019 年 7 月 8 日
閉鎖済み: Walter Roberson 2020 年 1 月 25 日
I'm working on NMPC for moving object. The MPC parameters/initial conditions are set as follows:
mpciterations = 10; % Number of MPC iterations to be performed
N = 10; % Length of optimization horizon
T = 0.1; % Sampling interval
u0 = 320*ones(4,N); % Initial guess of open loop control
tmeasure = 0.0; % Time measurement of initial value
xmeasure =[0 0 0 0 0 0 0 0 0 0 50 0]';
where u0 is the 4*10 matrix (4 rotors of quadcopter).
The problem appearing during the simulation is that the calculated closed-loop control input is saved as a vector with one column, e.g. 40*1, not 10*4 and calculated control input is not adequate (e.g. ).
My assumption is that the wrong calculation of the control signal is over the wrong recording of u, not in four columns and some syntax should be added/changed and maybe the running costs representation should be then also modified for the correct matrix multiplication.
Code files are attatched. "script2" contains parameters of mnpc, constraints, mathematical model and calls the "nmpc" routine file.
Thank you for your answer!

回答 (0 件)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by