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:
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:
where N
represents the prediction horizon.
To synthesize an explicit MPC controller, use the toExplicit()
method of MPCController
objects, i.e.
The table below shows what are the equivalents of important MPT2 functions in MPT3:
MPT2 function | Equivalent 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_getInput | MPCController.evaluate() |
mpt_ownmpc | MPCController.toYALMIP() , MPCController.fromYALMIP() |
mpt_invariantSet | EMPCController.toInvariant() |
mpt_computeTrajectory | ClosedLoop.simulate() |
mptctrl/length | EMPCController.nr |
mptctrl/plot | EMPCController.partition.plot() |
mptctrl/plotj | EMPCController.cost.fplot() |
mptctrl/plotu | EMPCController.feedback.fplot() |
mptctrl/sim | ClosedLoop.simulate() |