Fortran Programming
Numerical Methods
- Bisection Method
- Regula Falsi (False Position)
- Newton Raphson Method
- Secant method
- Newton Raphson – Non-Linear Equations
- Gauss Elimination Method
- Gauss Elimination Method (With Pivoting)
- Gauss Jordan Method
- Gauss Elimination – Determinant
- Gauss Jordan – Inverse Matrix
- Lagrange Interpolation
- Newton Divided Interpolation
- Newton Forward Interpolation
- Least Square Fitting
- Trapezoidal Rule
- Simpson 1/3rd Rule
- Simpson 3/8 Rule
- Euler’s Method
- Euler’s Modified Method
- Runge Kutta’s (2nd Order)
- Runge Kutta’s (4th Order)
Runge Kutta’s (4th Order) Method Fortran
Fortran Code
PROGRAM runge_fourth IMPLICIT NONE REAL::x0=1,y0=2.3,x,x1,y1,k1,k2,k3,k4,k,f,h x1=x0 y1=y0 PRINT *,'====================================================' PRINT *,"Program for Runge Kutta’s 4th order method [www.BottomScience.com]" PRINT *,'====================================================' PRINT *,'Step size (h)?' READ(*,*)h PRINT *,'value?' READ(*,*)x PRINT *,x1,y1 DO WHILE (x1<x) k1=h*f(x1,y1) k2=h*f(x1+(h/2),y1+(k1/2)) k3=h*f(x1+(h/2),y1+(k2/2)) k4=h*f(x1+h,y1+k3) k=(1/6.)*(k1+(2*k2)+(2*k3)+k4) y1=y1+k PRINT *,x1+h,y1 x1=x1+h END DO END PROGRAM REAL function f(x1,y1) REAL::x1,y1 f=(x1**2)+(y1**2) return end function
See Also | More Fortran Programs
References: