- 2070 Bhadra · 6 marks
RK-4: y'' - 3y' + y = sin x
Short answer
Write the second-order equation as y'=z, z'=3z-y+sin x. Using fourth-order Runge-Kutta with h=0.1 over two steps gives y(1.2) approximately 1.3281 and y'(1.2) approximately 0.8104.
Solve the following initial value problem for y(1.2) using the Runge-Kutta fourth order method. y'' - 3y' + y = sin x; y(1) = 1.2; y'(1) = 0.5
Put z = y'. Then y'' = 3y' − y + sin x gives the system
dy/dx = z = f(x, y, z)
dz/dx = 3z − y + sin x = g(x, y, z)
x₀ = 1, y₀ = 1.2, z₀ = 0.5
The step size is not given; take h = 0.1 (two steps to x = 1.2). RK-4 for the system:
k₁ = h·f(x, y, z) l₁ = h·g(x, y, z)
k₂ = h·f(x+h/2, y+k₁/2, z+l₁/2) l₂ = h·g(x+h/2, y+k₁/2, z+l₁/2)
k₃ = h·f(x+h/2, y+k₂/2, z+l₂/2) l₃ = h·g(x+h/2, y+k₂/2, z+l₂/2)
k₄ = h·f(x+h, y+k₃, z+l₃) l₄ = h·g(x+h, y+k₃, z+l₃)
yₙ₊₁ = yₙ + (k₁+2k₂+2k₃+k₄)/6 zₙ₊₁ = zₙ + (l₁+2l₂+2l₃+l₄)/6
(sin x is in radians.)
Step 1 (x = 1 → 1.1), starting values y = 1.2000, z = 0.5000
| k (for y) | l (for z) | |
|---|---|---|
| 1 | 0.0500 | 0.1141 |
| 2 | 0.0557 | 0.1314 |
| 3 | 0.0566 | 0.1337 |
| 4 | 0.0634 | 0.1536 |
y(1.1) = 1.2000 + (0.0500 + 2(0.0557) + 2(0.0566) + 0.0634)/6 = 1.2563
z(1.1) = 0.5000 + (0.1141 + 2(0.1314) + 2(0.1337) + 0.1536)/6 = 0.6330
Step 2 (x = 1.1 → 1.2), starting values y = 1.2563, z = 0.6330
| k (for y) | l (for z) | |
|---|---|---|
| 1 | 0.0633 | 0.1534 |
| 2 | 0.0710 | 0.1754 |
| 3 | 0.0721 | 0.1783 |
| 4 | 0.0811 | 0.2037 |
y(1.2) = 1.2563 + (0.0633 + 2(0.0710) + 2(0.0721) + 0.0811)/6 = 1.3281
z(1.2) = 0.6330 + (0.1534 + 2(0.1754) + 2(0.1783) + 0.2037)/6 = 0.8104
Answer: y(1.2) ≈ 1.3281 (and y'(1.2) ≈ 0.8104); y(1.1) ≈ 1.2563.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Program for RK-4 second order IVP · Numerical Method, chapter 6
- RK-2: y' = sin x + cos y · Numerical Method, chapter 6
- Program for RK-4 first order IVP · Numerical Method, chapter 6
- RK-2: y' = 4e^(0.8x) - 0.5y · Numerical Method, chapter 6
- RK-2: simultaneous equations · Numerical Method, chapter 6
- RK-2: y'' = y - x y' · Numerical Method, chapter 6 · asked 2×
- Initial value problem y''−4y'+3y · Mathematics, chapter 4 · asked 3×
- Initial value problem y''+2y'+5y=0 · Mathematics, chapter 4 · asked 3×
- Solve ODE by Laplace transform y''+2y'−3y=sint · Mathematics III, chapter 3 · asked 14×
- Solve y''+3y'+2y=e^(2x) sin x · Mathematics I, chapter 4 · asked 2×