mpt_mpsol2pu

Purpose

Converts a parametric solution generated by solvemp to a PolyUnion object

Syntax

pu = mpt_mpsol2pu(sol)

Description

pu = mpt_mpsol2pu(sol) converts a solution obtained by YALMIP's solvemp() function to a PolyUnion object. This allows to easily convert solvemp solutions into explicit MPC controllers by ctrl = EMPCController(mpt_mpsol2pu(sol)).

This function produces an instance of the PolyUnion class whose polyhedral partition is taken from sol.Pn. The primal optimizer (given by sol.Fi and sol.Gi) is assigned to the primal function of the polyunion, while the cost (represented by sol.Ai, sol.Bi, and sol.Ci) is converted to the obj function of the union.

Note that, if the input solution contains overlapping partitions, then an array of polyunions will be returned. Each element of such an array then represents the corresponding overlapping partition of the input solution. If the objective function is piecewise affine, you can subsequently remove the overlaps by calling pu = pu.min('obj').

Input Arguments

sol

Solution obtained by solvemp

Class: cell

Output Arguments

pu

Parametric optimizer represented as an instance of the PolyUnion class

Class: PolyUnion


© 2003-2013 Michal Kvasnica: STU Bratislava, michal.kvasnica@stuba.sk