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)?

採用された回答

Sam Chak
Sam Chak 2025 年 2 月 10 日
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>
MPC object (created on 10-Feb-2025 14:51:32): --------------------------------------------- Sampling time: 0.5 (seconds) Prediction Horizon: 10 Control Horizon: 2 Plant Model: -------------- 1 manipulated variable(s) -->| 2 states | | |--> 1 measured output(s) 0 measured disturbance(s) -->| 2 inputs | | |--> 0 unmeasured output(s) 1 unmeasured disturbance(s) -->| 1 outputs | -------------- Indices: (input vector) Manipulated variables: [1 ] Unmeasured disturbances: [2 ] (output vector) Measured outputs: [1 ] Disturbance and Noise Models: Output disturbance model: default (type "getoutdist(mpcobj)" for details) Input disturbance model: default (type "getindist(mpcobj)" for details) Measurement noise model: default (unity gain after scaling) Weights: ManipulatedVariables: 0 ManipulatedVariablesRate: 0.1000 OutputVariables: 1 ECR: 100000 State Estimation: Default Kalman Filter (type "getEstimator(mpcobj)" for details) Unconstrained Use built-in "active-set" QP solver with MaxIterations of 120.
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 件のコメント
준호
준호 2025 年 2 月 11 日
Thanks a lot.
Can I plot the other states(is not part of output, C_A)?
Sam Chak
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 ExchangeRefinement についてさらに検索

タグ

製品


リリース

R2023b

Community Treasure Hunt

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

Start Hunting!

Translated by