For a Non linear Model predictive control toolbox, how can I give it a mathematical model, which is a subsystem defined in Simulink?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
afaq ahmad
am 24 Okt. 2023
Beantwortet: Emmanouil Tzorakoleftherakis
am 27 Okt. 2023
I am trying to solve a non-linear model predictive control problem using the NMPC block in Simulink. However, the mathematical model of a dynamical system, which is used by MPC for prediction, is a subsystem in Simulink. Moreover, the subsystem further contains some Matlab function blocks and NARX models, as shown in the following figure.
I am attempting to design NMPC from the workspace, and the first step is to define the nlobj as follows:
nx = 1; % no of states
ny = 1; % no of outputs
nu = 2; % no of inputs
nlobj = nlmpc(nx, ny, nu);
However, I dont know how to initialise the following commands, which tell the nlobj about the mathematical model, which in my case is a subsytem in Simulink:
nlobj.Model.OutputFcn = ''; % I tried giving the name of Simulink file, but this doesn't workout
nlobj.Model.StateFcn = '';
0 Kommentare
Akzeptierte Antwort
Emmanouil Tzorakoleftherakis
am 27 Okt. 2023
Unfortunately, this is currently not supported but our development team is aware of this request. If you don't have an analytical model of the dynamics, a workaround (although more involved) would be to use a data-driven model to approximate the subsystem of interest. This example shows what this would look like.
0 Kommentare
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!