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

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

 Risposta accettata

Toshinobu Shintai
Toshinobu Shintai il 17 Mag 2023

0 voti

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

1 Commento

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

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Model Predictive Control Toolbox in Centro assistenza e File Exchange

Prodotti

Release

R2023a

Richiesto:

Ren
il 17 Mag 2023

Commentato:

Ren
il 17 Mag 2023

Community Treasure Hunt

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

Start Hunting!