Skip to main content

RK-2: simultaneous equations

Short answer

Using second-order Runge-Kutta for systems with h=0.1: k1,h*f, l1=h*g, then k2=h*f(x+h,y+k1,z+l1), l2=h*g(x+h,y+k1,z+l1), update with average. y(0.1)≈0.1050, z(0.1)≈0.9995; y(0.2)≈0.2200, z(0.2)≈0.9968.

Solve the following simultaneous differential equations using Runge-Kutta second order method at x = 0.1 and 0.2. dy/dx = xz + 1; dz/dx = -xy with initial conditions y(0) = 0, z(0) = 1

For the system dy/dx = f(x, y, z) = xz + 1 and dz/dx = g(x, y, z) = −xy with y(0) = 0, z(0) = 1, take h = 0.1 (two steps to x = 0.2). Second-order Runge–Kutta (Heun) for a system:

k₁ = h·f(x, y, z)                 l₁ = h·g(x, y, z)
k₂ = h·f(x+h, y+k₁, z+l₁)         l₂ = h·g(x+h, y+k₁, z+l₁)
yₙ₊₁ = yₙ + (k₁+k₂)/2             zₙ₊₁ = zₙ + (l₁+l₂)/2

Step 1 (x = 0 → 0.1)

k₁ = 0.1(0·1 + 1)           = 0.1000
l₁ = 0.1(−0·0)              = 0.0000
k₂ = 0.1[0.1(1 + 0) + 1]    = 0.1100
l₂ = 0.1[−0.1(0 + 0.1)]     = -0.0010
y(0.1) = 0 + (0.1000 + 0.1100)/2 = 0.1050
z(0.1) = 1 + (0.0000 − 0.0010)/2 = 0.9995

Step 2 (x = 0.1 → 0.2)

k₁ = 0.1[0.1(0.9995) + 1]      = 0.1100
l₁ = 0.1[−0.1(0.1050)]         = -0.0011
k₂ = 0.1[0.2(z + l₁) + 1]      = 0.1200
l₂ = 0.1[−0.2(y + k₁)]         = -0.0043
y(0.2) = 0.1050 + (0.1100 + 0.1200)/2 = 0.2200
z(0.2) = 0.9995 + (−0.0011 − 0.0043)/2 = 0.9968

Table

stepxyzk₁(y)k₁(z)k₂(y)k₂(z)yₙ₊₁zₙ₊₁
00.00000.00001.00000.10000.00000.1100-0.00100.10500.9995
10.10000.10500.99950.1100-0.00110.1200-0.00430.22000.9968

Answer: y(0.1) ≈ 0.1050, z(0.1) ≈ 0.9995; y(0.2) ≈ 0.2200, z(0.2) ≈ 0.9968

✓ Answer checked by Claude Opus 5.5 (high effort)

All Numerical Method chapter 6 questions →