How to pass external time-varying parameters to nonlinear MPC models?

14 次查看(过去 30 天)
I have now established a MIMO nonlinear mpc model using the mpc toolbox, and my state function requires external input of parameters, which are time-varying and known. I don't know how to pass external variable parameters to a state function ,What should I do?
As far as I know, 'options. Parameters' can only be transferred to a fixed value, like this:
...
demand = 2000;
supply = 1000;
nloptions = nlmpcmoveopt;
nloptions.Parameters = {demand, supply};
x0=[0;80;50;60;40;50;29;70;40];
u0=[80;80;80;80;80;80;80;80];
[~,~,Info] = nlmpcmove(nlobj,x0,u0,[],[],nloptions);
...
And if I have the following requirements, how should I achieve them?
The prediction time domain and control time domain are both 5, and within these 5 control intervals, the external parameter demands of the state function are [2000 3000 4000 3000 1000]
If you follow the above code, the incoming demand remains unchanged

采纳的回答

Emmanouil Tzorakoleftherakis
编辑:Emmanouil Tzorakoleftherakis 2023-5-24
Hello,
There are two ways of doing this:
1) With Nonlinear MPC, you can set your time-varying parameters as measured disturbances and provide them at runtime. See an example here. In your case, pay attention to the dimensions of the MD signal - you should provide the entire vector if you want 'previewing' meaning that each element in the vector will correspond to a specific time step
2) Use linear time-varying MPC and provide a sequence of A,B,C,D matrices for your entire horizon. Each set of matrices will be calculated based on the values you want. See a couple of examples here:
Hope this helps
  12 个评论
Emmanouil Tzorakoleftherakis
Can you please post these in a separate thread? That way they will be more discoverable is someone has similar questions. Also, please clarify what you mean when you say "I tried to derive the state for some time in the future by the obtained Info.MVopt and my state function". Do you mean you integrated your state function with, e.g., ode45 separately? Did you use the appropriate integration step?
Thanks

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Code Generation 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by