← 2015 Paper 2
UPSC 2015 Maths Optional Paper 2 Q7b — Step-by-Step Solution
15 marks · Section B
Runge-Kutta methods (RK2/RK4) · Numerical Analysis · asked 4× in 13 yrs · Read the full method →
Question
Solve the initial value problem dxdy=x(y−x), y(2)=3 in the interval [2,2.4] using the Runge–Kutta fourth-order method with step size h=0.2.
Technique
RK4 with two steps, h=0.2; careful tracking of intermediate f evaluations.
Solution
Setup. f(x,y)=x(y−x). x0=2, y0=3, h=0.2. Two steps to reach x=2.4.
RK4 formula: at each step,
k1=hf(xn,yn)
k2=hf(xn+h/2,yn+k1/2)
k3=hf(xn+h/2,yn+k2/2)
k4=hf(xn+h,yn+k3)
yn+1=yn+61(k1+2k2+2k3+k4)
Step 1 — Step 1: x0=2,y0=3 to x1=2.2
f(2,3)=2(3−2)=2.
k1=0.2⋅2=0.4.
f(2.1,3+0.4/2)=f(2.1,3.2)=2.1(3.2−2.1)=2.1⋅1.1=2.31.
k2=0.2⋅2.31=0.462.
f(2.1,3+0.462/2)=f(2.1,3.231)=2.1(3.231−2.1)=2.1⋅1.131=2.3751.
k3=0.2⋅2.3751=0.47502.
f(2.2,3+0.47502)=f(2.2,3.47502)=2.2(3.47502−2.2)=2.2⋅1.27502=2.805044.
k4=0.2⋅2.805044=0.561009.
y1=3+61(0.4+2⋅0.462+2⋅0.47502+0.561009)
=3+61(0.4+0.924+0.95004+0.561009)
=3+61(2.835049)
=3+0.472508
≈3.4725.
Step 2 — Step 2: x1=2.2,y1=3.4725 to x2=2.4
f(2.2,3.4725)=2.2(3.4725−2.2)=2.2⋅1.2725=2.7995.
k1=0.2⋅2.7995=0.5599.
f(2.3,3.4725+0.5599/2)=f(2.3,3.4725+0.27995)=f(2.3,3.75245)=2.3(3.75245−2.3)=2.3⋅1.45245=3.340635.
k2=0.2⋅3.340635=0.668127.
f(2.3,3.4725+0.668127/2)=f(2.3,3.4725+0.3340635)=f(2.3,3.8065635)=2.3(3.8065635−2.3)=2.3⋅1.5065635=3.465096.
k3=0.2⋅3.465096=0.693019.
f(2.4,3.4725+0.693019)=f(2.4,4.165519)=2.4(4.165519−2.4)=2.4⋅1.765519=4.237246.
k4=0.2⋅4.237246=0.847449.
y2=3.4725+61(0.5599+2⋅0.668127+2⋅0.693019+0.847449)
=3.4725+61(0.5599+1.336254+1.386038+0.847449)
=3.4725+61(4.129641)
=3.4725+0.688274
≈4.1608.
Summary
Answer
y(2.2)≈3.4725,y(2.4)≈4.1608.