# Coupled differential equations using matrix exponent

• roam
In summary, to apply this method you need to(1) Determine the eigenvalues ##\lambda_i## of the matrix ##A##.(2) Determine the matrices ##E_i## for all ##i##. (The first equation above gives you the information you need, if you can evaluate ##E_i## for any ##i##.)Last edited: Jun 19, 2017In summary, The matrix exponential of a matrix ##M## can be evaluated by first diagonalizing the matrix using its eigenvectors and eigenvalues. This can be done by finding the eigenvectors and eigenvalues of the matrix and using them to construct the matrix ##P##, which is used to diagonal
roam

## Homework Statement

Solve the following coupled differential equations by finding the eigenvectors and eigenvalues of the matrix and using it to calculate the matrix exponent:

$$\frac{df}{dz}=i\delta f(z)+i\kappa b(z)$$

$$\frac{db}{dz}=-i\delta b(z)-i\kappa f(z)$$

In matrix form:

$$\frac{d}{dz}\begin{pmatrix}f\\b\end{pmatrix}=-i\begin{pmatrix}-\delta & -\kappa\\ \kappa &\delta\end{pmatrix}\begin{pmatrix}f\\b\end{pmatrix}$$

## Homework Equations

These are known as the fiber mode equations in photonics, and I know that the analytic solutions to the above equations must be:

$$f(z)=f(0)\frac{\alpha\cosh(\alpha(L-z))-i\delta\sinh(\alpha(L-z))}{\alpha\cosh(\alpha L)-i\delta\sinh(\alpha L)} \tag{1.1}$$

$$b(z)=if(0)\frac{\kappa\sinh(\alpha(L-z))}{\alpha\cosh(\alpha L)-i\delta\sinh(\alpha L)} \tag{1.2}$$

where ##\alpha=\sqrt{\kappa^{2}-\delta^{2}}##. And ##L## is the fiber length (there is a boundary condition that ##b(z=L)=0##).

## The Attempt at a Solution

So, I have found the eigenvalues by solving ##\text{det}|M-\lambda I|=0##:

$$\text{det}\begin{bmatrix}i\delta-\lambda & i\kappa\\ -i\kappa & -i\delta-\lambda \end{bmatrix}=\delta^{2}+\lambda^{2}-\kappa^{2}=0$$

$$\underline{\lambda=\pm \sqrt{\kappa^{2}-\delta^{2}}}$$

Now, to find the eigenvectors we find a basis for ##\text{Nul}(M-\lambda I)##:

We want ##\begin{bmatrix}x_{1}\\ x_{2} \end{bmatrix}## such that ##\begin{bmatrix}i\delta \pm \sqrt{\kappa^{2}-\delta^{2}} & i\kappa\\ -i\kappa & -i\delta \pm \sqrt{\kappa^{2}-\delta^{2}} \end{bmatrix}\begin{bmatrix}x_{1}\\ x_{2} \end{bmatrix}=\begin{bmatrix}0\\ 0 \end{bmatrix}##, so this gives

$$x_{2}=\frac{i(i\delta\pm\sqrt{\kappa^{2}-\delta^{2}})}{\kappa}x_{1},\ \therefore\text{eigenvectors}=\begin{bmatrix}1\\ \frac{\pm i\sqrt{\kappa^{2}-\delta^{2}}-\delta}{\kappa} \end{bmatrix}.$$

If this is correct so far, ##M## can be diagonalized as follows:

$$P=\begin{bmatrix}1 & 1\\ \frac{i\sqrt{\kappa^{2}-\delta^{2}}-\delta}{\kappa} & \frac{-i\sqrt{\kappa^{2}-\delta^{2}}-\delta}{\kappa} \end{bmatrix},\ \text{and}\ M=P\begin{pmatrix}\sqrt{\kappa^{2}-\delta^{2}} & 0\\ 0 & -\sqrt{\kappa^{2}-\delta^{2}} \end{pmatrix}P^{-1}$$

I believe the matrix exponential would be given by:

$$e^{M}=P\begin{bmatrix}e^{\lambda_{1}} & 0\\ 0 & e^{\lambda_{2}} \end{bmatrix}P^{-1} \tag{2}$$

So how does finding ##e^M## lead to the final answer? How do we get to the final answer as given in 1.1-2? I am very confused about where the hyperbolic functions come from.

Any explanation would be greatly appreciated.

roam said:
So how does finding ##e^M## lead to the final answer? How do we get to the final answer as given in 1.1-2? I am very confused about where the hyperbolic functions come from.
If you write out the solutions, you will get your functions as linear combinations of the exponentials ##e^{\lambda_i z}##. (Note that the matrix exponential you are looking for is ##e^{Mz}##.) The following relation may be of use to you:
$$e^x = \frac{e^x + e^{-x}}{2} + \frac{e^x - e^{-x}}{2} = \cosh(x) + \sinh(x)$$

Edit: A more straight-forward way is to directly write your functions as linear combinations of the eigenvectors and use that the ODEs for the eigenvector coefficients separate and are not coupled.

roam
roam said:

## Homework Statement

Solve the following coupled differential equations by finding the eigenvectors and eigenvalues of the matrix and using it to calculate the matrix exponent:

$$\frac{df}{dz}=i\delta f(z)+i\kappa b(z)$$

$$\frac{db}{dz}=-i\delta b(z)-i\kappa f(z)$$

In matrix form:

$$\frac{d}{dz}\begin{pmatrix}f\\b\end{pmatrix}=-i\begin{pmatrix}-\delta & -\kappa\\ \kappa &\delta\end{pmatrix}\begin{pmatrix}f\\b\end{pmatrix}$$

## Homework Equations

These are known as the fiber mode equations in photonics, and I know that the analytic solutions to the above equations must be:

$$f(z)=f(0)\frac{\alpha\cosh(\alpha(L-z))-i\delta\sinh(\alpha(L-z))}{\alpha\cosh(\alpha L)-i\delta\sinh(\alpha L)} \tag{1.1}$$

$$b(z)=if(0)\frac{\kappa\sinh(\alpha(L-z))}{\alpha\cosh(\alpha L)-i\delta\sinh(\alpha L)} \tag{1.2}$$

where ##\alpha=\sqrt{\kappa^{2}-\delta^{2}}##. And ##L## is the fiber length (there is a boundary condition that ##b(z=L)=0##).

## The Attempt at a Solution

So, I have found the eigenvalues by solving ##\text{det}|M-\lambda I|=0##:

$$\text{det}\begin{bmatrix}i\delta-\lambda & i\kappa\\ -i\kappa & -i\delta-\lambda \end{bmatrix}=\delta^{2}+\lambda^{2}-\kappa^{2}=0$$

$$\underline{\lambda=\pm \sqrt{\kappa^{2}-\delta^{2}}}$$

Now, to find the eigenvectors we find a basis for ##\text{Nul}(M-\lambda I)##:

We want ##\begin{bmatrix}x_{1}\\ x_{2} \end{bmatrix}## such that ##\begin{bmatrix}i\delta \pm \sqrt{\kappa^{2}-\delta^{2}} & i\kappa\\ -i\kappa & -i\delta \pm \sqrt{\kappa^{2}-\delta^{2}} \end{bmatrix}\begin{bmatrix}x_{1}\\ x_{2} \end{bmatrix}=\begin{bmatrix}0\\ 0 \end{bmatrix}##, so this gives

$$x_{2}=\frac{i(i\delta\pm\sqrt{\kappa^{2}-\delta^{2}})}{\kappa}x_{1},\ \therefore\text{eigenvectors}=\begin{bmatrix}1\\ \frac{\pm i\sqrt{\kappa^{2}-\delta^{2}}-\delta}{\kappa} \end{bmatrix}.$$

If this is correct so far, ##M## can be diagonalized as follows:

$$P=\begin{bmatrix}1 & 1\\ \frac{i\sqrt{\kappa^{2}-\delta^{2}}-\delta}{\kappa} & \frac{-i\sqrt{\kappa^{2}-\delta^{2}}-\delta}{\kappa} \end{bmatrix},\ \text{and}\ M=P\begin{pmatrix}\sqrt{\kappa^{2}-\delta^{2}} & 0\\ 0 & -\sqrt{\kappa^{2}-\delta^{2}} \end{pmatrix}P^{-1}$$

I believe the matrix exponential would be given by:

$$e^{M}=P\begin{bmatrix}e^{\lambda_{1}} & 0\\ 0 & e^{\lambda_{2}} \end{bmatrix}P^{-1} \tag{2}$$

So how does finding ##e^M## lead to the final answer? How do we get to the final answer as given in 1.1-2? I am very confused about where the hyperbolic functions come from.

Any explanation would be greatly appreciated.

The way I like to evaluate ##\exp(A)## for a matrix such as ##A = Mt## is to use the fact that for any analytic function ##f(\cdot)## we have
$$f(A) = \sum_i E_i \, f(\lambda_i),$$
where the ##\lambda_i## are the eigenvalues of ##A## and the matrices ##E_1, E_2, \ldots ## are independent of the function ##f(.)##; that is, they are the same for any ##f##--see below. (This assumes all eigenvalues are unequal; modifications are needed if you have some repeated eigenvalues.)

Anyway, for your ##2 \times 2## matrix ##A## you can apply that equation to the two functions ## f(x) = 1 = x^0## giving ##A^0 = I = E_1 \lambda_1^0 + E_2 \lambda_2^0 = E_1 + E_2## and ##f(x) = x##, giving ##A^1 = A =E_1 \lambda_1^1 + E_2 \lambda_2^1 = E_1 \lambda_1 + E_2 \lambda_2##. (In the first equation, ##I = A^0## is the identity matrix.)

After you have solved the two algebraic equations ##i = e_1+e_2## and ##a = e_1 \lambda_1 + e_2 \lambda_2## for ##e_1,e_2## in terms of ##i,a##, you can substitute ##I## for ##i## and ##A## for ##a## to get your two matrices ##E_1, E_2##.

Now the rest is easy: ##\exp(A) = E_1 \exp(\lambda_1) + E_2 \exp(\lambda_2)##.

Why does it work? Well, for an ##n \times n## matrix ##A## with ##n## distinct eigenvalues ##\lambda_1, \lambda_2, \ldots, \lambda_n## we can diagonalize it by a similarity transformation:
$$A = P \pmatrix{\lambda_1 & 0 & \cdots & 0\\ 0 & \lambda_2 & \cdots & 0 \\ \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & \cdots & \lambda_n} P^{-1} \equiv P \Lambda P^{-1}$$
We have
$$f(A) = P f(\Lambda) P^{-1},$$
in which ##f(\Lambda)## is a diagonal matrix with diagonal elements ##f(\lambda_i)##. Pulling out each factor ##f(\lambda_i)## separately gives the stated result.

Of course, if you have already found the matrix ##P## you can evaluate the ##E_i## directly, without the need for solving any linear equations to find them. However, you do not need to know ##P## in order to carry out the computations, so you do not need to determine the eigenvectors, etc.

Last edited:
roam
Orodruin said:
If you write out the solutions, you will get your functions as linear combinations of the exponentials ##e^{\lambda_i z}##. (Note that the matrix exponential you are looking for is ##e^{Mz}##.) The following relation may be of use to you:
$$e^x = \frac{e^x + e^{-x}}{2} + \frac{e^x - e^{-x}}{2} = \cosh(x) + \sinh(x)$$

Edit: A more straight-forward way is to directly write your functions as linear combinations of the eigenvectors and use that the ODEs for the eigenvector coefficients separate and are not coupled.

Thank you for the relation, this should be helpful in doing the simplification. But how exactly should I write out the solutions to get to the form given in the equations above (1.1-2)?

$$e^{Mz}=P\begin{bmatrix}e^{\lambda_{1}z} & 0\\ 0 & e^{\lambda_{2}z} \end{bmatrix}P^{-1}$$

$$=\begin{bmatrix}1 & 1\\ \frac{i\sqrt{\kappa^{2}-\delta^{2}}-\delta}{\kappa} & \frac{-i\sqrt{\kappa^{2}-\delta^{2}}-\delta}{\kappa} \end{bmatrix}\begin{bmatrix}e^{\sqrt{\kappa^{2}-\delta^{2}}z} & 0\\ 0 & e^{-\sqrt{\kappa^{2}-\delta^{2}}z} \end{bmatrix}\begin{bmatrix}\frac{i\sqrt{\kappa^{2}-\delta^{2}}+\delta}{2i\sqrt{\kappa^{2}-\delta^{2}}} & -\frac{\kappa}{-2i\sqrt{\kappa^{2}-\delta^{2}}}\\ \frac{i\sqrt{\kappa^{2}-\delta^{2}}+\delta}{2i\sqrt{\kappa^{2}-\delta^{2}}} & \frac{\kappa}{-2i\sqrt{\kappa^{2}-\delta^{2}}}\end{bmatrix}$$

When I carry out all the matrix multiplications I get:

$$\begin{bmatrix}\frac{\left(i\sqrt{\kappa^{2}-\delta^{2}}+\delta\right)\left(e^{\sqrt{\kappa^{2}-\delta^{2}}z}+e^{-\sqrt{\kappa^{2}-\delta^{2}}z}\right)}{2i\sqrt{\kappa^{2}-\delta^{2}}} & \frac{\kappa\left(e^{-\sqrt{\kappa^{2}-\delta^{2}}z}-e^{\sqrt{\kappa^{2}-\delta^{2}}z}\right)}{-2i\sqrt{\kappa^{2}-\delta^{2}}}\\ \frac{\left(-\kappa^{2}\right)e^{\sqrt{\kappa^{2}-\delta^{2}}z}+\left(\kappa^{2}-2\delta^{2}-2\delta i\sqrt{\kappa^{2}-\delta^{2}}\right)e^{-\sqrt{\kappa^{2}-\delta^{2}}z}}{2i\kappa\sqrt{\kappa^{2}-\delta^{2}}} & \frac{\delta\left(e^{-\sqrt{\kappa^{2}-\delta^{2}}z}-e^{\sqrt{\kappa^{2}-\delta^{2}}z}\right)}{i\sqrt{\kappa^{2}-\delta^{2}}} \end{bmatrix}$$

You need to multiply the matrix exponential with the initial condition. The matrix exponential by itself is not the solution to the problem.

Edit: I also strongly suggest that you use the ##\alpha## defined in post #1 to tidy up your expressions.

roam
Thank you very much for the suggestions. Hopefully this is correct:

$$\begin{bmatrix}f(z)\\ b(z) \end{bmatrix}\stackrel{?}{=}\begin{bmatrix}\frac{\left(i\alpha+\delta\right)\left(e^{\alpha z}+e^{-\alpha z}\right)}{2i\alpha} & \frac{\kappa\left(e^{-\alpha z}-e^{\alpha z}\right)}{-2i\alpha}\\ \frac{\left(-\kappa^{2}\right)e^{\alpha z}+\left(\kappa^{2}-2\delta^{2}-2\delta i\alpha\right)e^{-\alpha z}}{2i\kappa\alpha} & \frac{\delta\left(e^{-\alpha z}-e^{\alpha z}\right)}{i\alpha} \end{bmatrix}\begin{bmatrix}f(0)\\ b(0)\end{bmatrix}$$

So, for ##f(z)## this gives:

$$f(z)=\frac{\left(i\alpha+\delta\right)\left(e^{\alpha z}+e^{-\alpha z}\right)}{2i\alpha}f(0)+\frac{\kappa\left(e^{-\alpha z}-e^{\alpha z}\right)}{-2i\alpha}b(0)$$

$$=\frac{1}{i\alpha}\left[\left(i\alpha+\delta\right)\frac{\left(e^{\alpha z}+e^{-\alpha z}\right)}{2}f(0)+\kappa\frac{e^{\alpha z}-e^{-\alpha z}}{2}b(0)\right]$$

$$=\frac{1}{i\alpha}\left[\left(i\alpha+\delta\right)\cosh\left(\alpha z\right)f(0)+\kappa\sinh\left(\alpha z\right)b(0)\right]$$

It is getting closer to the answer but it still doesn't agree with the correct solution posted above. Any ideas what could be wrong here?

Also, how would it be possible to factor ##L## into the solutions? It represents the fiber length, such that ##b(L)=0##. I have made a diagram of the geometry of the problem:

#### Attachments

• AxvrioH.jpg
13.3 KB · Views: 792
You also have a condition for ##b(L)##. You should be able to use that condition to fix ##b(0)## in terms of ##f(0)##.

roam
roam said:
Thank you very much for the suggestions. Hopefully this is correct:

$$\begin{bmatrix}f(z)\\ b(z) \end{bmatrix}\stackrel{?}{=}\begin{bmatrix}\frac{\left(i\alpha+\delta\right)\left(e^{\alpha z}+e^{-\alpha z}\right)}{2i\alpha} & \frac{\kappa\left(e^{-\alpha z}-e^{\alpha z}\right)}{-2i\alpha}\\ \frac{\left(-\kappa^{2}\right)e^{\alpha z}+\left(\kappa^{2}-2\delta^{2}-2\delta i\alpha\right)e^{-\alpha z}}{2i\kappa\alpha} & \frac{\delta\left(e^{-\alpha z}-e^{\alpha z}\right)}{i\alpha} \end{bmatrix}\begin{bmatrix}f(0)\\ b(0)\end{bmatrix}$$
View attachment 213599

As explained in #3, for your matrix
$$A = \pmatrix{i\delta & i \kappa\\-i \kappa & -i \delta}$$
with eigenvalues ##\alpha, -\alpha## (where ##\alpha = \sqrt{\kappa^2 - \delta^2}##) the matrices ##E_1, E_2## are obtained from the equations
$$E_1 + E_2 = I, \;\; \alpha E_1 - \alpha E_2 = A$$
so that
$$E_1 = \frac{1}{2} I + \frac{1}{2 \alpha} A, \;\; E_2 = \frac{1}{2} I - \frac{1}{2 \alpha} A.$$
Thus,
$$\exp(A t) = E_1 e^{\alpha t} + E_2 e^{-\alpha t} = I \cosh(\alpha t) + \frac{1}{\alpha} A \sinh(\alpha t)$$

roam
Ray Vickson said:
$$E_1 = \frac{1}{2} I + \frac{1}{2 \alpha} A, \;\; E_2 = \frac{1}{2} I - \frac{1}{2 \alpha} A.$$
Thus,
$$\exp(A t) = E_1 e^{\alpha t} + E_2 e^{-\alpha t} = I \cosh(\alpha t) + \frac{1}{\alpha} A \sinh(\alpha t)$$

Thank you. So if I used that last expression I would have:

$$e^{Mz} = \begin{bmatrix}1 & 0\\ 0 & 1 \end{bmatrix}\cosh(\alpha z)+\frac{1}{\alpha}\begin{bmatrix}i\delta & i\kappa\\ -i\kappa & -i\delta \end{bmatrix}\sinh(\alpha z)$$

$$=\begin{bmatrix}\cosh(\alpha z)+\frac{i\delta}{\alpha}\sinh(\alpha z) & \frac{i\kappa}{\alpha}\sinh(\alpha z)\\ \frac{-i\kappa}{\alpha}\sinh(\alpha z) & \cosh(\alpha z)-\frac{i\delta}{\alpha}\sinh(\alpha z) \end{bmatrix}$$

Multiplying this matrix exponential with the initial condition to get the solutions:

##f(z)=\left(\cosh(\alpha z)+\frac{i\delta}{\alpha}\sinh(\alpha z)\right)f(0)+\frac{i\kappa}{\alpha}\sinh(\alpha z)b(0) \tag{i}##

##b(z)=\frac{-i\kappa}{\alpha}\sinh(\alpha z)f(0)+\left(\cosh(\alpha z)-\frac{i\delta}{\alpha}\sinh(\alpha z)\right)b(0) \tag{ii}##

Due to the geometry of the problem ##b(L)=0##, so I tried to write ##b(0)## in terms of ##f(0)##:

##f(L)=\left(\cosh(\alpha L)+\frac{i\delta}{\alpha}\sinh(\alpha L)\right)f(0)+\frac{i\kappa}{\alpha}\sinh(\alpha L)b(0)##

##\therefore \ \underline{b(0)=\frac{-i\alpha f(L)+\left(i\alpha\cosh(\alpha L)-\delta\sinh(\alpha L)\right)f(0)}{\kappa\sinh(\alpha L)}}##

When I substitute this into (i) I get this expression:

$$f(z)=\frac{\left(\cosh(\alpha z)\sinh(\alpha L)\right)f(0)+\sinh(\alpha z)f(L)-\left(\cosh(\alpha L)\sinh(\alpha z)\right)f(0)}{\sinh(\alpha L)}$$

Is there a mistake somewhere? Or is it still possible to manipulate this expression so that it agrees with equation 1.1?

I did not try to check your computations explicitly, but looking at your final expression, you should try to eliminate ##f(L)## from it. What you should use to eliminate ##b(0)## is not ##f(L)##, it is the expression for ##b(L)##, which must be equal to zero.

roam
roam said:
Thank you. So if I used that last expression I would have:

-------------------------------

$$f(z)=\frac{\left(\cosh(\alpha z)\sinh(\alpha L)\right)f(0)+\sinh(\alpha z)f(L)-\left(\cosh(\alpha L)\sinh(\alpha z)\right)f(0)}{\sinh(\alpha L)}$$

Is there a mistake somewhere? Or is it still possible to manipulate this expression so that it agrees with equation 1.1?

As pointed out in #10, you need to express b(0) in terms of f(0) by setting b(L) = 0. Then, to simplify further, use the "addition" laws
$$\begin{array}{l}\cosh(u-v) = \cosh(u) \cosh(v) - \sinh(u) \sinh(v)\\ \sinh(u-v) = \sinh(u) \cosh(v) - \cosh(u) \sinh(v) \end{array}$$
When I did it I got exactly eq (1.1), eventually.

roam
Thank you very much, Ray Vickson and Orodruin. I really appreciate your time. I got the correct answer too (it makes perfect sense now).

## 1. What are coupled differential equations?

Coupled differential equations refer to a system of equations where two or more variables are related to each other through differential equations. This means that the rate of change of one variable is dependent on the values of the other variables in the system.

## 2. What is a matrix exponent?

A matrix exponent is a mathematical operation that involves raising a square matrix to a power. This operation is similar to raising a number to a power, but in this case, the number is replaced by a matrix.

## 3. How are coupled differential equations solved using matrix exponent?

To solve coupled differential equations using matrix exponent, we first convert the system of equations into matrix form. Then, we use the matrix exponent to raise the matrix to a certain power, which allows us to solve for the values of the variables in the system.

## 4. What are the advantages of using matrix exponent to solve coupled differential equations?

Using matrix exponent to solve coupled differential equations can be advantageous because it allows for a more efficient and accurate solution. It also helps in visualizing the relationship between the variables in the system, as the matrix can be represented graphically.

## 5. What are some real-life applications of coupled differential equations using matrix exponent?

Coupled differential equations using matrix exponent have various applications in fields such as physics, chemistry, and engineering. They can be used to model and predict the behavior of complex systems, such as chemical reactions, electrical circuits, and population dynamics.

• Calculus and Beyond Homework Help
Replies
1
Views
161
• Calculus and Beyond Homework Help
Replies
6
Views
398
• Calculus and Beyond Homework Help
Replies
3
Views
214
• Calculus and Beyond Homework Help
Replies
19
Views
469
• Calculus and Beyond Homework Help
Replies
12
Views
2K
• Calculus and Beyond Homework Help
Replies
2
Views
480
• Calculus and Beyond Homework Help
Replies
2
Views
334
• Differential Geometry
Replies
3
Views
1K
• Calculus and Beyond Homework Help
Replies
3
Views
646
• Calculus and Beyond Homework Help
Replies
2
Views
634