C++ Program to Solve a Differential Equation by Euler's Method (Solution of Differential Equations by Initial Values) - KhurafatiTech How to Tips-Tricks

Recent

Thursday, September 20, 2018

C++ Program to Solve a Differential Equation by Euler's Method (Solution of Differential Equations by Initial Values)


C++ Program to Solve a Differential Equation by Euler's Method (Solution of Differential Equations by Initial Values) 
download C++ source code file
dy/dx is denoted as f(x,y), x0, y0 is given or the initial values of x and y are given then we can calculate f(x,y) at these points and can calculate the next points,
x1 = x0+h (step size)
 y1 = y0+h*f(x0,y0)


x2 = x0+2*h
 y2 = y1+h*f(x1,y1)
.
.
.
.
yn+1 = yn+h*f(xn,yn)

No comments: