非線形MPCブロック​についての質問(入力​部分のrefの扱いに​ついて)

非線形MPCブロックについて質問です。
非線形MPCブロックのrefへの入力を目標値ではなく、パラメータとして扱い、下記のリンクのようにカスタムコスト関数を用いて最適化を行いたいと考えています。
そこで質問です。matlabスクリプトでrefのパラメータを定義するときの書き方はどのようにしたらよいでしょうか。
Optimization.CustomCostFcn = "myCostFunction" ;
関数J = myCostFunction(X,U,e,data)
% refへの入力をSとする
S = nlobj.data.Referenses
このような形ですとエラーがでるので問い合わせさせていただきました。よろしくお願いします。

 Akzeptierte Antwort

Toshinobu Shintai
Toshinobu Shintai am 17 Mai 2023

0 Stimmen

以下のデモモデルをご参照ください。
このデモモデルでは、以下のように4要素のベクトルがrefに入力されていますので、
カスタムコスト関数「oxidationCostFcn.m」に、例えば「data.Referenses(1)」と記述すると、refに入力されたベクトルの1番目の要素にアクセスできていることが分かります。

1 Kommentar

Ren
Ren am 17 Mai 2023
わかりやすいご説明ありがとうございます.試してみます.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Model Predictive Control Toolbox finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2023a

Gefragt:

Ren
am 17 Mai 2023

Kommentiert:

Ren
am 17 Mai 2023

Community Treasure Hunt

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

Start Hunting!