Skip to content
Tutorials Center
My learning

Topics

Lesson 39 of 39 ยท Projects and Practice

Practice Problems: Systems, Series, Numerics and PDEs

Ten worked practice problems covering linear systems, phase planes, series solutions, Frobenius, Euler and RK4, stiffness, heat, wave and Laplace equations, checked with SymPy.

Reading is not the same as solving. This lesson collects ten problems that cover the second half of the course: systems and phase planes, series methods, numerical methods and PDEs. Try each one on paper first. Then read the solution, and run the code cells, which check every answer symbolically or numerically. A wrong answer found by a computer check is a cheap and valuable lesson.

A good routine: solve, verify by substitution (does the answer satisfy the equation and the initial or boundary conditions?), and sanity-check limits (does it decay when it should?).

The problems

1. Linear system. Find the general solution of x' = x + y, y' = 4x + y, and classify the origin.

2. Phase plane type. For u' = A u with A = [[2, -5], [1, -2]], find the eigenvalues and describe the trajectories.

3. Nonlinear equilibria. For x' = y, y' = -x + xยณ, find all equilibria and classify them by linearization.

4. Power series. Find the recurrence relation and the first nonzero terms of the two series solutions of y'' + x y = 0 about x = 0.

5. Frobenius. Solve 4x y'' + 2y' + y = 0 near x = 0: find the indicial roots and identify the solutions.

6. Euler and RK4. For y' = y, y(0) = 1, compute y(1) with Euler using h = 0.1, and with RK4 using a single step h = 1. Compare with e.

7. Stiffness. For y' = -50 y, what is the largest step for which explicit Euler is stable? What happens with h = 0.05, and with backward Euler?

8. Heat equation. Solve u_t = 2 u_xx on 0 < x < ฯ€ with u(0, t) = u(ฯ€, t) = 0 and u(x, 0) = 3 sin x - sin 4x.

9. Wave equation. Solve u_tt = 4 u_xx on 0 < x < 1, u(0, t) = u(1, t) = 0, u(x, 0) = sin(ฯ€x), u_t(x, 0) = 0. What is the period?

10. Laplace equation. Solve u_xx + u_yy = 0 on the unit square with u = 0 on the left, right and bottom sides and u(x, 1) = sin(ฯ€x).

Solutions

1. The matrix [[1, 1], [4, 1]] has characteristic polynomial (1 - ฮป)ยฒ - 4 = 0, so ฮป = 3 or ฮป = -1. Eigenvectors: (1, 2) for ฮป = 3 and (1, -2) for ฮป = -1. General solution: u = c1 (1, 2) e^{3t} + c2 (1, -2) e^{-t}. The eigenvalues have opposite signs, so the origin is a saddle.

2. The trace is 0 and the determinant is -4 + 5 = 1, so ฮปยฒ + 1 = 0 and ฮป = ยฑi. Purely imaginary eigenvalues: a center; trajectories are closed ellipses traversed forever with period 2ฯ€.

3. Equilibria: y = 0 and -x + xยณ = 0, so (0, 0), (1, 0), (-1, 0). The Jacobian is [[0, 1], [-1 + 3xยฒ, 0]]. At (ยฑ1, 0) it is [[0, 1], [2, 0]] with eigenvalues ยฑโˆš2: saddles. At (0, 0) the eigenvalues are ยฑi, a linear center. Linearization alone is inconclusive there, but the system has the conserved energy yยฒ/2 + xยฒ/2 - xโด/4, so it really is a center.

4. With y = ฮฃ a_n x^n, matching powers gives a_2 = 0 and (n+2)(n+1) a_{n+2} = -a_{n-1}. So y = a0 (1 - xยณ/6 + xโถ/180 - ...) + a1 (x - xโด/12 + xโท/504 - ...).

5. Dividing by 4x: y'' + y'/(2x) + y/(4x) = 0, so p0 = 1/2, q0 = 0. The indicial equation r(r - 1) + r/2 = 0 gives r = 0 and r = 1/2 (not differing by an integer). The two solutions are cos(โˆšx) and sin(โˆšx).

6. Euler: y(1) = 1.1^10 โ‰ˆ 2.5937. RK4, one step h = 1: k1 = 1, k2 = 1.5, k3 = 1.75, k4 = 2.75, so y(1) = 1 + (1 + 3 + 3.5 + 2.75)/6 = 2.7083. The exact value is e โ‰ˆ 2.71828: a single RK4 step beats ten Euler steps.

7. Stability needs |1 - 50h| < 1, so h < 0.04. At h = 0.05 the factor is 1 - 2.5 = -1.5: the numerical solution oscillates and grows. Backward Euler multiplies by 1/(1 + 50h) = 1/3.5 and decays for every h.

8. Each sine mode decays at rate k nยฒ = 2 nยฒ: u = 3 e^{-2t} sin x - e^{-32t} sin 4x. The high-frequency mode vanishes sixteen times faster.

9. The wave speed is c = 2. The initial shape is the first mode, which has frequency ฯ‰ = ฯ€c/L = 2ฯ€: u = sin(ฯ€x) cos(2ฯ€t). The period is 1.

10. The boundary data is the first mode: u = sin(ฯ€x) sinh(ฯ€y) / sinh(ฯ€).

Verify with SymPy

Python Check problems 1, 4, 5 and 8 to 10 symbolically

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

All residuals should be zero (in problem 4 only the highest-order leftover terms remain, because the series is truncated). If you see something else, find out which step of your solution differs.

Verify the numerical answers

Python Check problems 2, 3, 6 and 7 numerically

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A strategy for exam-style problems

Before you start

Identify the type Linear? Separable? System? PDE kind?
Pick the tool Eigenvalues, series, Laplace, separation.
Verify Substitute into the equation and conditions.
Sanity check Limits, symmetry, units.

Most errors are algebra slips that substitution catches.

1 / 2

Common mistakes

  • Reading a saddle from the trace instead of the determinant.
  • Forgetting the x^r prefactor when moving from the indicial equation to the solution.
  • Using explicit Euler beyond its stability limit and blaming the code.
  • Taking the wrong frequency for the wave equation: ฯ‰_n = nฯ€c/L, not nฯ€/L.
  • Writing the Laplace solution with sin(ฯ€y) instead of sinh(ฯ€y): exponentials in one direction, not oscillations.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A 2x2 matrix with eigenvalues 3 and -1 gives an equilibrium of type:

    Real eigenvalues of opposite sign form a saddle.
  2. 2. The largest stable explicit Euler step for y' = -50y is (exclusive):

    |1 - 50h| < 1 means h < 2/50 = 0.04.
  3. 3. u = sin(ฯ€x) cos(2ฯ€t) solves the wave equation with speed c equal to:

    u_tt = -4ฯ€ยฒ u and u_xx = -ฯ€ยฒ u, so u_tt = 4 u_xx and c = 2.
  4. 4. The Frobenius indicial roots of 4x y'' + 2y' + y = 0 are:

    With p0 = 1/2 and q0 = 0, r(r - 1) + r/2 = r(r - 1/2) = 0.

Summary

  • Always verify a solution by substituting it into the equation and conditions; SymPy makes this effortless.
  • Classify first: eigenvalues for systems, regularity of the point for series, the discriminant for PDEs.
  • For numerical methods, check stability limits before accuracy.
  • Standing-wave and Fourier solutions are built from eigenfunctions, one mode at a time.
  • Keep working problems from every chapter; the fluency comes from repetition.

Next: Differential Equations course page