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

15 visualizaciones (últimos 30 días)
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.

Respuesta aceptada

Emmanouil Tzorakoleftherakis
Emmanouil Tzorakoleftherakis el 21 de Nov. de 2023
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 comentarios
Naveen kumar koritala
Naveen kumar koritala el 22 de Nov. de 2023
Editada: Naveen kumar koritala el 22 de Nov. de 2023
"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 el 22 de Nov. de 2023
Editada: Emmanouil Tzorakoleftherakis el 22 de Nov. de 2023
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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Model Predictive Control Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by