-
Notifications
You must be signed in to change notification settings - Fork 2
Time‐Varying Tube MPC design
The time-varying tube MPC formulation extends classical TMPC by allowing the tube cross-section to evolve along the prediction horizon. In classical tube MPC, the tube cross-section is fixed along the prediction horizon, which can lead to conservative behavior, especially in the early stages where the effect of disturbances is still limited. The time-arying tube MPC results in less conservative constraint tightening and improved feasibility. MPTplus enables the implementation of time-varying tube MPC design according to recent developments in the literature (see Tube MPC with Time-Varying Cross-Sections . The time-varying formulation:
- reduces conservatism
- improves feasibility
- is beneficial in constrained scenarios
MPTplus enables this via the TMPCController class, providing automatic synthesis of robust controllers with stage-dependent constraint tightening.
The TMPCController class constructs a robust MPC controller using tube-based formulations.
When configured with:
'TubeType','timevarying'it implements time-varying tube MPC, where disturbance effects are propagated along the prediction horizon.
TMPC = TMPCController(model, N, options)-
model– instance ofULTISystem(uncertain LTI system) -
N– prediction horizon -
options– controller configuration
| Option | Values (Default) | Description |
|---|---|---|
TubeType |
'timevarying' / 'fixed'
|
Tube MPC formulation type |
LQRstability |
0 / 1 (1) |
Enables terminal set and penalty from LQR |
solType |
0 / 1 (1) |
Output format: • 1 – control input• 0 – nominal trajectories |
-
TMPCparams
Stores computed parameters such as feedback gain, tightening terms, and internal sets -
model
Contains system dynamics, constraints, and penalties
model = ULTISystem('A', [1, 1; 0, 1], ...
'B', [0.5; 1], ...
'E', [1, 0; 0, 1]);
model.u.min = -1;
model.u.max = 1;
model.x.min = [-100; -100];
model.x.max = [ 100; 100];
model.d.min = [-0.1; -0.1];
model.d.max = [ 0.1; 0.1];
model.x.penalty = QuadFunction(diag([1, 1]));
model.u.penalty = QuadFunction(0.01);
N = 10;option = {'TubeType','timevarying','LQRstability',1};
TMPC = TMPCController(model, N, option);x0 = [-5; -2];
Nsim = 31;
data = TMPC.simulate(x0, Nsim);figure
subplot(2,1,1)
hold on, box on, grid on
title('State trajectories')
ylabel('x')
stairs([0:Nsim],data.X(1,:),'b','LineWidth',2)
stairs([0:Nsim],data.X(2,:),'r','LineWidth',2)
legend('x1','x2')
subplot(2,1,2)
hold on, box on, grid on
title('Input trajectory')
ylabel('u')
stairs([0:Nsim-1],data.U,'LineWidth',2)
The controller ensures robust constraint satisfaction under disturbances while maintaining stability via LQR terminal ingredients.
In this case, the controller is configured to return the nominal predicted trajectories instead of directly applying the receding-horizon control law.
option = {'TubeType','timevarying','LQRstability',1,'solType',0};
TMPC = TMPCController(model, N, option);
data = TMPC.simulate(x0, Nsim);-
data.X– actual (robust) state trajectory -
data.U– applied control input -
data.Xnominal– nominal predicted states -
data.Unominal– nominal inputs
This separation highlights the tube structure:
the real trajectory remains bounded around the nominal one.
figure
subplot(2,1,1)
hold on, box on, grid on
title('State trajectories')
ylabel('x')
stairs([0:Nsim],data.Xnominal(1,:),'b','LineWidth',2)
stairs([0:Nsim],data.Xnominal(2,:),'r','LineWidth',2)
legend('x1','x2')
subplot(2,1,2)
hold on, box on, grid on
title('Input trajectory')
ylabel('u')
stairs([0:Nsim-1],data.Unominal,'LineWidth',2)
The figure shows the open-loop trajectory (blue) together with the time-varying disturbance sets (red) the feasible (tightened) set (gray), illustrating how uncertainty grows and is accounted for at each prediction step. The tube cross-section grows along the horizon due to accumulated disturbances.
x0 = [48.5; -8.4];
Nsim = 30;
data = TMPC.simulate(x0, Nsim);
TMPC.PlotStateTrajectory(data.X(:,5))
The following figure shows the closed-loop nominal trajectory (blue) and the actual disturbed trajectory (black) evolving along control steps inside the the feasible (tightened) set (gray), illustrating how the controller keeps the real system within robust bounds around the nominal path.
TMPC.PlotStateTrajectory(x0, Nsim)
The explicit controller partitions the state space into regions and assigns a precomputed affine control law to each region, enabling fast real-time evaluation without solving an optimization problem online.
eTMPC = TMPC.toExplicit();
eTMPC.PlotStateTrajectory(x0, Nsim)The method is based on error dynamics:
- deterministic propagation of initial error
- accumulation of disturbance effects
- early steps → small uncertainty (less conservative)
- later steps → larger uncertainty (more conservative)
- instead of a fixed invariant set, stage-dependent set is considered
- improved feasibility
- reduced conservatism
- Use
'TubeType','timevarying'to enable the method - Use
solType = 0for debugging and analysis - The controller internally computes:
- feedback gain ( K )
- constraint tightening
- tube evolution along the horizon
c