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

7 views (last 30 days)
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

Accepted Answer

Emmanouil Tzorakoleftherakis
Edited: Emmanouil Tzorakoleftherakis on 24 May 2023
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 Comments
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

Sign in to comment.

More Answers (0)

Products


Release

R2018b

Community Treasure Hunt

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

Start Hunting!