 Polynomial System Solving in Maple 16 - Maple Programming Help

Polynomial System Solving in Maple 16

Computing and manipulating the real solutions of a polynomial system is a requirement for many application areas, such as biological modeling, robotics, program verification, control design, to name just a few. For example, an important problem in computational biology is to study the stability of the equilibria (or steady states) of biological systems. This question can often be reduced to solving a parametric system of polynomial equations and inequalities.

The RegularChains package in Maple 16 provides a collection of tools for studying systems of polynomial equations, inequations and inequalities. It is particularly useful for solving and working with the real solutions of polynomial systems, such as the steady-state problem, amongst many others.  The new RegularChains features in Maple 16 include:

 • set theoretical operations for semi-algebraic sets (Complement,  Difference , Intersection, IsContained,  IsEmpty, Projection),
 • new solvers for popular types of systems (LinearSolve, RealComprehensiveTriangularize),
 • a new command, SuggestVariableOrder, for heuristically selecting a good variable order for computing a triangular decomposition of a polynomial system
 • significant enhancements and performance improvements for the Triangularize,  RealTriangularize, and CylindricalAlgebraicDecompose   commands

The two following applications highlighting these new features.

$\mathrm{restart}$

$\mathrm{with}\left(\mathrm{RegularChains}\right):$

$\mathrm{with}\left(\mathrm{SemiAlgebraicSetTools}\right):$

$\mathrm{with}\left(\mathrm{ParametricSystemTools}\right):$

Application 1: Stability analysis of a parametric dynamical system

Consider a biological system described by the nonlinear multiple switch model

 $\left[\begin{array}{c}\frac{{ⅆ}}{{ⅆ}{t}}{}{x}\left({t}\right){=}{-}{x}\left({t}\right){+}\frac{{s}}{{1}{+}{{y}\left({t}\right)}^{{2}}}\\ \frac{{ⅆ}}{{ⅆ}{t}}{}{y}\left({t}\right){=}{-}{y}\left({t}\right){+}\frac{{s}}{{1}{+}{{x}\left({t}\right)}^{{2}}}\end{array}\right]$ (1.1)

where the unknowns $x,y$ represent two protein concentrations and $s$ represents the strength of unrepressed protein expression. This latter quantity is regarded as a time-constant parameter.

The equilibria of $S$ correspond to $\stackrel{.}{x}=\stackrel{.}{y}=0$, or equivalently, $F=0$, where

$f≔\genfrac{}{}{0}{}{\mathrm{rhs}~\left(S\right)}{\phantom{x=a}}|\genfrac{}{}{0}{}{\phantom{\mathrm{f\left(x\right)}}}{\left[x\left(t\right)=x,y\left(t\right)=y\right]}$

 $\left[\begin{array}{c}{-}{x}{+}\frac{{s}}{{1}{+}{{y}}^{{2}}}\\ {-}{y}{+}\frac{{s}}{{1}{+}{{x}}^{{2}}}\end{array}\right]$ (1.2)

The following two Hurwitz determinants determine the stability of the hyperbolic equilibria of $S$:

${d}_{1}≔-\left(\frac{\partial }{\partial x}{f}_{1}+\frac{\partial }{\partial y}{f}_{2}\right)$

 ${2}$ (1.3)

${d}_{2}≔\left(\frac{\partial }{\partial x}{f}_{1}\right)\cdot \left(\frac{\partial }{\partial y}{f}_{2}\right)-\left(\frac{\partial }{\partial y}{f}_{1}\right)\cdot \left(\frac{\partial }{\partial x}{f}_{2}\right)$

 ${1}{-}\frac{{4}{}{{s}}^{{2}}{}{y}{}{x}}{{\left({1}{+}{{y}}^{{2}}\right)}^{{2}}{}{\left({1}{+}{{x}}^{{2}}\right)}^{{2}}}$ (1.4)



The semi-algebraic system below encodes the asymptotically stable hyperbolic equilibria:

 ${0}{<}{1}{+}{2}{}{{x}}^{{2}}{+}{{x}}^{{4}}{+}{2}{}{{y}}^{{2}}{+}{4}{}{{y}}^{{2}}{}{{x}}^{{2}}{+}{2}{}{{y}}^{{2}}{}{{x}}^{{4}}{+}{{y}}^{{4}}{+}{2}{}{{y}}^{{4}}{}{{x}}^{{2}}{+}{{y}}^{{4}}{}{{x}}^{{4}}{-}{4}{}{{s}}^{{2}}{}{y}{}{x}$ (1.5)



We solve this problem by first computing a real comprehensive triangular decomposition of $P$ with respect to the parameter $s$, using the new command RealComprehensiveTriangularize:

$R≔\mathrm{PolynomialRing}\left(\left[y,x,s\right]\right):$

 $\left[\left[\left[{1}{,}{\mathrm{squarefree_semi_algebraic_system}}\right]{,}\left[{2}{,}{\mathrm{squarefree_semi_algebraic_system}}\right]\right]{,}\left[\left[{\mathrm{semi_algebraic_set}}{,}\left[{}\right]\right]{,}\left[{\mathrm{semi_algebraic_set}}{,}\left[{1}\right]\right]{,}\left[{\mathrm{semi_algebraic_set}}{,}\left[{2}\right]\right]\right]\right]$ (1.6)



This is a decomposition of the original system into several simpler triangular systems and some additional conditions on the parameter $s$:

$\mathrm{Display}\left({C}_{1},R\right)$

  (1.7)

$\mathrm{Display}\left({C}_{2},R\right)$

 $\left[\left[\left[{s}{<}{-}{2}{,}{s}{=}{-}{2}{,}{\mathrm{And}}{}\left({-}{2}{<}{s}{,}{s}{<}{0}\right){,}{s}{=}{0}{,}{s}{=}{2}\right]{,}\left[{}\right]\right]{,}\left[\left[{\mathrm{And}}{}\left({0}{<}{s}{,}{s}{<}{2}\right)\right]{,}\left[{1}\right]\right]{,}\left[\left[{2}{<}{s}\right]{,}\left[{2}\right]\right]\right]$ (1.8)

Suppose we are interested in those values of $s$ for which the biological system is bistable (that is, there are at least two stable equilibria). This means that we are looking for values of $s$ such that $P$ has at least 2 positive real solutions. We use the RealComprehensiveTriangularize command again and apply it to our previous result $C$:

 $\left[\left[\left[{1}{,}{\mathrm{squarefree_semi_algebraic_system}}\right]\right]{,}\left[\left[{\mathrm{semi_algebraic_set}}{,}\left[{1}\right]\right]\right]\right]$ (1.9)

The condition on $s$ that we are looking for is given by the second entry:

$\mathrm{Display}\left({\mathrm{result}}_{2},R\right)$

 $\left[\left[\left[{2}{<}{s}\right]{,}\left[{1}\right]\right]\right]$ (1.10)



The locations of the stable equilibria are described by the following triangular system from the first entry:

$\mathrm{Display}\left({\mathrm{result}}_{1},R\right)$

  (1.11)

We now illustrate the result by discussing the special case $s=3$. From the equations above, there are $2$ stable equilibria given by:

 $\left[\left\{{x}{=}\frac{{3}}{{2}}{-}\frac{{1}}{{2}}{}\sqrt{{5}}{,}{y}{=}\frac{{3}}{{2}}{+}\frac{{1}}{{2}}{}\sqrt{{5}}\right\}{,}\left\{{x}{=}\frac{{3}}{{2}}{+}\frac{{1}}{{2}}{}\sqrt{{5}}{,}{y}{=}\frac{{3}}{{2}}{-}\frac{{1}}{{2}}{}\sqrt{{5}}\right\}\right]$ (1.12)

$\mathrm{evalf}\left(\mathrm{equilibria}\right)$

 $\left[\left\{{x}{=}{0.381966012}{,}{y}{=}{2.618033988}\right\}{,}\left\{{x}{=}{2.618033988}{,}{y}{=}{0.381966012}\right\}\right]$ (1.13)

We verify that the last inequality is satisfied:

 ${0}{<}{945}{}{x}{-}{360}$ (1.14)

$\mathrm{evalf}\left(\genfrac{}{}{0}{}{\mathrm{condition}}{\phantom{x=a}}|\genfrac{}{}{0}{}{\phantom{\mathrm{f\left(x\right)}}}{{\mathrm{equilibria}}_{1}}\right)$

 ${0.}{<}{0.957881}$ (1.15)

$\mathrm{evalf}\left(\genfrac{}{}{0}{}{\mathrm{condition}}{\phantom{x=a}}|\genfrac{}{}{0}{}{\phantom{\mathrm{f\left(x\right)}}}{{\mathrm{equilibria}}_{2}}\right)$

 ${0.}{<}{2114.042119}$ (1.16)

Below, we graphically display trajectories of the dynamical system in the special case. The first plot is a 2D animation, and the second one is a 3D static plot with time as the z-axis. We can see the two stable equilibria well in both plots, but there is also a third, unstable, equilibrium that can be seen best in the 3D plot.

$\mathrm{special}≔\genfrac{}{}{0}{}{\mathrm{convert}\left(S,\mathrm{list}\right)}{\phantom{x=a}}|\genfrac{}{}{0}{}{\phantom{\mathrm{f\left(x\right)}}}{s=3}$

 $\left[\frac{{ⅆ}}{{ⅆ}{t}}{}{x}\left({t}\right){=}{-}{x}\left({t}\right){+}\frac{{3}}{{1}{+}{{y}\left({t}\right)}^{{2}}}{,}\frac{{ⅆ}}{{ⅆ}{t}}{}{y}\left({t}\right){=}{-}{y}\left({t}\right){+}\frac{{3}}{{1}{+}{{x}\left({t}\right)}^{{2}}}\right]$ (1.17)

$\mathrm{with}\left(\mathrm{DEtools}\right):$  Application 2: Verifying mathematical identities by branch cut analysis

Let $z$ be a complex variable. Which of the following two identities holds for all ?

$\sqrt{{z}^{2}-1}=\sqrt{z-1}\cdot \sqrt{z+1}$

 $\sqrt{{{z}}^{{2}}{-}{1}}{=}\sqrt{{z}{-}{1}}{}\sqrt{{z}{+}{1}}$ (2.1)

$\sqrt{1-{z}^{2}}=\sqrt{1-z}\cdot \sqrt{1+z}$

 $\sqrt{{1}{-}{{z}}^{{2}}}{=}\sqrt{{1}{-}{z}}{}\sqrt{{z}{+}{1}}$ (2.2)

In Maple, the branch cut for the square root function $\sqrt{z}$ is the negative real axis $z<0$. If we rewrite  in Cartesian coordinates, we can express that condition by the simple semi-algebraic system . For example (2.1) above, the branch cuts of the three square root functions are, from left to right:

$\mathrm{assume}\left(x,\mathrm{real}\right)$

$\mathrm{assume}\left(y,\mathrm{real}\right)$

 $\left[{2}{}{\mathrm{x~}}{}{\mathrm{y~}}{=}{0}{,}{{\mathrm{x~}}}^{{2}}{-}{{\mathrm{y~}}}^{{2}}{<}{1}\right]$ (2.3)

 $\left[{\mathrm{y~}}{=}{0}{,}{\mathrm{x~}}{<}{1}\right]$ (2.4)

 $\left[{\mathrm{y~}}{=}{0}{,}{\mathrm{x~}}{<}{-}{1}\right]$ (2.5)

The following plot depicts these three branch cuts.

$\mathrm{with}\left(\mathrm{plottools}\right):$

$\mathrm{with}\left(\mathrm{plots}\right):$

$\mathrm{branchcuts}$ By continuity arguments, it is now sufficient to check the proposed identity (2.1) at finitely many points covering all possible combinations of branch cuts. Such a set of points can be computed using the command CylindricalAlgebraicDecompose:

${b}_{1}≔\left[,,\right]$

 $\left[\left[{2}{}{\mathrm{x~}}{}{\mathrm{y~}}{=}{0}{,}{{\mathrm{x~}}}^{{2}}{-}{{\mathrm{y~}}}^{{2}}{<}{1}\right]{,}\left[{\mathrm{y~}}{=}{0}{,}{\mathrm{x~}}{<}{1}\right]{,}\left[{\mathrm{y~}}{=}{0}{,}{\mathrm{x~}}{<}{-}{1}\right]\right]$ (2.6)

$R≔\mathrm{PolynomialRing}\left(\left[y,x\right]\right):$

$S≔\mathrm{CylindricalAlgebraicDecompose}\left({b}_{1},R,\mathrm{output}=\mathrm{rootof}\right)$

 $\left[\left[{\mathrm{x~}}{<}{-}{1}{,}{\mathrm{y~}}{=}{0}\right]{,}\left[{\mathrm{x~}}{=}{-}{1}{,}{\mathrm{y~}}{=}{0}\right]{,}\left[{-}{1}{<}{\mathrm{x~}}{,}{\mathrm{x~}}{<}{0}{,}{\mathrm{y~}}{=}{0}\right]{,}\left[{\mathrm{x~}}{=}{0}{,}{\mathrm{y~}}{<}{0}\right]{,}\left[{\mathrm{x~}}{=}{0}{,}{\mathrm{y~}}{=}{0}\right]{,}\left[{\mathrm{x~}}{=}{0}{,}{0}{<}{\mathrm{y~}}\right]{,}\left[{0}{<}{\mathrm{x~}}{,}{\mathrm{x~}}{<}{1}{,}{\mathrm{y~}}{=}{0}\right]\right]$ (2.7)

The union of all branch cuts was decomposed into the 7 disjoint intervals above. We pick one sample point for each interval:

$S≔\left[\left[x=-2,y=0\right],{S}_{2},\left[x=-\frac{1}{2},y=0\right],\left[x=0,y=-1\right],{S}_{5},\left[x=0,y=1\right],\left[x=\frac{1}{2},y=0\right]\right]$

 $\left[\left[{\mathrm{x~}}{=}{-}{2}{,}{\mathrm{y~}}{=}{0}\right]{,}\left[{\mathrm{x~}}{=}{-}{1}{,}{\mathrm{y~}}{=}{0}\right]{,}\left[{\mathrm{x~}}{=}{-}\frac{{1}}{{2}}{,}{\mathrm{y~}}{=}{0}\right]{,}\left[{\mathrm{x~}}{=}{0}{,}{\mathrm{y~}}{=}{-}{1}\right]{,}\left[{\mathrm{x~}}{=}{0}{,}{\mathrm{y~}}{=}{0}\right]{,}\left[{\mathrm{x~}}{=}{0}{,}{\mathrm{y~}}{=}{1}\right]{,}\left[{\mathrm{x~}}{=}\frac{{1}}{{2}}{,}{\mathrm{y~}}{=}{0}\right]\right]$ (2.8)

We also add one sample point $\left(1,1\right)$ not contained on any branch cut:

$S≔\left[S\left[\right],\left[x=1,y=1\right]\right]$

 $\left[\left[{\mathrm{x~}}{=}{-}{2}{,}{\mathrm{y~}}{=}{0}\right]{,}\left[{\mathrm{x~}}{=}{-}{1}{,}{\mathrm{y~}}{=}{0}\right]{,}\left[{\mathrm{x~}}{=}{-}\frac{{1}}{{2}}{,}{\mathrm{y~}}{=}{0}\right]{,}\left[{\mathrm{x~}}{=}{0}{,}{\mathrm{y~}}{=}{-}{1}\right]{,}\left[{\mathrm{x~}}{=}{0}{,}{\mathrm{y~}}{=}{0}\right]{,}\left[{\mathrm{x~}}{=}{0}{,}{\mathrm{y~}}{=}{1}\right]{,}\left[{\mathrm{x~}}{=}\frac{{1}}{{2}}{,}{\mathrm{y~}}{=}{0}\right]{,}\left[{\mathrm{x~}}{=}{1}{,}{\mathrm{y~}}{=}{1}\right]\right]$ (2.9)

The following graph displays the sample points in relation to the branch cuts. Now we check whether the identity (2.1) holds for all of these sample points:

 $\sqrt{{\left({\mathrm{x~}}{+}{I}{}{\mathrm{y~}}\right)}^{{2}}{-}{1}}{-}\sqrt{{\mathrm{x~}}{+}{I}{}{\mathrm{y~}}{-}{1}}{}\sqrt{{\mathrm{x~}}{+}{I}{}{\mathrm{y~}}{+}{1}}$ (2.10)

 ${2}{}\sqrt{{3}}{,}{0}{,}{0}{,}{2}{}{I}{}\sqrt{{2}}{,}{0}{,}{0}{,}{0}{,}{0}$ (2.11)

We conclude that (2.1) is not an identity, and we can even say precisely when it fails: on the first interval , and on the fourth interval .

Now we proceed in the same way for the second proposed identity (2.2). The branch cuts are:

 $\left[{-}{2}{}{\mathrm{x~}}{}{\mathrm{y~}}{=}{0}{,}{-}{{\mathrm{x~}}}^{{2}}{+}{{\mathrm{y~}}}^{{2}}{<}{-}{1}\right]$ (2.12)

 $\left[{-}{\mathrm{y~}}{=}{0}{,}{-}{\mathrm{x~}}{<}{-}{1}\right]$ (2.13)

 $\left[{\mathrm{y~}}{=}{0}{,}{\mathrm{x~}}{<}{-}{1}\right]$ (2.14)

$\mathrm{branchcuts}$ ${b}_{2}≔\left[,,\right]$

 $\left[\left[{-}{2}{}{\mathrm{x~}}{}{\mathrm{y~}}{=}{0}{,}{-}{{\mathrm{x~}}}^{{2}}{+}{{\mathrm{y~}}}^{{2}}{<}{-}{1}\right]{,}\left[{-}{\mathrm{y~}}{=}{0}{,}{-}{\mathrm{x~}}{<}{-}{1}\right]{,}\left[{\mathrm{y~}}{=}{0}{,}{\mathrm{x~}}{<}{-}{1}\right]\right]$ (2.15)

$S≔\mathrm{CylindricalAlgebraicDecompose}\left({b}_{2},R,\mathrm{output}=\mathrm{rootof}\right)$

 $\left[\left[{\mathrm{x~}}{<}{-}{1}{,}{\mathrm{y~}}{=}{0}\right]{,}\left[{1}{<}{\mathrm{x~}}{,}{\mathrm{y~}}{=}{0}\right]\right]$ (2.16)

We need only 2+1 sample points in this case:

 $\left[\left[{\mathrm{x~}}{=}{-}{2}{,}{\mathrm{y~}}{=}{0}\right]{,}\left[{\mathrm{x~}}{=}{0}{,}{\mathrm{y~}}{=}{0}\right]{,}\left[{\mathrm{x~}}{=}{2}{,}{\mathrm{y~}}{=}{0}\right]\right]$ (2.17) $\sqrt{{1}{-}{\left({\mathrm{x~}}{+}{I}{}{\mathrm{y~}}\right)}^{{2}}}{-}\sqrt{{1}{-}{\mathrm{x~}}{-}{I}{}{\mathrm{y~}}}{}\sqrt{{\mathrm{x~}}{+}{I}{}{\mathrm{y~}}{+}{1}}$ (2.18)

 ${0}{,}{0}{,}{0}$ (2.19)

Thus we have proved that (2.2) is indeed an identity.