Construct a rotation matrix as a limit of repeated infinitesimal transformations:
Solve the constant coefficient system of difference equations

:
This computes the fundamental solution

:
Show that it satisfies equations and initial conditions:
Find the matrix exponential for a matrix without a full set of eigenvectors:
Compute the exponential as the power series for each term:
Get a sparse identity matrix with size, precision and data type consistent with an input matrix:
Sparse identity matrix with exact values:
Sparse identity matrix with machine-number values:
Inverse power iteration for the smallest eigenvalue of a sparse positive definite matrix:
Shifted inverse power iteration for the largest eigenvalue:
An easy way to evaluate a matrix polynomial:
Evaluate a characteristic polynomial: