Simple programs
# Quadratic equation ax^2 + bx + c = 0
# Fibonacci numbers
# Legendre polynomials Pn(x)
Real roots of non-linear equations
# Bisectional method Bisection.f90
# Closed Domain (Bisectional or False position selected by a key) CDomain.f90
# Open Domain: Newton's method Newton1.f90
# Open Domain: The method of secants Secant.f90
# Brute force method for multiple roots BForce.f90
# Solutions of a system of two nonlinear equations f(x,y) = 0, g(x,y) = 0 Newton2.f90
Integration of a single variable function f(x)
# Simpson rule on n intervals (simpson.f90)
# Integration based based on Gauss 8 points or 16 points (gauss.f90)
# Automatic adaptive integration based on Simpson rule (simpson2.f90)
# Automatic adaptive integration based on Gauss quaratures (gauss2.f90)
# Automatic adaptive integration - Gauss quaratures + recursive calls (gaussA.f90)
# Trapezoid approximation for n intervals (int_trap.f)
# Automatic adaptive integration - Newton-Cotes quadrature (program quanc8.f)
# Three adaptive integrations in one place: (program Integral3A.f90)
# Driver program for int_trap.f, quanc8.f
Integration of a function of two variables f(x,y)
# Integration of a function f(x,y) using cubature trapezoid rule (trap_2Dc.f90)
# Automatic adaptive Integration of a function f(x,y) using Simpson rule (simpson2D.f90)
Interpolation (single variable)
# Polinomial (Lagrange) interpolation Lagint.f90
# Polinomial (Divided differences) interpolation DDint.f90
# Spline interpolation Spline.f90
Differentiation (single variable)
# Divided differences for equally spaced points (deriv_dd.f90)
# Derivative calculated on three-point Lagrange interpolation (deriv_Lg.f90)
Ordinary differential equations (initial value problem)
# First-oder single ODE: Euler, Predictor-Corrector, Runge-Kutta 4th order (Ode11.f90)
# Second-order singel ODE: Predictor-Corrector, Runge-Kutta 4th order (Ode12.f90)
# System of N first-oder or N/2 second-order ODEs: Runge-Kutta 4th order (Rk4n.f90) with examples for a projectile motion in the (x,y) plane and the predator-prey model with rabbits and foxes (Lotka-Volterra model)
Ordinary differential equations (boundary value problem)
# Second-order singel ODE: The shooting method (shoot2.f90)
Random numbers
# Random number generator based on Linear Congruent Method (random1.f)
# Driver program (random2.f) for two random number generator, i.e. rand and urand.f
# Integration using Monte-Carlo method (int_rand.f) (should be compiled with urand.f)
# N-dimension integration: example of 5-dimension integration (int_rand2.f)
Minimum of a single variable function f(x)
# Golden section search with parabolic interpolation (fmin.f)
# Driver program for fmin.f
Systems of linear equations
# Simple Gaussian elimination Gauss_1.f90
# Gaussian elimination with scaling and pivoting Gauss_2.f90
# Evaluate the condition number of matrix: C(A) = norm(A*A^{-1}) C_number.f90
# The successive-over-relaxation (SOR) GS_sor.f90
# Inverse matrix: Method - Doolittle LU factorization for Ax=b Inverse.f90
# A system of tridiagonal linear equations C*x=b (the Thomas method) Thomas.f90
# Gaussian elimination with pivoting and a condition number (decom.f)
Eigenvalue problem
# Eigenvalues and eigenvectors of a real symmetric matrix Jacobi.f90
# Evaluate the largest eigenvalue by the power method Power.f90
# Eigenvalues of real symmetric matrix by the basic QR method QRbasic.f90
# Eigenvalues and eigenvectors of a general matrix Geigen.f
Physics programs:
Projectile motion with air resustance (proj02a.f). The program can run calculations in one of the following methods: modified Euler, Runge-Kutta 4th order, and Fehlberg fourth-fifth order Runge-Kutta method. To run the code following programs should be included: euler22m.f, rk4_d22.f, rkf45.f. All initial data are in the file cannon.ini.
Random walk in 2D: The program rwalk01.f90 computes three cases 1) Simple random walk 2) Random walk in 2D city (n*n blocks) 3) Random walk in 2D city with a trap
Synchronized random walks: (see the description of the problem in project 3, problem 3)
The program rwalk5.f calculates the mean time when both walkers are at the same site)
2D Polymer simulation: random walk models that corresponds to the self-avoiding walk (SAW). This model consists of the set of all N-step walks starting from the origin subject to the global constrain that no lattice site can be visited more than once in each walk: rwalk4.f
The gambler's ruin problem: gamble.f
Motion of a planet around a star: planet1.for with initial data planet1.ini
1D Schrodinger ODE y"(x)+2[E-V(x)]y(x)=0 (energies and wavefunctions) numerov.f90