Skip to content

This program implements three approximation methods for building a chart of differential equation. Methods: Euler, Improved Euler, Runge-Kutta

Notifications You must be signed in to change notification settings

BeardedWhale/Approximation-methods-for-differential-equations

Repository files navigation

Approximation-methods-for-differential-equations

This program implements three approximation methods for building a chart of differential equation. Methods: Euler, Improved Euler, Runge-Kutta

Implemented for : y' = cosx - y; x0 = 1; y(x0) = 1; [1;9,5]

Building function using:

For Euler method: yi+1 = yi + hf(xi, yi) where f(x,y) = y' For Improved Euler: yi+1 = yi + 0.5h(f(xi, yi) + f(xi+1, yi + hf(xi, yi))) For Runge-Kutta method: k1i = f(xi, yi); k2i = f(xi + h/2 , yi + h/2k1i); k3i = f(xi + h/2 , yi + h/2k2i); k4i = f(xi+h, yi +hk3i); yi=yi-1 + h*(k1i + 2k2i + 2k3i + k4i)/6;

Function chart screenshot

Error chart example:

Error chart screenshot

Trauncation error chart screenshot:

Truncation error chart

About

This program implements three approximation methods for building a chart of differential equation. Methods: Euler, Improved Euler, Runge-Kutta

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published