is it possible to use neural network prediction model in Adaptive MPC ?
15 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Naveen kumar koritala
am 17 Nov. 2023
Bearbeitet: Emmanouil Tzorakoleftherakis
am 22 Nov. 2023
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.
0 Kommentare
Akzeptierte Antwort
Emmanouil Tzorakoleftherakis
am 21 Nov. 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 Kommentare
Emmanouil Tzorakoleftherakis
am 22 Nov. 2023
Bearbeitet: Emmanouil Tzorakoleftherakis
am 22 Nov. 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:
- generatematlabfunction to get 'state fcn'
- 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)
- 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
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Model Predictive Control Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!