how to set nominal values in model predictive controller using scripts?

5 ビュー (過去 30 日間)
jana nassereddine
jana nassereddine 2025 年 1 月 2 日
コメント済み: jana nassereddine 2025 年 2 月 6 日
Hello,
so i have this code, and i need to set nominal values for manipulated variables, however i am keep getting an error,
% Set the nominal values in the controller.
x = [25; 50; 0];
u = [-10; 0; -5];
nlobj.Model.Nominal = ('X',x,'U',u); % the error is for this one;
if i add only the first two lines, will the controller take as nominal values for inputs and states?;
nlobj = nlmpc(3,2,'MV',[1 2 3],'MD',[4 5]);

回答 (1 件)

Charu
Charu 2025 年 2 月 3 日
編集済み: Charu 2025 年 2 月 3 日
Hello Jana,
According to my understanding, you are attempting to set nominal values for the states and manipulated variables of a nonlinear model predictive control- “nlmpc” object in MATLAB. The error encountered is due to the fact that “Nominal” field within “Model” Structure does not exist, assuming you are using MATLAB R2024b.
The fields for “nlobj.Model” are :
nlobj = nlmpc(3,2,'MV',[1 2 3],'MD',[4 5]);
Simply defining the object with these parameters will automatically set nominal values for states or inputs.
Here is the documentation link of the “nlmpc” function for further information:
Hope this helps.
  1 件のコメント
jana nassereddine
jana nassereddine 2025 年 2 月 6 日
thank you for your answer, but what if I need to change the nominal values? to set them myself,

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeModel Predictive Control Toolbox についてさらに検索

製品


リリース

R2024a

Community Treasure Hunt

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

Start Hunting!

Translated by