Wolfram Research

Function Repository Resource:

MatrixPencilSolve

Source Notebook

Find the null values and vectors for the pencil of a set of square matrices

Contributed by: Daniel Lichtblau

ResourceFunction["MatrixPencilSolve"][{m0,m1,,mn}]

finds the generalized eigenvalues λ and corresponding vectors v for which the matrix m0+λm1+λ2m2+λnmn has a nontrivial null space.

Details and Options

The matrix inputs must be square and of the same dimensions.
The result is a list of lists of the form {{λ1,{v1,1,v1,2}},{λ2,{v2,1,v2,2}},}.

Examples

Basic Examples

Form some random real-valued matrices:

In[1]:=
n = 3;
m = 3;
SeedRandom[1234];
matrices = RandomReal[{-1, 1}, {m, n, n}];

Find the null-valued vectors for the pencil of these matrices:

In[2]:=
mps = ResourceFunction["MatrixPencilSolve"][matrices]
Out[2]=

Check that the first of these value/vector pairs satisfies the necessary equation:

In[3]:=
NullSpace[mps[[1, 1]]^Range[0, m - 1].matrices] == mps[[1, 2]]
Out[3]=

Scope

MatrixPencilSolve will handle exact as well as approximate input matrices:

In[4]:=
n = 2;
m = 3;
SeedRandom[1234];
matrices = RandomInteger[{-1, 1}, {m, n, n}]
Out[7]=
In[8]:=
ResourceFunction["MatrixPencilSolve"][matrices]
Out[8]=

Properties and Relations

MatrixPencilSolve with one argument is equivalent to obtaining vectors from NullSpace, with λ having no value:

In[9]:=
mat = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}};
In[10]:=
nulls1 = ResourceFunction["MatrixPencilSolve"][{mat}][[1, 2]]
Out[10]=
In[11]:=
nulls2 = NullSpace[mat]
Out[11]=

MatrixPencilSolve with two matrices is equivalent to the two-argument form of Eigensystem, with the second matrix negated and the result transposed:

In[12]:=
SeedRandom[1234];
matrices = RandomReal[{-1, 1}, {2, 2, 2}]
Out[13]=
In[14]:=
msol1 = ResourceFunction["MatrixPencilSolve"][matrices]
Out[14]=
In[15]:=
msol2 = Eigensystem[{1, -1}*matrices] // Transpose
Out[15]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Resource History

License Information