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

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

Réponse acceptée

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

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Model Predictive Control Toolbox dans Help Center et File Exchange

Produits


Version

R2023a

Community Treasure Hunt

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

Start Hunting!