Main /


Migrating MPC problems described by sysStruct and probStruct

In MPT2, definition of the MPC problem was split into a sysStruct structure, which described the prediction model, and a probStruct structure, which defined parameters of the MPC problem.

MPT3 contains a completely redesigned user interface for control synthesis, which combines these two structure into a single object. To migrate your MPC setup, use the mpt_import function:

model = mpt_import(sysStruct, probStruct)

The command above will migrate your MPC problem setup into an MPT3 object, which represents the prediction model, along with constraints and penalties on the model's states, inputs, and outputs.

To synthesize an on-line MPC controller using the MPT3 prediction model, use the MPCController constructor:

mpc = MPCController(model, N)

where N represents the prediction horizon.

To synthesize an explicit MPC controller, use the toExplicit() method of MPCController objects, i.e.

mpc = MPCController(model, N)
expmpc = mpc.toExplicit()

The table below shows what are the equivalents of important MPT2 functions in MPT3:

MPT2 functionEquivalent in MPT3
ctrl = mpt_control(sysStruct, probStruct)model = mpt_import(sysStruct, probStruct); ctrl = MPCController(model, probStruct.N).toExplicit()
ctrl = mpt_control(sysStruct, probStruct, 'online')model = mpt_import(sysStruct, probStruct); ctrl = MPCController(model, probStruct.N)
mpt_ownmpcMPCController.toYALMIP(), MPCController.fromYALMIP()