UcenlyOpen in the app

Differential Equations & Numerical Methods · BE5B01DEN · Topic 7 of 13

Numerical solution of higher order ODEs

Week 7. Rewrite the equation as a first order system, then apply the same one-step formulas to the whole vector.

Open the interactive lesson

Key ideas

Rewrite as a first order system

Name the unknown and each derivative up to order n−1. An equation of order n becomes n equations of order 1, and a system whose orders add up to n becomes n first order equations.

Apply Euler or RK to the vector

Each step computes the slopes of all components from the old values, then updates all of them. Euler on a system is Euler with vector slopes; RK4 works the same way.

The Taylor method as an alternative

Differentiate the equation to get y″, y‴, … at the current point, and take the degree-p Taylor polynomial of the solution as the step. The method has order p and also works directly for higher order equations.

In one line: A higher order ODE is never harder numerically: it is the same method on a longer vector.

Formulas

Practice with worked solutions

Question 1

Rewrite the equation as a first order system with y₁ = y and y₂ = y′.

y′′+2y′+5y=sin⁡xy''+2y'+5y=\sin x
  1. y₁′ = y₂, y₂′ = sin x − 2y₁ − 5y₂
  2. y₁′ = y₂, y₂′ = sin x − 5y₁ − 2y₂ (correct)
  3. y₁′ = y₂, y₂′ = sin x + 5y₁ + 2y₂
  4. y₁′ = sin x, y₂′ = y₁ + y₂
Worked solution
  1. y′′=sin⁡x−2y′−5yy''=\sin x-2y'-5y
  2. y1′=y2,y2′=sin⁡x−5y1−2y2y_1'=y_2,\qquad y_2'=\sin x-5y_1-2y_2

Solve for the highest derivative first, then name each lower derivative.

Question 2

Apply the Euler method with h = 1/2 for two steps to the system form and give y₂ ≈ y(1).

y′′+y=0,y(0)=1, y′(0)=0y''+y=0,\quad y(0)=1,\ y'(0)=0
Worked solution

Answer: 3/4

  1. u′=v, v′=−u:u1=1+0.5⋅0=1,  v1=0−0.5⋅1=−0.5u'=v,\ v'=-u:\quad u_1=1+0.5\cdot0=1,\ \ v_1=0-0.5\cdot1=-0.5
  2. u2=1+0.5⋅(−0.5)=0.75u_2=1+0.5\cdot(-0.5)=0.75

Use u = y and v = y′ and update both with the old values.

Question 3

Apply two Euler steps with h = 0.1 to the system form and give the approximation of y′(0.2).

y′′=−3y′−2y,y(0)=1, y′(0)=0y''=-3y'-2y,\quad y(0)=1,\ y'(0)=0
Worked solution

Answer: -0.34

  1. u1=1+0.1⋅0=1,v1=0+0.1(−3⋅0−2⋅1)=−0.2u_1=1+0.1\cdot0=1,\quad v_1=0+0.1(-3\cdot0-2\cdot1)=-0.2
  2. u2=1+0.1(−0.2)=0.98,v2=−0.2+0.1(0.6−2)=−0.34u_2=1+0.1(-0.2)=0.98,\quad v_2=-0.2+0.1(0.6-2)=-0.34

Update u = y and v = y′ together; v′ = −3v − 2u.

More Differential Equations & Numerical Methods practice in Ucenly

Sources

Written by Ucenly. Based on the BE5B01DEN course materials: