Polyhedral Sets
The new PolyhedralSets package brings new functionality to Maple 2015 for working with sets defined either by a set of equalities and inequalities (H-Representation), or by a set of vertices and rays (V-Representation). The added functionality lets you explore the geometric and topological properties of a set, perform standard set operations, and apply linear transformations.
withPolyhedralSets
AffineHull,Area,CharacteristicCone,ConvexHull,Coordinates,Dimension,Display,DualSet,Edges,Equal,ExampleSets,Faces,Facets,Graph,ID,InteriorPoint,IsBounded,IsEmpty,IsFace,IsInInterior,IsUniversalSet,Length,LinearTransformation,LinearitySpace,LocatePoint,Plot,PolyhedralSet,PrintLevel,Project,Relations,SplitIntoSimplices,Translate,Vertices,VerticesAndRays,Volume,in,intersect,subset
Creating Sets
Visualization
The Structure of a Set
Working with and Transforming Sets
Support for n-Dimensional Sets
See Also
Polyhedral Sets can be created from a list of equalities and non-strict inequalities. Redundant relations are removed and the remaining relations are put into a canonical form that speeds up later operations.
relations≔x+y≤2,x+2 y≤3,x+y+z=1:
polyset ≔PolyhedralSetrelations;
{Coordinates:x,y,zRelations:−1≤z,y≤z+2,x=−y−z+1
Sets can also be created from a list of vertices and rays. The package automatically prunes the list of vertices and rays to capture only the extreme vertices and rays of the set.
vertices, rays≔1,2,12,12,0,−1, −2,−2:
polyset≔PolyhedralSetvertices, rays;
{Coordinates:x1,x2Relations:−1+x2≤x1,x1≤x2+1,x1≤x23+13
The set is displayed as its H-Representation, but the conversion back to its V-Representation is simple.
VerticesAndRayspolyset;
1,2,0,−1,−1,−1
The ExampleSets subpackage streamlines the creation of common sets. See ExampleSets- NDimensions and ExampleSets- ThreeDimensions.
ExampleSets:-Tetrahedron;
{Coordinates:x1,x2,x3Relations:−x2−x3−1≤x1,x2+x3−1≤x1,x1≤−x3+x2+1,x1≤x3−x2+1
The sets can be rendered in 2-D or 3-D, whether they are bounded or unbounded. The style of the visualization is fully customizable for seamless integration into any webpage, document, or presentation.
c ≔ ExampleSets:-Cube:
Plotc
Plotc, faceoptions=transparency = 0.5, color=Fill Niagara Green,edgeoptions=color=Line Niagara Burgundy, thickness=5,vertexoptions=color=Point Niagara 9, symbolsize=40, axes=none
Finding the faces of a set allows you to explore its structure. Faces of any dimension can be obtained, from the (n - 1) faces of a set in n dimensions right down to its vertices.
t≔ExampleSets:-Tetrahedron:
t_faces ≔Facest
{Coordinates:x1,x2,x3Relations:−1≤x3,x3≤x2,x2≤1,x1=x3−x2+1,{Coordinates:x1,x2,x3Relations:x3≤1,−1≤x2,x2≤x3,x1=−x3+x2+1,{Coordinates:x1,x2,x3Relations:x3≤1,−x3≤x2,x2≤1,x1=x2+x3−1,{Coordinates:x1,x2,x3Relations:−1≤x3,−1≤x2,x2≤−x3,x1=−x2−x3−1
t_vertices ≔Facest,dimension=0
{Coordinates:x1,x2,x3Relations:x3=1,x2=−1,x1=−1,{Coordinates:x1,x2,x3Relations:x3=−1,x2=1,x1=−1,{Coordinates:x1,x2,x3Relations:x3=−1,x2=−1,x1=1,{Coordinates:x1,x2,x3Relations:x3=1,x2=1,x1=1
The graph of the faces is easily generated, illuminating which faces share points with which other faces. The structure of the set can then be further explored by leveraging the functionality of the GraphTheory package.
c≔ExampleSets:-Cube:
c_graph,c_plot≔Graphc, output=graph,plot:
plots:-displayc_plot
GraphTheoryNeighborsc_graph,323
728,278,260,318,316
The dual of a polyhedral set can be computed, whether it is bounded or not, and whether it includes the origin or not. The bounded sets that include the origin show how vertices map to faces in the dual and vice versa.
octaprism≔PolyhedralSet−1≤z,z≤1,−1≤y,y≤1,−y−6692247321≤x,−1≤x,y−6692247321≤x,x≤y+6692247321,x≤1,x≤−y+6692247321:
Plotoctaprism, orientation=43,80,0
octaprism_dual≔DualSetoctaprism
octaprism_dual:={Coordinates:x,y,zRelations:−47321⁢z19601−47321⁢y19601−4732119601≤x,47321⁢z19601−47321⁢y19601−4732119601≤x,−z−19601⁢y47321−1≤x,z−19601⁢y47321−1≤x,−z+19601⁢y47321−1≤x,z+19601⁢y47321−1≤x,47321⁢y19601−47321⁢z19601−4732119601≤x,47321⁢y19601+47321⁢z19601−4732119601≤x,x≤47321⁢z19601+47321⁢y19601+4732119601,x≤−47321⁢z19601+47321⁢y19601+4732119601,⋯,(6 more constraints)
Plotoctaprism_dual, orientation=43,80,0
c ≔ TranslateExampleSets:-Cube, 2,−2,2
c:={Coordinates:x1,x2,x3Relations:1≤x3,x3≤3,−3≤x2,x2≤−1,1≤x1,x1≤3
c_dual≔DualSetc
c_dual:={Coordinates:x1,x2,x3Relations:x1≤3⁢x2−x3+1,x1≤3⁢x2−3⁢x3+1,x1≤x2−x33+13,x1≤x2−x3+13,x1≤x2−3⁢x3+1,x1≤x23−x33+13,x1≤x23−x3+13
Plotc_dual
Support for linear matrix transformations, translations, and projections is included.
The elementary set functionality, such as the intersection, convex hull, inclusion tests, and equality test provide user-friendly means of working with polyhedral sets.
Sets of higher dimensions are supported by the algorithms in the package, so that properties like the volume of a set can be calculated for any set.
s5 ≔ ExampleSets:-Simplex5
{Coordinates:x1,x2,x3,x4,x5Relations:0≤x5,0≤x4,0≤x3,0≤x2,0≤x1,x1≤−x2−x3−x4−x5+1
Volumes5
1120
Likewise, the set operators can work in any dimension,
ExampleSets:-Simplex5 subset ExampleSets:-Hypercube5
true
and the topological properties of sets can be explored similarly.
GraphExampleSets:-Simplex4
PolyhedralSets Package (Overview), ExampleSets- NDimensions, ExampleSets- ThreeDimensions, GraphTheory Package (Overview)
Download Help Document