Q 3.7-10E

Question

Use the fourth-order Runge–Kutta algorithm to approximate the solution to the initial value problem  y'=1-xy,y(1)=1at x = 2. For a tolerance of , use a stopping procedure based on the absolute error.

Step-by-Step Solution

Verified
Answer

ϕ(2)=0.7014

1Step 1: Find the values of k i , i = 1, 2, 3, 4

Since y'=1-xy,y(1)=1and x=x0=1,y=yo=1and h = 1, M = 10


k1=hf(x,y)=1(1-0)=0k2=hfx+h2,y+k12=-12k3=hfx+h2,y+k22=-18k4=hfx+h,y+k3=-34



2Step 2: Find the values of x and y

x=1+1=2y=1+16k1+2k2+2k3+k4=1+16(0-212-218-34)=0.6667

Therefore ϕ2=0.6667.

 

Since 1-0.6667=0.3333>0.001

3Step 3: Find the other values

Apply the same procedure for h=0.5, and h=0.25 respectively.

 ϕ2=0.700799

 

Thus, 0.6667-0.7008=0.0341>0.001

ϕ2=0.701385

 

Hence, 0.6667-0.7014=0.0006<0.001

 

So,  ϕ2=0.7014 .

 

Hence the solution is ϕ(2)=0.7014