MPC Block is not accepting deadtime for its internal plant Model

7 views (last 30 days)
Hi,
I’m currently working on a Model Predictive Control (MPC) design in Simulink and am encountering an issue with the handling of deadtime in my system. Here’s a summary of my setup:
  • Process Transfer Function:My system has a first-order transfer function with deadtime, modeled as:
When I simulate the system in Simulink, the MPC controller uses an internal model by default where it is the same exactly as G(s) but without the deadtime term (exp(-5s)). I then tried to import a the model which includes the deadtime and use but this error occurs:
  • Index in position 2 exceeds array bounds. Index must not exceed 2
I define the G(s) in the workspace using the following command:
ThemeCopy
Gs=tf(1,[6.5 1],'InputDelay',5.5);
I even tried using G(s) in simulink without deadtime and have put right after it a transport delay with the required deadtime which is 5.5 in my case and still the MPC Designer used an internal model without this delay. Note that the internal model it uses by default is the same as G(s) but without the deadtime. I have also tried converting Gs to state space model using c2d command but still MPC Designer removed the deadtime and wouldn't allow me to import a plant model as mentioned earlier due to the same error:
  • Index in position 2 exceeds array bounds. Index must not exceed 2
Thank you in advance for your help!

Answers (1)

MULI
MULI on 22 Apr 2025
Edited: MULI on 22 Apr 2025
Hi @ali,
  • The issue you are facing is because the MPC block cannot directly accept models that have a "deadtime".
  • Simulink and MPC Designer will remove the delay when computing the internal prediction model, as the internal model must be a finite-dimensional, delay-free, discrete-time system.
  • You can verify this from the documentation here:https://www.mathworks.com/help/mpc/gs/mpc-modeling.html
  • To resolve this issue, you can try to approximate the deadtime with an equivalent dynamic model using a "Padé Approximation".
You can refer the below example code:
% Original system without deadtime
Gp = tf(1, [6.5 1]);
% Approximate the deadtime with a 2nd-order Padé approximation
[Num, Den] = pade(5.5, 2);
DelayApprox = tf(Num, Den);
% Combine plant and delay
G_with_delay = DelayApprox * Gp;
% Discretize for use in MPC
Ts = 1; % Example sampling time
Gd = c2d(G_with_delay, Ts);
% Convert to state-space
SS_model = ss(Gd);
This approach removes the direct deadtime and ensures that the model is compatible with the MPC blocks.
For more details on this, you can refer to the MathWorks documentation on Padé approximation:

Community Treasure Hunt

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

Start Hunting!