How to implement MPC when the number of states is greater than the number of outputs?
4 ビュー (過去 30 日間)
古いコメントを表示
I want to implement MPC using MATLAB's Model Predictive Control Toolbox.
When I checked the official MATLAB website, I found only explanations for cases where the number of outputs and states are the same. Is there a method to implement MPC when the number of states is greater than the number of outputs (i.e., when the outputs are a subset of the states)?
0 件のコメント
採用された回答
Sam Chak
2025 年 2 月 10 日
Hi @준호
The MPC Controller still functions effectively even when the number of states exceeds the number of outputs. I have made slight modifications to the code using this example:
% continuous-time state-space matrices, with temperature as first output
A = [-5 -0.3427;
47.68 2.785];
B = [ 0 1
0.3 0];
C = [ 0 1]; % Only 1 state is measurable
D = zeros(1, 2);
% create state space plant model
CSTR = ss(A,B,C,D);
% set names
CSTR.InputName = {'T_c', 'C_A_f'}; % set names of input variables
CSTR.OutputName = {'T'}; % set names of output variables
CSTR.StateName = {'C_A', 'T'}; % set names of state variables
% set units
CSTR.InputUnit = {'deg K', 'kmol/m^3'}; % set units of input variables
CSTR.OutputUnit = {'deg K'}; % set units of output variables
CSTR.StateUnit = {'kmol/m^3', 'deg K'}; % set units of state variables
CSTR = setmpcsignals(CSTR, 'MV', 1, 'UD', 2, 'MO', 1); % No unmeasured output
old_status = mpcverbosity('off');
mpcobj = mpc(CSTR,0.5) %#ok<*NOPTS>
mpcobj.PredictionHorizon = 15;
mpcobj.MV.Min = -10; % K
mpcobj.MV.Max = 10; % K
mpcobj.MV.RateMin = -1; % K/step
mpcobj.MV.RateMax = 1; % K/step
mpcobj.W.ManipulatedVariablesRate = 0.3;
mpcobj.W.OutputVariables = [1];
T = 26; % set for for 26 control intervals
r = [0;
2];
sim(mpcobj, T, r)
2 件のコメント
Sam Chak
2025 年 2 月 11 日
You are welcome, @준호. If you find the demonstration helpful, please consider clicking 'Accept' ✔ on the answer to close the issue once the original problem involving mpc() is resolved.
Plotting other states may suggest that their signals are somewhat measurable and can thus be considered as "outputs of the system." In that case, you may use the original code from the CTSR example.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Refinement についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!