0% found this document useful (0 votes)
87 views1 page

Flowchart for Modified Euler's Method

This document contains a flowchart for solving an ordinary differential equation using the modified Euler's method. It prompts the user to input the initial values of x and y, the end value of x, and the desired accuracy. It then iterates from the initial to final x values, calculating intermediate y values using the modified Euler's method formula until the change in y is less than the accuracy threshold. Finally, it prints the final calculated y value.

Uploaded by

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

Flowchart for Modified Euler's Method

This document contains a flowchart for solving an ordinary differential equation using the modified Euler's method. It prompts the user to input the initial values of x and y, the end value of x, and the desired accuracy. It then iterates from the initial to final x values, calculating intermediate y values using the modified Euler's method formula until the change in y is less than the accuracy threshold. Finally, it prints the final calculated y value.

Uploaded by

NAGAR CART
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

ASSINGNMENT NO.

Batch- T2

FLOWCHART FOR ORDINARY DIFFERENTIAL EQUATION BY


MODIFIED EULER’S METHOD

f=inline('(x*x+y)');
x0=input('Enter the value of x0=');
y0=input('Enter the value of y0=');
xn=input('Enter the value of xn=');
acc=input('Enter the desired accuracy=');
n=2;
h=((xn-x0)/n);
for i=1:n
y1=y0+h*f(x0,y0);
y11=y0+(h/2)*(f(x0,y0)+f((x0+h),y1));
while(abs(y11-y1)>acc)
y1=y11;
y11=y0+(h/2)*(f(x0,y0)+f((x0+h),y1));
end
x0=x0+h;
y0=y11;
end
fprintf('The final value of yn=%f',y11);

PROGRAM OUTPUT

Enter the value of x0=0


Enter the value of y0=1
Enter the value of xn=0.1
Enter the desired accuracy=0.0001
The final value of yn=1.105580>>

You might also like