Find y(0.5) for `y'=-2x-y`, `x_0=0, y_0=-1`, with step length 0.1 using Runge-Kutta 3 method (1st order derivative) Solution:Given `y'=-2x-y, y(0)=-1, h=0.1, y(0.5)=?`
Third order R-K method
`k_1=hf(x_0,y_0)=(0.1)f(0,-1)=(0.1)*(1)=0.1`
`k_2=hf(x_0+h/2,y_0+k_1/2)=(0.1)f(0.05,-0.95)=(0.1)*(0.85)=0.085`
`k_3=hf(x_0+h,y_0+2k_2-k_1)=(0.1)f(0.1,-0.93)=(0.1)*(0.73)=0.073`
`y_1=y_0+1/6(k_1+4k_2+k_3)`
`y_1=-1+1/6[0.1+4(0.085)+(0.073)]`
`y_1=-0.9145`
`:.y(0.1)=-0.9145`
Again taking `(x_1,y_1)` in place of `(x_0,y_0)` and repeat the process
`k_1=hf(x_1,y_1)=(0.1)f(0.1,-0.9145)=(0.1)*(0.7145)=0.0714`
`k_2=hf(x_1+h/2,y_1+k_1/2)=(0.1)f(0.15,-0.8788)=(0.1)*(0.5788)=0.0579`
`k_3=hf(x_1+h,y_1+2k_2-k_1)=(0.1)f(0.2,-0.8702)=(0.1)*(0.4702)=0.047`
`y_2=y_1+1/6(k_1+4k_2+k_3)`
`y_2=-0.9145+1/6[0.0714+4(0.0579)+(0.047)]`
`y_2=-0.8562`
`:.y(0.2)=-0.8562`
Again taking `(x_2,y_2)` in place of `(x_1,y_1)` and repeat the process
`k_1=hf(x_2,y_2)=(0.1)f(0.2,-0.8562)=(0.1)*(0.4562)=0.0456`
`k_2=hf(x_2+h/2,y_2+k_1/2)=(0.1)f(0.25,-0.8334)=(0.1)*(0.3334)=0.0333`
`k_3=hf(x_2+h,y_2+2k_2-k_1)=(0.1)f(0.3,-0.8351)=(0.1)*(0.2351)=0.0235`
`y_3=y_2+1/6(k_1+4k_2+k_3)`
`y_3=-0.8562+1/6[0.0456+4(0.0333)+(0.0235)]`
`y_3=-0.8224`
`:.y(0.3)=-0.8224`
Again taking `(x_3,y_3)` in place of `(x_2,y_2)` and repeat the process
`k_1=hf(x_3,y_3)=(0.1)f(0.3,-0.8224)=(0.1)*(0.2224)=0.0222`
`k_2=hf(x_3+h/2,y_3+k_1/2)=(0.1)f(0.35,-0.8113)=(0.1)*(0.1113)=0.0111`
`k_3=hf(x_3+h,y_3+2k_2-k_1)=(0.1)f(0.4,-0.8224)=(0.1)*(0.0224)=0.0022`
`y_4=y_3+1/6(k_1+4k_2+k_3)`
`y_4=-0.8224+1/6[0.0222+4(0.0111)+(0.0022)]`
`y_4=-0.8109`
`:.y(0.4)=-0.8109`
Again taking `(x_4,y_4)` in place of `(x_3,y_3)` and repeat the process
`k_1=hf(x_4,y_4)=(0.1)f(0.4,-0.8109)=(0.1)*(0.0109)=0.0011`
`k_2=hf(x_4+h/2,y_4+k_1/2)=(0.1)f(0.45,-0.8104)=(0.1)*(-0.0896)=-0.009`
`k_3=hf(x_4+h,y_4+2k_2-k_1)=(0.1)f(0.5,-0.8299)=(0.1)*(-0.1701)=-0.017`
`y_5=y_4+1/6(k_1+4k_2+k_3)`
`y_5=-0.8109+1/6[0.0011+4(-0.009)+(-0.017)]`
`y_5=-0.8196`
`:.y(0.5)=-0.8196`
`:.y(0.5)=-0.8196`
| `n` | `x_n` | `y_n` | `k_1` | `k_2` | `k_3` | `x_(n+1)` | `y_(n+1)` |
| 0 | 0 | -1 | 0.1 | 0.085 | 0.073 | 0.1 | -0.9145 |
| 1 | 0.1 | -0.9145 | 0.0714 | 0.0579 | 0.047 | 0.2 | -0.8562 |
| 2 | 0.2 | -0.8562 | 0.0456 | 0.0333 | 0.0235 | 0.3 | -0.8224 |
| 3 | 0.3 | -0.8224 | 0.0222 | 0.0111 | 0.0022 | 0.4 | -0.8109 |
| 4 | 0.4 | -0.8109 | 0.0011 | -0.009 | -0.017 | 0.5 | -0.8196 |
This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then