Simulation is slow when porting nonlinear MPC from Matlab2018a to 2015a

2 次查看(过去 30 天)
Hi there,
I have both versions of Matlab 2018a and 2015a. Due to some reason with my main simulation, I have to run simulation in 2015a. As 2015a does not have nonlinear MPC, I used the example of nonlinear MPC "Nonlinear MPC Control of an Ethylene Oxidation Plant". This Simulink model just uses two Matlab functions for the job. I converted back to 2015a and manipulate the input a little so simulation can run. Basically, make Ts, PredictionHorizon, ControlHorizon, u1LowLimit, u1HighLimit as explicit constant input to the function. The screenshot is attached.
The simulation can run and produce same result as Matlab 2018a (as I ran half way through). However it is extremely slow. As 2018a goes with Automatic solver selection as default, I changed to ode45 to be the same as the converted 2015a but there is no difference in how 2018a runs.
I wonder if there could be a simple change to make it happen. Or another suggestion to implement nonlinear MPC in 2015a is also appreciated.
Thanks

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Linear Plant Specification 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by