0% found this document useful (0 votes)
971 views

Milnes Method Matlab Code

The document describes Milne's Predictor-Corrector Method for numerically solving differential equations. It provides an example of using the method to compute y(0.8) given an initial value problem and data points for y at x=0, 0.2, 0.4, and 0.6. It then gives two exercises asking to use Milne's Method to find the value of y at a specified x value.

Uploaded by

Ananth Prabhu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
971 views

Milnes Method Matlab Code

The document describes Milne's Predictor-Corrector Method for numerically solving differential equations. It provides an example of using the method to compute y(0.8) given an initial value problem and data points for y at x=0, 0.2, 0.4, and 0.6. It then gives two exercises asking to use Milne's Method to find the value of y at a specified x value.

Uploaded by

Ananth Prabhu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Milne's Predictor and Corrector Method

Example 1: Given that and the data y(0)=0, y(0.2)=0.02, y(0.4)=0.0795, y(0.6)=0.1762. Compute y

at x=0.8

clc; clear;
syms f1(x,y) x y
f1(x,y)=x-y^2

f1(x, y) =

x=input("Enter the values of x")

x = 1×4
0 0.2000 0.4000 0.6000

y=input("Enter the corresponding values of y")

y = 1×4
0 0.0200 0.0795 0.1762

xn=input("Enter the value of x")

xn = 0.8000

h=x(2)-x(1)

h = 0.2000

z=double(f1(x,y))

z = 1×4
0 0.1996 0.3937 0.5690

y4_p=y(1)+4*h/3*(2*z(2)-z(3)+2*z(4))

y4_p = 0.3049

z4=double(f1(xn,y4_p))

z4 = 0.7070

y4_c=y(3)+h/3*(z(3)+4*z(4)+z4)

y4_c = 0.3046

z4=double(f1(xn,y4_c))

z4 = 0.7072

y4_c=y(3)+h/3*(z(3)+4*z(4)+z4)

y4_c = 0.3046

Exercise:

1
1. Apply Milne's method to compute y(1.4) given and the following data y(1)=2, y(1.1)=2.2156,

y(1.2)=2.4649, y(1.3)=2.7514

Ans: 3.0794

2. If , y(0)=2, y(0.1)=2.010, y(0.2)=2.040 and y(0.3)=2.090 find y(0.4)

Ans: 2.1621

You might also like