My work recently involved using Matlab to compute first-order derivative of a matrix exponential. Suppose we have a matrix X which associates with some parameters, say α and β. That means X = X(α, β). Exponentiate X we get a matrix exponential: eX
|Now comes the question: how to compute|
The following sections will describe one way to compute this derivative. This post is meant to explain a special case (first order derivative) from the referenced paper (Fung 2004). If you need to compute higher order derivatives, Fung’s work (Fung 2004) will be a great help.
MATRIX EXPONENTIAL BASIC
Recall that if x is a scalar, exponential of x can be defined in the form of power series ():
Likewise, if X is a square matrix, we can define its matrix exponential as:
where I denotes identity matrix.
In Matlab, the function expm(X) is used to compute the matrix exponential of X.
LINEAR DIFFERENTIAL EQUATION SYSTEMS
Linear differential equation systems are relevant to matrix exponential in the sense that the solutions are often found in the form of matrix exponential.
Given a system of linear ordinary differential equations:
it is well-known that the solution is given by:
We are going to utilize this relationship in the section follow.
FIRST ORDER DERIVATIVE
Suppose A is a square matrix with a parameter α. Let’s say we need to compute the first order derivative of the matrix exponential of A with respect to parameter α.
|That is, we need to compute|
Consider the solution (4), at time t = 1 we have:
Differentiate both sides of (3) w.r.t. α:
We can rewrite (6) as:
which essentially has the same structure as the system of linear differential equations (3). That means the solution for (9) at t = 1 is given by:
Also differentiate both sides of (5) w.r.t. α we get:
Using the same notion (7), we can express (11) as:
From (10) and (12), we can see that:
That means the first order derivative of eA w.r.t. α can be obtained from the matrix exponential of the augmented matrix Ᾱ.
Steps to compute:
1. Set up matrix Ᾱ as described in (8)
HIGHER ORDER DERIVATIVES
Higher order derivatives of matrix exponential can be computed in the same way as first order one. For more details, please refer to the paper listed at the bottom of this post (Fung 2004).
Below you can find a simple Matlab program that implements the steps described above to compute the first order derivative of the matrix exponential of A.
% Compute first order derivative of the matrix exponential of matrix A
% A: matrix to compute the first order derivative of its matrix exponential
% dA: partial derivative of A
function dexpA = dexp(A,dA)
n = size(A,1);
% Augmented matrix
A_bar = [A dA; zeros(n) A];
% Matrix exponential of A_bar
B_bar = expm(A_bar);
% Extract derivative
dexpA = B_bar(1:n,n+1:2*n);
1. T. C. Fung, “Computation of the matrix exponential and its derivatives by scaling and squaring”, Int. J. Numer. Meth. Engng 2004; 59:1273–1286 (DOI: 10.1002/nme.909)
2. Wikipedia, “Exponential function”, http://en.wikipedia.org/wiki/Exponential_function