Flow Lab

Syllabus / Module 7: Systems of ODEs & Dynamical Systems

Lesson 7.2

Linear Systems & the Eigenvalue Method

x' = Ax: eigenvector solutions e^{λt}v, general solutions by superposition, straight-line solutions in the phase plane.

Written byClaude Sonnet

🌊
Why this matters for simulation: Linear stability analysis of a flow is an eigenvalue problem for x' = Ax.

By the end of this lesson you can…

  • Derive from the trial solution $\mathbf x = e^{\lambda t}\mathbf v$ that $\mathbf x' = A\mathbf x$ is solved exactly when $A\mathbf v = \lambda\mathbf v$.
  • Explain why a trajectory that starts on an eigenvector line stays on it, moving toward or away from the origin according to the sign of $\lambda$.
  • Write the general solution of a 2x2 system with real distinct eigenvalues, check it solves the ODE, and test independence with a determinant.
  • Fit an initial condition by solving $V\mathbf c = \mathbf x_0$ and say what a large condition number of $V$ does to $\mathbf c$.
  • Decouple the system with $\mathbf x = V\mathbf y$, so that $\mathbf y' = \Lambda\mathbf y$, and read growth or decay off each eigenvalue.
  • Connect the eigenvalues of a companion matrix to the characteristic roots of <L to="second-order-odes/constant-coefficients-and-characteristic-equation" />, and verify it numerically.
  • Compare the eigen-solution with scipy's expm and with RK4, and predict the RK4 step-size limit for a stiff pair of eigenvalues.
On this page
·
  1. Trying x=eλtv\mathbf x = e^{\lambda t}\mathbf vx=eλtv
  2. Straight-line solutions
  3. Superposition: the general solution
  4. Fitting initial conditions: Vc=x0V\mathbf c = \mathbf x_0Vc=x0​
  5. When the eigenbasis is nearly degenerate
  6. Decoupling
  7. Growth, decay, and a preview of stability
  8. Connection to the second-order lesson
  9. Numerics: eigen-solution, expm and RK4
  10. Stiffness preview: why the fastest eigenvalue sets the step
  11. Computing it
  12. Concept checks
  13. Problems
  14. Key Takeaways

In 7.1 Systems & State Space you wrote down coupled systems and integrated them numerically; the only exact answers came from tricks. For the linear system x′=Ax\mathbf x' = A\mathbf x there is a complete method, and it rests on one geometric fact from 1.5 Eigenvectors & Eigenvalues: a matrix has special lines it only stretches. The flow of x′=Ax\mathbf x' = A\mathbf x cannot turn a state off such a line. Finding those lines solves the whole system, and the stretch factors say whether each direction grows or decays. This is also how a simulator’s linearised dynamics are analysed, so we finish with the link to fluids and with the numerical question that decides how small an RK4 step must be.

Only real, distinct eigenvalues appear in this lesson. Complex and repeated eigenvalues are the job of 7.4 Complex & Repeated Eigenvalues, and the classification of all the pictures is 7.3 Phase Portraits & the Trace–Determinant Plane.

▶ Video Straight-line solutions along eigenvectors, superposition, fitting x0, decoupling, and the stiffness limit of RK4captions only
Transcript
  1. For x prime equals A x, try the scalar solution's shape: x equals e to the lambda t times a constant vector v. The sides become lambda e to the lambda t v and e to the lambda t A v. Divide out the exponential: A v equals lambda v.
  2. Take A with rows 1, 2 and 3, 2. Trace 3 and determinant minus 4 give lambda minus 4 times lambda plus 1, so the eigenvalues are 4 and minus 1, with eigenvectors 2, 3 and 1, minus 1. Check: A times 2, 3 is 8, 12, which is 4 times 2, 3.
  3. On an eigenline, A x equals lambda x is parallel to x, so the flow cannot turn a state off the line. Start at 2, 3 on the lambda 4 line: x of 1 is e to the fourth times 2, 3, namely 109.196, 163.794, ratio 1.5, the slope of the line.
  4. Any combination of the two solutions solves the system. To reach every start, the eigenvectors must be independent. The Wronskian is e to the lambda one plus lambda two, times t, times det V. Here det V is minus 5, so W is minus 5 e to the 3 t, never zero.
  5. To fit x zero equals 1, 0, solve V c equals x zero, giving c equals 0.2, 0.6. Then x at 0.5 is 3.3195, 4.0695 and x at 1 is 22.0600, 32.5382. The lambda 4 term soon dwarfs the other, pulling the solution onto the unstable line.
  6. Now A with rows minus 1, 100 and 0, minus 2. Its eigenvectors, 1, 0 and 100, minus 1, are almost parallel. The condition number is 200.0 and c over x zero is 141.42. Both eigenvalues are negative, yet x one peaks at 25.0.
  7. Change to eigen-coordinates: x equals V y. Then y prime equals capital lambda y, with no shared variable, so each equation is scalar: y i equals c i e to the lambda i t. Here V inverse A V is diag 4, minus 1. All eigenvalues negative: every start decays.
  8. A second-order equation is a system for y and y prime. The determinant of C minus lambda I gives a lambda squared plus b lambda plus c, so the old roots are the eigenvalues. For 2 y double prime plus 7 y prime plus 3 y that is minus 3 and minus 0.5; y of 2 is 0.733280.
  9. At t equals 1 the eigen-solution matches expm to 1.7 times 10 to the minus 11: rounding. RK4 with h 0.1 is off by 2.0 times 10 to the minus 2, with h 0.01 by 2.7 times 10 to the minus 6: a ratio of 7.4 times 10 to the 3, near fourth order.
  10. Stiffness: eigenvalues minus 1 and minus 100. RK4 multiplies each decoupled mode by R of z, the degree-4 Taylor polynomial of e to the z, with z equal h lambda. The size of R reaches 1 at z equals minus 2.7853, so h must stay below 0.027853.
  11. Run to t equals 10. At h 0.025 and 0.0275, RK4 gives the exact 3.210 times 10 to the minus 5. At 0.0278 a trace of the fast mode survives, at 0.0279 it reaches 53.02, and at 0.03 it explodes to 3.4 times 10 to the 46.
  12. Linear stability of a flow is the same problem: perturb a base state and x prime equals A x, with A the Jacobian. A mode grows if the real part of lambda is positive. An inverted pendulum turns 10 to the minus 6 into 1.1013 times 10 to the minus 2 by t equals 10. From memory, Orr-Sommerfeld.
  13. To sum up. Trying e to the lambda t v gives A v equals lambda v. Eigenlines are never left, and V c equals x zero fits any start, though a large condition number warns of cancellation. Decoupling gives y prime equals capital lambda y. The fastest eigenvalue sets RK4's step. Next: complex and repeated eigenvalues.

Trying x=eλtv\mathbf x = e^{\lambda t}\mathbf v

For y′=ayy' = ay the solution is eate^{at}. For a system, try the same shape with a constant vector v≠0\mathbf v \neq 0: x(t)=eλtv\mathbf x(t) = e^{\lambda t}\mathbf v. The left side is x′=λeλtv\mathbf x' = \lambda e^{\lambda t}\mathbf v and the right side is Ax=eλtAvA\mathbf x = e^{\lambda t}A\mathbf v. Since eλte^{\lambda t} is never zero, divide it out:

Av=λv.A\mathbf v = \lambda\mathbf v .

So eλtve^{\lambda t}\mathbf v is a solution exactly when (λ,v)(\lambda, \mathbf v) is an eigenpair, and λ\lambda must satisfy det⁡(A−λI)=0\det(A - \lambda I) = 0. (The condition v≠0\mathbf v \neq 0 rules out the useless solution x≡0\mathbf x \equiv 0.) Calculus has turned into algebra, the same move as in 5.2 Constant Coefficients & the Characteristic Equation, and it is no coincidence; see the companion-matrix section below.

Worked example. Take A=(1232)A = \begin{pmatrix}1 & 2\\ 3 & 2\end{pmatrix}. The trace is 33 and the determinant is −4-4, so λ2−3λ−4=(λ−4)(λ+1)=0\lambda^2 - 3\lambda - 4 = (\lambda - 4)(\lambda + 1) = 0, giving λ1=4\lambda_1 = 4, λ2=−1\lambda_2 = -1. For λ1=4\lambda_1 = 4: A−4I=(−323−2)A - 4I = \begin{pmatrix}-3 & 2\\ 3 & -2\end{pmatrix}, whose rows say 3vx=2vy3v_x = 2v_y, so v1=(2,3)\mathbf v_1 = (2, 3). For λ2=−1\lambda_2 = -1: A+I=(2233)A + I = \begin{pmatrix}2 & 2\\ 3 & 3\end{pmatrix} gives v2=(1,−1)\mathbf v_2 = (1, -1). Check one directly: A(2,3)=(2+6, 6+6)=(8,12)=4(2,3)A(2,3) = (2 + 6,\ 6 + 6) = (8, 12) = 4(2, 3). Block A of the lab cell checks both and gets a residual max⁡∣AV−VΛ∣=0\max|AV - V\Lambda| = 0.

Straight-line solutions

Start the system exactly on an eigenvector, x0=c v\mathbf x_0 = c\,\mathbf v. Then x(t)=c eλtv\mathbf x(t) = c\,e^{\lambda t}\mathbf v solves the ODE and matches x0\mathbf x_0, so by uniqueness (7.1 Systems & State Space) it is the solution. It is always a multiple of v\mathbf v: the state never leaves the line through v\mathbf v. The scalar eλte^{\lambda t} only slides it along the line. If λ<0\lambda \lt 0 the point moves toward the origin and never reaches it; if λ>0\lambda \gt 0 it moves away. Because eλt>0e^{\lambda t} \gt 0 it also never crosses the origin to the other side.

Superposition: the general solution

Eigenvector solutions are special starts. Every other start is a mixture, and linearity does the mixing. Let x(t)=c1eλ1tv1+c2eλ2tv2\mathbf x(t) = c_1 e^{\lambda_1 t}\mathbf v_1 + c_2 e^{\lambda_2 t}\mathbf v_2. Differentiate term by term and use Avi=λiviA\mathbf v_i = \lambda_i\mathbf v_i:

x′=∑iciλieλitvi=∑icieλitAvi=Ax.\mathbf x' = \sum_i c_i\lambda_i e^{\lambda_i t}\mathbf v_i = \sum_i c_i e^{\lambda_i t}A\mathbf v_i = A\mathbf x .

Any combination solves the ODE for any constants. To reach every starting point we need two independent solutions, which for two vectors means det⁡[v1 v2]≠0\det[\mathbf v_1\ \mathbf v_2] \neq 0. (Eigenvectors for distinct eigenvalues are always independent, from 1.5 Eigenvectors & Eigenvalues.) This is the Wronskian idea of 5.1 Second-Order Linear Equations: Structure in vector form: W(t)=det⁡[eλ1tv1  eλ2tv2]=e(λ1+λ2)tdet⁡VW(t) = \det[e^{\lambda_1 t}\mathbf v_1\ \ e^{\lambda_2 t}\mathbf v_2] = e^{(\lambda_1 + \lambda_2)t}\det V, which is zero for no tt unless det⁡V=0\det V = 0. For our example det⁡V=2⋅(−1)−1⋅3=−5\det V = 2\cdot(-1) - 1\cdot 3 = -5, so W(t)=−5e3tW(t) = -5e^{3t}; block A prints W(1)=−100.42768=−5e3W(1) = -100.42768 = -5e^3. Also λ1+λ2=3\lambda_1 + \lambda_2 = 3 is the trace of AA, so W′=(tr⁡A) WW' = (\operatorname{tr}A)\,W: Abel’s formula again.

Fitting initial conditions: Vc=x0V\mathbf c = \mathbf x_0

Put x0\mathbf x_0 in at t=0t = 0: c1v1+c2v2=x0c_1\mathbf v_1 + c_2\mathbf v_2 = \mathbf x_0, that is

Vc=x0,V=(∣∣v1v2∣∣).V\mathbf c = \mathbf x_0, \qquad V = \begin{pmatrix} | & | \\ \mathbf v_1 & \mathbf v_2 \\ | & | \end{pmatrix}.

This is a linear solve, the Gaussian elimination you already know, and c1,c2c_1, c_2 are the coordinates of x0\mathbf x_0 in the eigenbasis. For the example with x0=(1,0)\mathbf x_0 = (1, 0): 2c1+c2=12c_1 + c_2 = 1 and 3c1−c2=03c_1 - c_2 = 0 give c1=0.2c_1 = 0.2, c2=0.6c_2 = 0.6, and

x(t)=0.2 e4t(23)+0.6 e−t(1−1).\mathbf x(t) = 0.2\,e^{4t}\begin{pmatrix}2\\3\end{pmatrix} + 0.6\,e^{-t}\begin{pmatrix}1\\-1\end{pmatrix}.

At t=1t = 1 this is (22.0600,32.5382)(22.0600, 32.5382) and at t=0.5t = 0.5 it is (3.3195,4.0695)(3.3195, 4.0695). The saddle preset of the sim starts here: its readout shows c=(0.2,0.6)\mathbf c = (0.2, 0.6) and, scrubbed to t=0.5t = 0.5 and t=1t = 1, those two states. The big arrow is the λ=4\lambda = 4 component and it soon dwarfs the other: the solution is pulled onto the unstable line.

◆ Interactive Drag the starting point. See the eigenlines, the two components c_i e^(lambda_i t) v_i adding to the state, and RK4 against the exact solution

Loading simulation…

Try the two negative preset with the default start (1,2)(1, 2): λ=−2,−5\lambda = -2, -5, v1=(1,1)\mathbf v_1 = (1, 1), v2=(2,−1)\mathbf v_2 = (2, -1), and c=(1.6667,−0.3333)\mathbf c = (1.6667, -0.3333). The λ=−5\lambda = -5 component has half-life ln⁡2/5=0.1386\ln 2/5 = 0.1386, the λ=−2\lambda = -2 component 0.34660.3466. By t=0.5t = 0.5 the state is (0.5584,0.6405)(0.5584, 0.6405) and the fast coordinate has shrunk from y2=−0.3333y_2 = -0.3333 to −0.0274-0.0274, a factor e−2.5=0.082e^{-2.5} = 0.082, while y1y_1 has only gone from 1.66671.6667 to 0.61310.6131. The fast mode dies first, so every curve bends onto the slow eigenline before heading in.

When the eigenbasis is nearly degenerate

The numbers cic_i are only as good as the solve. Take A=(−11000−2)A = \begin{pmatrix}-1 & 100\\ 0 & -2\end{pmatrix}: eigenvalues −1-1 and −2-2, eigenvectors (1,0)(1, 0) and (100,−1)(100, -1), almost parallel. For x0=(0,1)\mathbf x_0 = (0, 1) the solve gives c=(100,−1)\mathbf c = (100, -1): two big terms cancelling to a unit vector. With unit-length eigenvector columns, block B measures cond⁡(V)=200.0\operatorname{cond}(V) = 200.0 and ∣c∣/∣x0∣=141.42|\mathbf c|/|\mathbf x_0| = 141.42, so a relative error ε\varepsilon in x0\mathbf x_0 may reach about 200ε200\varepsilon in c\mathbf c (the standard perturbation bound, from memory; the 141 is measured here, the 200 is its ceiling). Both eigenvalues are negative, yet x1(t)=100(e−t−e−2t)x_1(t) = 100(e^{-t} - e^{-2t}) peaks at 25.025.0 at t=ln⁡2≈0.69t = \ln 2 \approx 0.69 before decaying, a transient of 25 times the starting size. Eigenvalues alone do not tell you the transient. The last preset of the sim shows it: c1,c2c_1, c_2 large and the sum small.

Decoupling

Change coordinates to the eigenbasis: x=Vy\mathbf x = V\mathbf y (so y=V−1x\mathbf y = V^{-1}\mathbf x, the coordinates cc had at t=0t = 0). Substituting, Vy′=AVyV\mathbf y' = AV\mathbf y, and multiplying by V−1V^{-1},

y′=V−1AV y=Λy,Λ=(λ100λ2).\mathbf y' = V^{-1}AV\,\mathbf y = \Lambda\mathbf y, \qquad \Lambda = \begin{pmatrix}\lambda_1 & 0\\ 0 & \lambda_2\end{pmatrix}.

This is A=VΛV−1A = V\Lambda V^{-1} of 1.6 Change of Basis & Diagonalization (there PP and DD), now put to work. The two equations y1′=λ1y1y_1' = \lambda_1y_1 and y2′=λ2y2y_2' = \lambda_2y_2 share no variable, so each is a scalar problem with the answer yi=cieλity_i = c_ie^{\lambda_it}. The middle panel of the sim plots exactly those; tick log scale and each becomes a straight line of slope λi/ln⁡10\lambda_i/\ln 10. Block A prints V−1AV=diag⁡(4,−1)V^{-1}AV = \operatorname{diag}(4, -1). Decoupling is the whole method: a coupled problem that is a diagonal problem in the right coordinates.

Growth, decay, and a preview of stability

Each mode follows cieλitc_ie^{\lambda_it}. If every λi<0\lambda_i \lt 0 then every mode decays and x→0\mathbf x \to 0 from every start: the origin is stable. The sim reports a half-life ln⁡2/∣λ∣\ln 2/|\lambda| per mode. If some λi>0\lambda_i \gt 0 then a generic start grows without bound, and only the starts with ci=0c_i = 0 for that mode escape it (in the saddle preset, the line along v2=(1,−1)\mathbf v_2 = (1, -1)). We connect and do not yet classify: 7.3 Phase Portraits & the Trace–Determinant Plane names these pictures (nodes, saddles) and handles complex eigenvalues, where oscillation enters. The transient above is a warning that decay in the long run is not the same as small along the way.

The saddle shows the knife edge. A start exactly on the v2=(1,−1)\mathbf v_2 = (1, -1) line decays like e−te^{-t}, but any error in the start, however tiny, puts a small c1c_1 on the λ=4\lambda = 4 mode, and that mode then outgrows the decaying one by the factor e(4−(−1))t=e5te^{(4-(-1))t} = e^{5t}. A numerical method has such errors at every step (rounding, plus truncation error that is not parallel to the line), so a simulation cannot hold a trajectory on an unstable manifold for long. A rounding error of 10−1610^{-16} would be overtaken after roughly ln⁡(1016)/5≈7.4\ln(10^{16})/5 \approx 7.4 time units (a back-of-envelope estimate, not run in the sim). In the sim, a start dragged close to that line snaps onto it, so the exact curve has c1=0c_1 = 0 (the readout shows it) while RK4 has no such guarantee.

Connection to the second-order lesson

Write ay′′+by′+cy=0ay'' + by' + cy = 0 as a system with x=(y,y′)\mathbf x = (y, y'):

x′=Cx,C=(01−c/a−b/a).\mathbf x' = C\mathbf x, \qquad C = \begin{pmatrix}0 & 1\\ -c/a & -b/a\end{pmatrix}.

Then det⁡(C−λI)=λ(λ+b/a)+c/a=0\det(C - \lambda I) = \lambda(\lambda + b/a) + c/a = 0, which is the characteristic equation aλ2+bλ+c=0a\lambda^2 + b\lambda + c = 0 of 5.2 Constant Coefficients & the Characteristic Equation, so the roots are the eigenvalues. An eigenvector is (1,λ)(1, \lambda): C(1,λ)=(λ, −c/a−bλ/a)=(λ,λ2)C(1,\lambda) = (\lambda,\ -c/a - b\lambda/a) = (\lambda, \lambda^2), because λ\lambda solves the quadratic. That is the vector of (y,y′)(y, y') for y=eλty = e^{\lambda t}, so the first component of the eigen-solution is the old solution. Verify with that lesson’s example 2y′′+7y′+3y=02y'' + 7y' + 3y = 0, y(0)=1y(0) = 1, y′(0)=2y'(0) = 2: block C finds the eigenvalues −3-3 and −0.5-0.5, equal to the roots of 2r2+7r+32r^2 + 7r + 3. Solving Vc=(1,2)V\mathbf c = (1, 2) gives y=2e−t/2−e−3ty = 2e^{-t/2} - e^{-3t} (check: y′(0)=−1+3=2y'(0) = -1 + 3 = 2), so y(2)=2e−1−e−6=0.733280y(2) = 2e^{-1} - e^{-6} = 0.733280, and block C reproduces 0.733280.73328 from the eigen-solution and 0.7332790.733279 from RK4 with 2020 steps.

Numerics: eigen-solution, expm and RK4

Fix t=1t = 1 for the saddle example. The eigen-solution gives (22.0600,32.5382)(22.0600, 32.5382) in exact arithmetic. Block A compares it with scipy’s expm(A t) @ x0 (the matrix exponential, the subject of 7.5 The Matrix Exponential & Fundamental Matrices) and with RK4. The gap to expm is 1.7×10−111.7\times10^{-11}, which is rounding and no more. RK4 (4.3 Runge–Kutta Methods & Butcher Tableaux) with h=0.1h = 0.1 is off by 2.0×10−22.0\times10^{-2}, and with h=0.01h = 0.01 by 2.7×10−62.7\times10^{-6}: a ratio of 7.4×1037.4\times10^3 for a tenfold smaller step, near the 10410^4 of a fourth-order method. At t=0.5t = 0.5 the gaps are 1.4×10−31.4\times10^{-3} and 1.8×10−71.8\times10^{-7}. The sim’s right panel draws the RK4 error and the readout gives the gap at the scrub time.

Stiffness preview: why the fastest eigenvalue sets the step

Let A=(−50.549.549.5−50.5)A = \begin{pmatrix}-50.5 & 49.5\\ 49.5 & -50.5\end{pmatrix}. Its eigenvalues are −1-1 (vector (1,1)(1,1)) and −100-100 (vector (1,−1)(1,-1)), and for x0=(1,0)\mathbf x_0 = (1, 0) both modes have c=0.5c = 0.5. The fast mode e−100te^{-100t} is below 10−410^{-4} by t=0.1t = 0.1, yet it still controls an explicit solver. Decouple: RK4 on y′=λyy' = \lambda y multiplies yy each step by R(hλ)=1+z+z2/2+z3/6+z4/24R(h\lambda) = 1 + z + z^2/2 + z^3/6 + z^4/24 with z=hλz = h\lambda (the degree-4 Taylor polynomial of eze^z, from 4.3 Runge–Kutta Methods & Butcher Tableaux). The fast mode stays bounded only if ∣R(−100h)∣≤1|R(-100h)| \le 1. On the negative real axis ∣R(z)∣=1|R(z)| = 1 at z=−2.7853z = -2.7853 (block D bisects it), so the limit is h<2.7853/100=0.027853h \lt 2.7853/100 = 0.027853. The slow mode would tolerate far more: at h=0.5h = 0.5 block D gets ∣R(−0.5)∣=0.60677|R(-0.5)| = 0.60677 against e−0.5=0.60653e^{-0.5} = 0.60653.

Now run it. Block D takes T=10T = 10 with hh near the limit; the exact ∣x(10)∣|\mathbf x(10)| is 3.210×10−53.210\times10^{-5}:

hh (steps)∥R(−100h)∥\|R(-100h)\|∥x(10)∥\|\mathbf x(10)\| from RK4
0.025 (400)0.648443.210×10−53.210\times10^{-5}
0.0275 (364)0.944153.210×10−53.210\times10^{-5}
0.0278 (360)0.988731.194×10−21.194\times10^{-2}
0.0279 (358)1.0121353.0253.02
0.028 (357)1.0241335123512
0.03 (333)1.381023.4×10463.4\times10^{46}

The factors are for the actual step T/nT/n, so they differ slightly from 100h100h. Below the limit the answer is exact to the digits shown (the fast mode has decayed away). At 0.02780.0278, ∣R∣=0.989|R| = 0.989 is still stable, but the fast mode is only decaying slowly, so a trace of it is left at t=10t = 10. Just above the limit the fast amplitude grows by 11 to 22 percent per step (1.0121.012 and 1.0241.024 in the table) and, after hundreds of steps, becomes visible; at 0.030.03 it explodes. This is the same story as the diffusion matrix of 7.1 Systems & State Space: the stable step is dictated by the fastest, most uninteresting mode, here about 3636 steps per unit of time to follow a mode that needs few. Implicit methods are not bound by this limit for decaying modes (from memory); 4.5 Stability Regions & Stiffness works that out. In the sim, pick the widely separated preset and drag hh upward: the amplification factor in the readout crosses 11 and the RK4 curve diverges.

Computing it

🐍 PythonLab: eigen-solution, expm and RK4; the ill-conditioned basis; the companion matrix; stiffness (blocks A to E)
⌘/Ctrl + Enter

Now build the method yourself. The exercise matrix is the saddle example; a second test uses A=(−421−3)A = \begin{pmatrix}-4 & 2\\ 1 & -3\end{pmatrix} with x0=(1,2)\mathbf x_0 = (1, 2), whose state at t=0.5t = 0.5 is (0.558409,0.640494)(0.558409, 0.640494).

🧪 Coding exerciseExercise: solve x' = Ax by eigendecomposition and compare with expm and RK4
⌘/Ctrl + Enter

Concept checks

✅ Concept check

For $\mathbf x' = A\mathbf x$ with $A\mathbf v = \lambda\mathbf v$, a trajectory starts at $\mathbf x_0 = 3\mathbf v$. Which statement is true?

✅ Concept check

A $2\times2$ system has real eigenvalues $-0.5$ and $-30$. Which description is correct?

✅ Concept check

RK4 is applied to a system with eigenvalues $-1$ and $-50$ and the stability limit is $|h\lambda| \lt 2.7853$ on the negative real axis. Largest stable $h$? (Give a number.)

✅ Concept check

The eigenvector matrix $V$ (unit-length columns) of $A$ has condition number $10^6$. What does that warn about?

Problems

✏️ Pen & paperSolve by the eigenvalue method●○○

Solve x′=(2112)x\mathbf x' = \begin{pmatrix}2 & 1\\ 1 & 2\end{pmatrix}\mathbf x, x(0)=(3,1)\mathbf x(0) = (3, 1).

Show worked solution

Trace 44, determinant 33: λ2−4λ+3=(λ−3)(λ−1)\lambda^2 - 4\lambda + 3 = (\lambda - 3)(\lambda - 1). For λ=3\lambda = 3: A−3I=(−111−1)A - 3I = \begin{pmatrix}-1 & 1\\ 1 & -1\end{pmatrix}, v1=(1,1)\mathbf v_1 = (1, 1). For λ=1\lambda = 1: A−I=(1111)A - I = \begin{pmatrix}1 & 1\\ 1 & 1\end{pmatrix}, v2=(1,−1)\mathbf v_2 = (1, -1). Solve c1+c2=3c_1 + c_2 = 3, c1−c2=1c_1 - c_2 = 1: c1=2c_1 = 2, c2=1c_2 = 1. So x=2e3t(1,1)+et(1,−1)\mathbf x = 2e^{3t}(1, 1) + e^{t}(1, -1). Check at t=0t = 0: (3,1)(3, 1). Check the ODE on the first component: x1′=6e3t+etx_1' = 6e^{3t} + e^t and 2x1+x2=2(2e3t+et)+(2e3t−et)=6e3t+et2x_1 + x_2 = 2(2e^{3t} + e^t) + (2e^{3t} - e^t) = 6e^{3t} + e^t. Both eigenvalues are positive, so every non-zero start grows.

✏️ Pen & paperA second-order equation as an eigenproblem●●○

For y′′+5y′+6y=0y'' + 5y' + 6y = 0, y(0)=1y(0) = 1, y′(0)=0y'(0) = 0: write the companion matrix, find its eigenvalues and eigenvectors, and solve.

Show worked solution

C=(01−6−5)C = \begin{pmatrix}0 & 1\\ -6 & -5\end{pmatrix}, det⁡(C−λI)=λ2+5λ+6=(λ+2)(λ+3)\det(C - \lambda I) = \lambda^2 + 5\lambda + 6 = (\lambda + 2)(\lambda + 3), the characteristic polynomial, so λ=−2,−3\lambda = -2, -3. The eigenvectors are (1,λ)(1, \lambda): (1,−2)(1, -2) and (1,−3)(1, -3) (check C(1,−2)=(−2, −6+10)=−2(1,−2)C(1,-2) = (-2,\ -6 + 10) = -2(1, -2)). The conditions are c1+c2=1c_1 + c_2 = 1 and −2c1−3c2=0-2c_1 - 3c_2 = 0. The second gives c1=−32c2c_1 = -\tfrac32c_2, and then −32c2+c2=1-\tfrac32c_2 + c_2 = 1 gives c2=−2c_2 = -2, c1=3c_1 = 3. So y=3e−2t−2e−3ty = 3e^{-2t} - 2e^{-3t}; check y′(0)=−6+6=0y'(0) = -6 + 6 = 0.

✏️ Pen & paperStep-size limit of a stiff pair●●●

A system has eigenvalues −1-1 and −200-200. Using ∣R(z)∣≤1|R(z)| \le 1 for z∈[−2.7853,0]z \in [-2.7853, 0], find the largest stable RK4 step and the number of steps to reach t=10t = 10. Then find the step at which a single step of the slow mode, R(−h)R(-h), is within 1%1\% of e−he^{-h}, and compare step counts.

Show worked solution

The fast mode needs 200h<2.7853200h \lt 2.7853, so h<0.013927h \lt 0.013927 and 10/0.013927≈71810/0.013927 \approx 718 steps. For the slow mode alone, solve ∣R(−h)/e−h−1∣=0.01|R(-h)/e^{-h} - 1| = 0.01 numerically: h=0.892h = 0.892 (at h=1h = 1 the ratio is 0.375/0.36790.375/0.3679, a 1.9%1.9\% error, too big; at h=0.5h = 0.5 it is 0.04%0.04\%). That needs about 10/0.892≈1210/0.892 \approx 12 steps, so stability forces about 6464 times more steps than accuracy of the slow mode asks for. That is stiffness. (These numbers come from the formula and a root-finder, not from the sim or lab.)

Key Takeaways

  • Trying x=eλtv\mathbf x = e^{\lambda t}\mathbf v in x′=Ax\mathbf x' = A\mathbf x gives Av=λvA\mathbf v = \lambda\mathbf v: exponential solutions come from eigenpairs.
  • A trajectory that starts on an eigenline stays on it, moving in or out along the line according to the sign of λ\lambda; off the lines the curve bends toward the slower-decaying or faster-growing direction.
  • The general solution is c1eλ1tv1+c2eλ2tv2c_1e^{\lambda_1t}\mathbf v_1 + c_2e^{\lambda_2t}\mathbf v_2, valid when det⁡V≠0\det V \neq 0 (so W(t)=e(λ1+λ2)tdet⁡VW(t) = e^{(\lambda_1+\lambda_2)t}\det V never vanishes). Example: c=(0.2,0.6)\mathbf c = (0.2, 0.6) and x(1)=(22.0600,32.5382)\mathbf x(1) = (22.0600, 32.5382).
  • Initial conditions are a linear solve Vc=x0V\mathbf c = \mathbf x_0; nearly parallel eigenvectors give a large condition number (200 in our example), big cancelling coefficients and transient growth (25 times) despite negative eigenvalues.
  • Decoupling with x=Vy\mathbf x = V\mathbf y gives y′=Λy\mathbf y' = \Lambda\mathbf y: nn independent scalar equations. All eigenvalues negative means decay from every start.
  • The characteristic equation of ay′′+by′+cy=0a y'' + b y' + c y = 0 is det⁡(C−λI)\det(C - \lambda I) for its companion matrix, so the eigenvalues are the old roots (−3-3 and −0.5-0.5 in our check).
  • The eigen-solution matches expm to 10−1110^{-11}, and RK4’s gap shrinks like h4h^4. The step limit of RK4 is 2.7853/∣λmax⁡∣2.7853/|\lambda_{\max}|: 0.0278530.027853 for λ=−100\lambda = -100, confirmed by the blow-up between h=0.0278h = 0.0278 and 0.02790.0279.
  • Linear stability of a flow is the same eigenvalue problem for a perturbation; real parts decide growth (from memory for the full fluid cases). Next: complex and repeated eigenvalues in 7.4 Complex & Repeated Eigenvalues, the matrix exponential in 7.5 The Matrix Exponential & Fundamental Matrices.
Finished this lesson?

Mark it complete to track your progress (saved in this browser). Reading every section does this for you.

Where this leads

These later lessons build directly on this one: