is it possible to use neural network prediction model in Adaptive MPC ?

15 次查看(过去 30 天)
In the recent MATLAB release, it is possible to use a neural network prediction model instead of a system model to obtain prediction matrices over a prediction horizon for NonLinear mpc . I am wondering whether it would be possible to use the same for an adaptive MPC case.

采纳的回答

Emmanouil Tzorakoleftherakis
You should be able to do that, but we don't have an example to show the workflow unfortunately. You would first need to use automatic differentiation to get the A,B,C,D matrices using this command.
Then you would need to take the generated m-file and place it in a MATLAB Fcn block. An example of the latter is shown here.
Hope this helps
  2 个评论
Naveen kumar koritala
编辑:Naveen kumar koritala 2023-11-22
"the generate jacobain function" can only used for multi stage mpc. this function dont generate A,B,C,D matrices. can you please explain more clearly on how to get A,B,C,D matrices.
can i use generatematlabfunction? it will generate "state fcn" and "state fcn jacobian" functions from the estimated neural network model and "state fcn jacobian" can generate A,B,C,D matrices given state and input values. my doubt here is do i have to generate A,B,C,D matrices using "state fcn jacobian" at every time step during simulation of Adaptive MPC in matlab Fcn block ?
Emmanouil Tzorakoleftherakis
编辑:Emmanouil Tzorakoleftherakis 2023-11-22
Please take a look at the links I provided more carefully. generateJacobianFunction (as the name implies) provides Jacobians. If you pass your dynamics as an argument, output will be a function that outputs Jx and Ju, aka A and B matrices. You can certainly use this function with multi-stage MPC, but at the end of the day it's just a function. You can tweak its signature and use it with adaptive MPC as well.
On a related note, generatematlabfunction could also potentially be used to calculate A and B, but it does not consider any MPC-specific circumstances, like for example having input disturbances in your prediction model. generatematlabfunction would not provide the correct matrices in scenarios like these. That said, you can use the generated 'state fcn' as input to 'generateJacobianFunction'. So the workflow would be:
  1. generatematlabfunction to get 'state fcn'
  2. use 'state fcn' as argument in 'generateJacobianFunction' to get linearization (if your MPC does not have disturbances, you can also potentially use the generated state fcn jacobian' from step 1 instead of this step)
  3. Tweak linearization function and place it in MATLAB Fcn block to use with adaptive MPC
To your last question, you don't need to call generateJacobianFunction at every time step, as the generation function is an analytical expression that depends on x and u. You can leverage this to get your linear system approximation as needed (for adaptive MPC this is required at every step).
Hope this helps

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Model Predictive Control Toolbox 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by