PolyUnion

Purpose

Represents a union of polyhedra in the same dimension

Syntax

PU = PolyUnion(P)
PU = PolyUnion('Set',P,'Domain',D,'Convex',true,'Overlaps',false,...)

Description

The PolyUnion object represent collection of polyhedra in the same dimension. The only restriction to construct the PolyUnion object is that the sets have a common dimension. The union thus can contain bounded, unbounded, and lower-dimensional polyhedra. Empty sets are removed from at the time of construction of PolyUnion object. You can associate various properties with the PolyUnion object: By specifying any of the above properties you promise that these properties are automatically satisfied by the provided set, otherwise unexpected results may occur. These properties can be accessed via PU.Internal field. You can associate functions to any of the set via addFunction method of the ConvexSet class. Function handles and all properties of the sets can be accessed via PolyUnion.Set property based on the index. For a list of available methods type "methods('PolyUnion')".

Input Arguments

P

Non-empty polyhedra in the same dimension.

Class: Polyhedron

Domain

Specifies domains of the union.

Class: Polyhedron

Convex

Set this property to true if you are sure that the union of the polyhedra is convex.

Class: logical

Allowed values:

  • true
  • false

Overlaps

Set this property to false if you are sure that the union of the polyhedra is non-overlapping.

Class: logical

Allowed values:

  • true
  • false

Connected

Set this property to true if you are sure that the union of the polyhedra is connected. If the union is convex, then this property is automatically set as true.

Class: logical

Allowed values:

  • true
  • false

Bounded

Set this property to true if you are sure that all the polyhedra in the union are bounded.

Class: logical

Allowed values:

  • true
  • false

FullDim

Set this property to true if you are sure that all the polyhedra in the union are full-dimensional.

Class: logical

Allowed values:

  • true
  • false

Output Arguments

PU

Object of the PolyUnion class.

Class: PolyUnion

Example(s)

Example 1

Construt the convex and non-overlapping union of two polyhedra in 2D. Define the polyhedra
 P(1) = Polyhedron('lb',[-1;0],'ub',[0;1]); 

 P(2) = Polyhedron('lb',[0;0],'ub',[1;1]); 
 Assign linear functions to these sets 
 P(1).addFunction(AffFunction(eye(2),[1;0]),'f'); 

 P(2).addFunction(AffFunction(-eye(2),[1;0]),'f'); 
 Create the union and set convexity and overlaps properties because these are known.
 U = PolyUnion('Set',P,'Convex',true,'Overlaps',false); 
 Plot the polyhedra 
 U.plot 

../../../../../../fig/mpt/modules/geometry/unions/@PolyUnion/polyunion_img_1.png

We can plot also functions over the union
 U.fplot 

../../../../../../fig/mpt/modules/geometry/unions/@PolyUnion/polyunion_img_2.png

Example 2

Create three random polyhedra and merge them to PolyUnion object.
 P(1) = ExamplePoly.randVrep; 

 P(2) = ExamplePoly.randVrep; 

 P(3) = ExamplePoly.randVrep; 
 We don't know any of the particular properties of the union, we can call the short syntax:
 U = PolyUnion(P)
PolyUnion in the dimension 2 with 3 polyhedra.
Functions : none
Plot the sets
 U.plot 

../../../../../../fig/mpt/modules/geometry/unions/@PolyUnion/polyunion_img_3.png

We can access the sets via U.Set property and add eventually function handles to each set.
 U.Set(1).addFunction(AffFunction(eye(2)),'g'); 

 U.Set(2).addFunction(AffFunction(2*eye(2)),'g'); 

 U.Set(3).addFunction(AffFunction(3*eye(2)),'g'); 
 Plot the function over the sets 
 U.fplot 

../../../../../../fig/mpt/modules/geometry/unions/@PolyUnion/polyunion_img_4.png

See Also

polyhedron, union


© 2010-2013 Martin Herceg: ETH Zurich, herceg@control.ee.ethz.ch