 N Dimensions - Maple Help

PolyhedralSets[ExampleSets][NDimensions]

examples of n-dimensional polyhedral sets

Hyperoctant

create an n-dimensional polyhedral set from an octant

RandomSolid

create a random, bounded polyhedral set

RandomSet

create a random polyhedral set Calling Sequence SetName(n, varname) SetName(coords) Hyperoctant(n, varname) Hyperoctant(oct) Hyperoctant(oct, varname) Hyperoctant(oct, optcoords) RandomSolid(nv, n, varname) RandomSolid(nv, optcoords) RandomSet(nf, n, varname) RandomSet(nf, optcoords) Parameters

 SetName - procedure name; one of Simplex, Hypercube, UniversalSet, or EmptySet n - integer; number of dimensions coords - list of names; the set's coordinates optcoords - (optional) list of names; the set's coordinates varname - (optional) name; variable name to use in forming the coordinates, default is $x$ oct - list of integers; list of +1's and -1's defining the hyperoctant nf - integer; number of faces nv - integer; number of vertices Description

 • The calling sequence SetName(n) where SetName is one of Simplex, Hypercube, UniversalSet or EmptySet creates an $n$-dimensional polyhedral set with the default coordinate names.  Alternatively, SetName(n, varname) can be used to create sets whose coordinates are $\left[\mathrm{varname__1},\mathrm{varname__2}\cdots \mathrm{varname__n}\right]$ or the coordinates can be specified explicitly using SetName(coords).
 • Simplex is the $n$-dimensional rectangular simplex that has $n+1$ facets.  Its vertices are formed of the unit vectors and the origin.
 • Hypercube is the $n$-dimensional hypercube that spans $\left[-1..1\right]$ in each dimension.
 • The UniversalSet contains every point in $n$-dimensional space, while the EmptySet contains no points.
 • Hyperoctant, RandomSolid and RandomSet accept additional parameters.  The hyperoctant can be specified using oct, a vector of $n$ positive and/or negative ones.  The $i$th entry in oct selects whether the positive or negative half-space of the $i$th coordinate is used to form the hyperoctant.  The default is all positive ones, which corresponds to quadrant I in two dimensions and octant I in three dimensions.
 • RandomSolid generates a bounded polyhedral set with nv vertices by choosing random points near the surface of the $n$-sphere.  If the set's coordinates are not specified using RandomSolid(nv, optcoords), then the dimension of the space must be given with the call sequence RandomSolid(nv, n).  The number of vertices nv must be greater than the dimension of the space in order to generate a solid.
 • RandomSet generates a polyhedral set with nf faces.  The resultant figure may be bounded or unbounded, whereas RandomSolid always returns a bounded set.  As with RandomSolid, either the dimension of the space must be given using RandomSet(nf, n) or the coordinates must be given using RandomSet(nf, optcoords). Compatibility

 • The Simplex, Hypercube, UniversalSet, and EmptySet commands were introduced in Maple 2015.
 • The Hyperoctant, RandomSolid, and RandomSet commands were introduced in Maple 2015. Examples

 > $\mathrm{with}\left(\mathrm{PolyhedralSets}\right):$
 > $\mathrm{with}\left(\mathrm{ExampleSets}\right)$
 $\left[{\mathrm{Cube}}{,}{\mathrm{Cuboctahedron}}{,}{\mathrm{EmptySet}}{,}{\mathrm{Hypercube}}{,}{\mathrm{Hyperoctant}}{,}{\mathrm{Octahedron}}{,}{\mathrm{RandomSet}}{,}{\mathrm{RandomSolid}}{,}{\mathrm{Simplex}}{,}{\mathrm{Tetrahedron}}{,}{\mathrm{TruncatedOctahedron}}{,}{\mathrm{TruncatedTetrahedron}}{,}{\mathrm{UniversalSet}}\right]$ (1)

The hypercube in 2-D is a square and a cube in 3-D.

 > $\mathrm{c2d}≔\mathrm{Hypercube}\left(2\right);$$\mathrm{Plot}\left(\mathrm{c2d}\right)$
 ${\mathrm{c2d}}{≔}{{}\begin{array}{lll}{\mathrm{Coordinates}}& {:}& \left[{{x}}_{{1}}{,}{{x}}_{{2}}\right]\\ {\mathrm{Relations}}& {:}& \left[{-}{{x}}_{{2}}{\le }{1}{,}{{x}}_{{2}}{\le }{1}{,}{-}{{x}}_{{1}}{\le }{1}{,}{{x}}_{{1}}{\le }{1}\right]\end{array}$ > $\mathrm{c3d}≔\mathrm{Hypercube}\left(\left[x,y,z\right]\right);$$\mathrm{Plot}\left(\mathrm{c3d}\right)$
 ${\mathrm{c3d}}{≔}{{}\begin{array}{lll}{\mathrm{Coordinates}}& {:}& \left[{x}{,}{y}{,}{z}\right]\\ {\mathrm{Relations}}& {:}& \left[{-}{z}{\le }{1}{,}{z}{\le }{1}{,}{-}{y}{\le }{1}{,}{y}{\le }{1}{,}{-}{x}{\le }{1}{,}{x}{\le }{1}\right]\end{array}$ Higher dimensional cubes can be created, but only those set in two or three dimensions can be plotted.

 > $\mathrm{c9d}≔\mathrm{Hypercube}\left(9\right)$
 ${\mathrm{c9d}}{≔}{{}\begin{array}{lll}{\mathrm{Coordinates}}& {:}& \left[{{x}}_{{1}}{,}{{x}}_{{2}}{,}{{x}}_{{3}}{,}{{x}}_{{4}}{,}{{x}}_{{5}}{,}{{x}}_{{6}}{,}{{x}}_{{7}}{,}{{x}}_{{8}}{,}{{x}}_{{9}}\right]\\ {\mathrm{Relations}}& {:}& \left[{-}{{x}}_{{9}}{\le }{1}{,}{{x}}_{{9}}{\le }{1}{,}{-}{{x}}_{{8}}{\le }{1}{,}{{x}}_{{8}}{\le }{1}{,}{-}{{x}}_{{7}}{\le }{1}{,}{{x}}_{{7}}{\le }{1}{,}{-}{{x}}_{{6}}{\le }{1}{,}{{x}}_{{6}}{\le }{1}{,}{-}{{x}}_{{5}}{\le }{1}{,}{{x}}_{{5}}{\le }{1}{,}{\mathrm{and 8 more constraints}}\right]\end{array}$ (2)

The simplex in 2-D is a right angled triangle, while in 3-D it is a trirectangular tetrahedron.

 > $\mathrm{Plot}\left(\mathrm{Simplex}\left(2\right)\right)$ > $\mathrm{Plot}\left(\mathrm{Simplex}\left(3\right)\right)$ The universal set is the whole of the ambient space, while the empty set contains no points.

 > $\mathrm{Plot}\left(\mathrm{UniversalSet}\left(3\right)\right)$ > $\mathrm{Plot}\left(\mathrm{EmptySet}\left(3\right)\right)$ RandomSolid always generates a bounded set. Here is a set with 5 vertices in 3-D:

 > $\mathrm{rs1}≔\mathrm{RandomSolid}\left(5,3\right);$$\mathrm{Plot}\left(\mathrm{rs1}\right)$
 ${\mathrm{rs1}}{≔}{{}\begin{array}{lll}{\mathrm{Coordinates}}& {:}& \left[{{x}}_{{1}}{,}{{x}}_{{2}}{,}{{x}}_{{3}}\right]\\ {\mathrm{Relations}}& {:}& \left[{-}{{x}}_{{1}}{+}\frac{{426509332}{}{{x}}_{{2}}}{{461037817}}{+}\frac{{8386806574}{}{{x}}_{{3}}}{{6915567255}}{\le }{-}\frac{{28003359640307}}{{345778362750000}}{,}{-}{{x}}_{{1}}{+}\frac{{32936243}{}{{x}}_{{2}}}{{12746351}}{-}\frac{{125966986}{}{{x}}_{{3}}}{{63731755}}{\le }\frac{{5011307193489}}{{1593293875000}}{,}{-}{{x}}_{{1}}{+}\frac{{224815423}{}{{x}}_{{2}}}{{54353009}}{-}\frac{{1232092194}{}{{x}}_{{3}}}{{271765045}}{\le }\frac{{20073248209323}}{{3397063062500}}{,}{{x}}_{{1}}{-}\frac{{128188828}{}{{x}}_{{2}}}{{19317675}}{+}\frac{{15716882}{}{{x}}_{{3}}}{{7429875}}{\le }{-}\frac{{8200820316371}}{{1609806250000}}{,}{{x}}_{{1}}{-}\frac{{188443593}{}{{x}}_{{2}}}{{62042999}}{+}\frac{{7217249}{}{{x}}_{{3}}}{{62042999}}{\le }{-}\frac{{2873061543027}}{{1551074975000}}{,}{{x}}_{{1}}{+}\frac{{113924267}{}{{x}}_{{2}}}{{75029215}}{-}\frac{{267572861}{}{{x}}_{{3}}}{{225087645}}{\le }\frac{{566378402797}}{{281359556250}}\right]\end{array}$ RandomSet can generate sets that are bounded or unbounded.  If less than $n+1$ faces are requested, the set will be unbounded, like this set with 5 faces in 6 dimensions.

 > $\mathrm{rs2}≔\mathrm{RandomSet}\left(5,6\right)$
 ${\mathrm{rs2}}{≔}{{}\begin{array}{lll}{\mathrm{Coordinates}}& {:}& \left[{{x}}_{{1}}{,}{{x}}_{{2}}{,}{{x}}_{{3}}{,}{{x}}_{{4}}{,}{{x}}_{{5}}{,}{{x}}_{{6}}\right]\\ {\mathrm{Relations}}& {:}& \left[{-}{{x}}_{{1}}{-}\frac{{186001}{}{{x}}_{{2}}}{{195420}}{+}\frac{{8783}{}{{x}}_{{3}}}{{6514}}{+}\frac{{110119}{}{{x}}_{{4}}}{{32570}}{-}\frac{{182461}{}{{x}}_{{5}}}{{65140}}{+}\frac{{348733}{}{{x}}_{{6}}}{{195420}}{\le }\frac{{50000}}{{9771}}{,}{-}{{x}}_{{1}}{+}\frac{{94447}{}{{x}}_{{2}}}{{369124}}{+}\frac{{198525}{}{{x}}_{{3}}}{{738248}}{-}\frac{{86981}{}{{x}}_{{4}}}{{105464}}{-}\frac{{114269}{}{{x}}_{{5}}}{{922810}}{-}\frac{{143431}{}{{x}}_{{6}}}{{3691240}}{\le }\frac{{125000}}{{92281}}{,}{-}{{x}}_{{1}}{+}\frac{{209207}{}{{x}}_{{2}}}{{645435}}{+}\frac{{21607}{}{{x}}_{{3}}}{{717150}}{-}\frac{{207986}{}{{x}}_{{4}}}{{215145}}{+}\frac{{9772}{}{{x}}_{{5}}}{{18441}}{-}\frac{{181553}{}{{x}}_{{6}}}{{645435}}{\le }\frac{{200000}}{{129087}}{,}{-}{{x}}_{{1}}{+}\frac{{225236}{}{{x}}_{{2}}}{{442655}}{-}\frac{{28740}{}{{x}}_{{3}}}{{88531}}{-}\frac{{352372}{}{{x}}_{{4}}}{{442655}}{-}\frac{{548553}{}{{x}}_{{5}}}{{442655}}{+}\frac{{554618}{}{{x}}_{{6}}}{{442655}}{\le }\frac{{200000}}{{88531}}{,}{{x}}_{{1}}{-}\frac{{230877}{}{{x}}_{{2}}}{{273407}}{+}\frac{{699102}{}{{x}}_{{3}}}{{273407}}{-}\frac{{455608}{}{{x}}_{{4}}}{{273407}}{-}\frac{{412465}{}{{x}}_{{5}}}{{273407}}{+}\frac{{741463}{}{{x}}_{{6}}}{{2734070}}{\le }\frac{{1000000}}{{273407}}\right]\end{array}$ (3)
 > $\mathrm{IsBounded}\left(\mathrm{rs2}\right)$
 ${\mathrm{false}}$ (4)