Function Repository Resource:

HurwitzMatrix

Source Notebook

Generate the Hurwitz matrix of a univariate polynomial

Contributed by: Jan Mangaldan

ResourceFunction["HurwitzMatrix"][poly,x]

gives the Hurwitz matrix of poly, treated as a polynomial in x.

Details

The Hurwitz matrix is also called the Routh-Hurwitz matrix.
The Hurwitz matrix is a matrix constructed from the coefficients of a polynomial, and can be used to check if the polynomial's roots all have negative real parts.
The Hurwitz matrix is a sparse matrix.
In control theory, a polynomial is stable if all of its roots have negative real parts. One can use principal minors of the Hurwitz matrix to make this determination.

Examples

Basic Examples (1) 

Generate the Hurwitz matrix of a polynomial:

In[1]:=
ResourceFunction["HurwitzMatrix"][5 + 4 x + 3 x^2 + 2 x^3 + x^4 + x^5,
   x] // MatrixForm
Out[1]=

Scope (2) 

Generate the Hurwitz matrix from a polynomial with numeric coefficients:

In[2]:=
ResourceFunction["HurwitzMatrix"][2 x^6 - 5 x^5 - 3 x + 9, x] // MatrixForm
Out[2]=

Generate the Hurwitz matrix from a polynomial with symbolic coefficients:

In[3]:=
ResourceFunction["HurwitzMatrix"][\!\(
\*UnderoverscriptBox[\(\[Sum]\), \(k = 0\), \(7\)]\(\*
TemplateBox[{"k"},
"C"] 
\*SuperscriptBox[\(x\), \(k\)]\)\), x] // MatrixForm
Out[3]=

Applications (2) 

Use HurwitzMatrix to check the stability of a polynomial:

In[4]:=
poly = 1 + x/2 + x^2/9 + x^3/72 + x^4/1008 + x^5/30240;
MatrixForm[ma = ResourceFunction["HurwitzMatrix"][poly, x]]
Out[4]=
In[5]:=
Table[Det[Take[ma, k, k]] > 0, {k, Exponent[poly, x]}]
Out[5]=

Verify stability by computing the roots of the polynomial:

In[6]:=
Re[x] < 0 /. NSolve[poly == 0, x]
Out[6]=

Properties and Relations (4) 

A polynomial whose roots all have negative real parts:

In[7]:=
poly[z_] := z^4 + 6 z^3 + 16 z^2 + 22 z + 15

The corresponding Hurwitz matrix has principal minors that are all positive:

In[8]:=
ma = ResourceFunction["HurwitzMatrix"][poly[z], z];
Table[Det[Take[ma, k, k]] > 0, {k, Exponent[poly[z], z]}]
Out[9]=

Apply a Möbius transformation to the polynomial:

In[10]:=
polyMoebius[z_] = Collect[Together[(z - 1)^Exponent[poly[z], z] poly[(z + 1)/(z - 1)]],
   z, Simplify]
Out[10]=

The transformed polynomial has a Schur matrix that is positive definite. That is, all of the roots of the transformed polynomial are within the unit disk:

In[11]:=
ResourceFunction["SchurMatrix"][polyMoebius[z], z] // PositiveDefiniteMatrixQ
Out[11]=

Version History

  • 1.1.0 – 27 March 2023
  • 1.0.0 – 03 March 2021

Source Metadata

Related Resources

License Information