Home > Numerical methods calculators > Numerical differential equation using Milne's simpson predictor corrector methodexample

2. Milne's simpson predictor corrector method example ( Enter your problem )
  1. Formula & Example-1 `y'=(x+y)/2` (table data)
  2. Example `y'=y-x^3`, Initial value by rk4
  3. Example `y'=x-y^2`, Initial value by rk4
Other related methods
  1. Adams bashforth predictor method
  2. Milne's simpson predictor corrector method

2. Example `y'=y-x^3`, Initial value by rk4
(Previous example)

3. Example `y'=x-y^2`, Initial value by rk4





2. `y'=x-y^2, y(0)=1`. Find y(1.0) by Milne's simpson predictor corrector method
Step value (h) = 0.2
Initial values by Runge-Kutta 4 method


Solution:
`y'=x-y^2`

Milne's simpson predictor formula is
`y_(n+1,p) = y_(n-3) + (4h)/3 (2y'_(n-2) - y'_(n-1)+ 2y'_(n))`

putting `n=3`, we get

`y_(4,p)=y_0 + (4h)/3 (2y'_1 - y'_2 + 2y'_3) ->(2)`

We have given that
`x_0=0,x_1=0.2,x_2=0.4,x_3=0.6`

Initial values using runge kutta 4 method, we get
`y_0=1,y_1=0.8512,y_2=0.7798,y_3=0.7621`


Given `y'=x-y^2, y(0)=1, h=0.2, y(0.6)=?`

Forth order R-K method
`k_1=hf(x_0,y_0)=(0.2)f(0,1)=(0.2)*(-1)=-0.2`

`k_2=hf(x_0+h/2,y_0+k_1/2)=(0.2)f(0.1,0.9)=(0.2)*(-0.71)=-0.142`

`k_3=hf(x_0+h/2,y_0+k_2/2)=(0.2)f(0.1,0.929)=(0.2)*(-0.763)=-0.1526`

`k_4=hf(x_0+h,y_0+k_3)=(0.2)f(0.2,0.8474)=(0.2)*(-0.5181)=-0.1036`

`y_1=y_0+1/6(k_1+2k_2+2k_3+k_4)`

`y_1=1+1/6[-0.2+2(-0.142)+2(-0.1526)+(-0.1036)]`

`y_1=0.8512`

`:.y(0.2)=0.8512`


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.2)f(0.2,0.8512)=(0.2)*(-0.5245)=-0.1049`

`k_2=hf(x_1+h/2,y_1+k_1/2)=(0.2)f(0.3,0.7987)=(0.2)*(-0.338)=-0.0676`

`k_3=hf(x_1+h/2,y_1+k_2/2)=(0.2)f(0.3,0.8174)=(0.2)*(-0.3681)=-0.0736`

`k_4=hf(x_1+h,y_1+k_3)=(0.2)f(0.4,0.7776)=(0.2)*(-0.2046)=-0.0409`

`y_2=y_1+1/6(k_1+2k_2+2k_3+k_4)`

`y_2=0.8512+1/6[-0.1049+2(-0.0676)+2(-0.0736)+(-0.0409)]`

`y_2=0.7798`

`:.y(0.4)=0.7798`


Again taking `(x_2,y_2)` in place of `(x_0,y_0)` and repeat the process

`k_1=hf(x_2,y_2)=(0.2)f(0.4,0.7798)=(0.2)*(-0.2081)=-0.0416`

`k_2=hf(x_2+h/2,y_2+k_1/2)=(0.2)f(0.5,0.759)=(0.2)*(-0.0761)=-0.0152`

`k_3=hf(x_2+h/2,y_2+k_2/2)=(0.2)f(0.5,0.7722)=(0.2)*(-0.0963)=-0.0193`

`k_4=hf(x_2+h,y_2+k_3)=(0.2)f(0.6,0.7606)=(0.2)*(0.0216)=0.0043`

`y_3=y_2+1/6(k_1+2k_2+2k_3+k_4)`

`y_3=0.7798+1/6[-0.0416+2(-0.0152)+2(-0.0193)+(0.0043)]`

`y_3=0.7621`

`:.y(0.6)=0.7621`


`:.y(0.6)=0.7621`


`y'=x-y^2`

`y'_1=x-y^2=-0.5245` (where `x=0.2,y=0.8512`)

`y'_2=x-y^2=-0.2081` (where `x=0.4,y=0.7798`)

`y'_3=x-y^2=0.0192` (where `x=0.6,y=0.7621`)


Iteration-1 (for `x_(4)=0.8`)

`y_(4,p)=y_0 + (4h)/3 (2y'_1 - y'_2 + 2y'_3)`

`y_(4,p)=1 + (4*0.2)/3 * (2 * (-0.5245) - (-0.2081) + 2 * 0.0192)`

`y_(4,p)=1 + (0.8)/3 * (-1.0491 +0.2081 +0.0384)`

`y_(4,p)=1 + (0.8)/3 * (-0.8026)`

`y_(4,p)=1 -0.214`

`y_(4,p)=0.786`

So, the predicted value is `0.786`

Now, we will correct it by corrector method to get the final value
`y'_4=x-y^2=0.1822` (where `x=0.8,y=0.786`)

Milne's simpson corrector formula is
`y_(n+1,c) = y_(n-1) + h/3 (y'_(n-1) + 4y'_(n) + y'_(n+1))`

putting `n=3`, we get

`y_(4,c) = y_2 + h/3 (y'_2 + 4y'_3 + y'_4)`

`y_(4,c) = 0.7798 + 0.2/3 * (-0.2081 + 4 * 0.0192 + 0.1822)`

`y_(4,c) = 0.7798 + 0.2/3 * (-0.2081 +0.0768 +0.1822)`

`y_(4,c) = 0.7798 + 0.2/3 * (0.0509)`

`y_(4,c) = 0.7798 +0.0034`

`y_4=0.7832`

`y'_4=x-y^2=0.1866` (where `x=0.8,y=0.7832`)

`y_(4,c) = y_2 + h/3 (y'_2 + 4y'_3 + y'_4)`

`y_(4,c) = 0.7798 + 0.2/3 * (-0.2081 + 4 * 0.0192 + 0.1866)`

`y_(4,c) = 0.7798 + 0.2/3 * (-0.2081 +0.0768 +0.1866)`

`y_(4,c) = 0.7798 + 0.2/3 * (0.0553)`

`y_(4,c) = 0.7798 +0.0037`

`y_4=0.7835`


Iteration-2 (for `x_(5)=1`)

`y_(5,p)=y_1 + (4h)/3 (2y'_2 - y'_3 + 2y'_4)`

`y_(5,p)=0.8512 + (4*0.2)/3 * (2 * (-0.2081) - 0.0192 + 2 * 0.1866)`

`y_(5,p)=0.8512 + (0.8)/3 * (-0.4162 -0.0192 +0.3732)`

`y_(5,p)=0.8512 + (0.8)/3 * (-0.0623)`

`y_(5,p)=0.8512 -0.0166`

`y_(5,p)=0.8346`

So, the predicted value is `0.8346`

Now, we will correct it by corrector method to get the final value
`y'_5=x-y^2=0.3035` (where `x=1,y=0.8346`)

Milne's simpson corrector formula is
`y_(n+1,c) = y_(n-1) + h/3 (y'_(n-1) + 4y'_(n) + y'_(n+1))`

putting `n=4`, we get

`y_(5,c) = y_3 + h/3 (y'_3 + 4y'_4 + y'_5)`

`y_(5,c) = 0.7621 + 0.2/3 * (0.0192 + 4 * 0.1866 + 0.3035)`

`y_(5,c) = 0.7621 + 0.2/3 * (0.0192 +0.7463 +0.3035)`

`y_(5,c) = 0.7621 + 0.2/3 * (1.069)`

`y_(5,c) = 0.7621 +0.0713`

`y_5=0.8334`

`y'_5=x-y^2=0.3055` (where `x=1,y=0.8334`)

`y_(5,c) = y_3 + h/3 (y'_3 + 4y'_4 + y'_5)`

`y_(5,c) = 0.7621 + 0.2/3 * (0.0192 + 4 * 0.1866 + 0.3055)`

`y_(5,c) = 0.7621 + 0.2/3 * (0.0192 +0.7463 +0.3055)`

`y_(5,c) = 0.7621 + 0.2/3 * (1.071)`

`y_(5,c) = 0.7621 +0.0714`

`y_5=0.8335`

`:.y(1) = 0.8335`




This material is intended as a summary. Use your textbook for detail explanation.
Any bug, improvement, feedback then Submit Here



2. Example `y'=y-x^3`, Initial value by rk4
(Previous example)





Share this solution or page with your friends.


 
Copyright © 2023. All rights reserved. Terms, Privacy
 
 

.