Info

此问题已关闭。 请重新打开它进行编辑或回答。

Matrix/vector mistake - wrong control input in NMPC Optimization

1 次查看(过去 30 天)
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