C++ Program to Solve a Differential Equation by Modified Euler's Method - KhurafatiTech How to Tips-Tricks

Recent

Friday, January 12, 2018

C++ Program to Solve a Differential Equation by Modified Euler's Method

C++ Program to Solve a Differential Equation by Modified Euler's Methoddownload C++ source code file

This method is similar to Euler's method , except here we use the average of slopes instead of one.

x is calculate like the earlier method  and
 y1 = y0 + h*f(x0,y0)

y2 = y1 +  h*(f(x0,y0)+f(x1,y1))/2

y3 = y2 +  h*(f(x1,y1)+f(x2,y2))/2

.
.
.
.
yn+1 = yn +  h*(f(xn,yn)+f(xn+1,yn+1))/2
and so on...

No comments: