Let the very simple convex polytope $P$ be given by
$$
P=\left\{(x,y)\in\mathbb{R}^2:0 Geometrically, this is a diagonal in the unit square and has length $\sqrt{2}$. I used different software packages to compute the volume of $P$. Mathematica: In Wolfram's Mathematica we can define and then LattE integrale: The polytope $P$ can be described by the matrix inequality $A\mathbf{x}<\mathbf{b}$, where
$$
\mathbf{x}=\left(\begin{matrix}x\\y\end{matrix}\right),\quad A=\left(\begin{matrix}-1&0\\1&0\\0&-1\\0&1\end{matrix}\right), \quad \mathbf{b}=\left(\begin{matrix}0\\1\\0\\1\end{matrix}\right),
$$
and the additional linear constraint $x+y=1$. This can be specified as the LattE integrale input file The call gives answer 1. Naive computation: Naively one could compute the volume as
$$
\int_{P}1 = \int\int{\mathbf{1}_{(x,y)\in P}\,\mathrm{d}x\,\mathrm{d}y}=\int\int{\mathbf{1}_{\left\{0 Question: What is the volume of $P$? Do the two different answers $1$ and $\sqrt{2}$ reflect different notions of "volume" in this context, or merely a computational mistake on my part?P=ImplicitRegion[0Integrate[1,{x,y}\[Element] P] will yield $\sqrt{2}$.5 3
0 1 0
1 -1 0
0 0 1
1 0 -1
1 -1 -1
linearity 1 5
integrate filename --valuation=volume
Volume of convex polytope
1
$\begingroup$
definition
volume
math-software
polytopes
arc-length
-
0The volume of $P$ is zero. Perhaps you meant $x+y \le 1$? – 2017-01-10
1 Answers
1
Your original double integral is 0, since you are finding the area of a line :) To get the correct value, look at the curve $y = 1-x$ and getting the arc length would require changing the integrand to $$ \int_{x=0}^{x=1} \sqrt{1 + \left(\frac{dy}{dx}\right)^2} dx = \int_0^1 \sqrt{1 + (-1)^2} dx = \sqrt{2} \int_0^1 dx = \sqrt{2}. $$
-
0Thanks. But why does LattE output 1? Does it compute something different or is it just wrong? – 2017-01-10
-
0It seems LattE is done for counting how many integer coordinate points you have in a polyhedron. But here you are looking for a volume... It's not the same. – 2017-01-10
-
0Thanks @JeanMarie. There are two lattice points in $P$, which is in agreement with what LattE's `count` function returns. `integrate --valuation=volume` should return the volume. – 2017-01-10