Numerical Methods Project
Methods in MATLAB | Python | R
Repository
You can view the complete project on GitHub: Numerical Methods in Python, R, and Matlab.
Interpolation
- Newton ( Matlab | Python | R )
- Lagrange ( Matlab | Python | R )
- Hermite ( Matlab | Python | R )
- Splines ( Matlab | Python | R )
Differentiation
- High precision differentiation: Taylor derivative order 1, 2 and 3 ( Matlab | Python | R )
- Richardson extrapolation ( Matlab | Python | R )
Single and Multiple Integration
Single:
- Equally spaced nodes, Newton-Cotes formulas:
- Closed methods:
- Simple trapezoidal method ( Matlab | Python | R )
- Composite trapezoidal method ( Matlab | Python | R )
- Simple Simpson's method ( Matlab | Python | R )
- Composite Simpson's method ( Matlab | Python | R )
- Open methods:
- Simple midpoint method ( Matlab | Python | R )
- Composite midpoint method ( Matlab | Python | R )
- Closed methods:
- Unequally spaced nodes, Gauss quadratures:
- Gauss-Legendre ( Python | R )
- Gauss-Hermite ( Python | R )
- Gauss-Chebyshev ( Python | R )
- Gauss-Laguerre ( Python | R )
Multiple:
- Equally spaced nodes:
- Trapezoidal method ( Python | R )
- Simpson's method ( Python | R )
- Unequally spaced nodes:
- Gauss-Legendre ( Python | R )
- Gauss-Hermite ( Python | R )
- Gauss-Chebyshev ( Python | R )
- Gauss-Laguerre ( Python | R )
Numerical Methods for ODEs:
Initial Value Problem (IVP)
We will solve initial value problems for first-order differential equations, systems of first-order differential equations, and higher-order differential equations.
- One-step methods:
- Explicit Euler ( Matlab | Python | R )
- Implicit Euler ( Matlab | Python | R )
- Heun ( Matlab | Python | R )
- Runge-Kutta ( Matlab | Python | R )
- Euler Systems ( Matlab | Python | R )
- Multistep methods:
- Adams-Bashforth (explicit method) ( Matlab | Python | R )
- Adams-Moulton (implicit method) ( Matlab | Python | R )
- Predictor-corrector ( Matlab | Python | R )
- Stiff problems:
- In Matlab, we use the ode15s function
- In Python, we can use the scipy library with the command scipy.integrate.ode(f).set_integrator('vode', method='bdf', order=15)
- In R, we can use the pracma library with the ode45 function
Boundary Value Problems (BVP)
- Linear shooting method with Dirichlet conditions
- Nonlinear shooting method with Dirichlet conditions:
- Shooting method with secant
- Shooting method with Newton
- Nonlinear shooting method with Natural conditions, which are variations of the shooting method with secant and Newton that depend on the proposed problem. Comments in the code indicate where changes might be made.
Systems of Linear Equations
- Direct methods:
To use direct methods to solve problems like Ax = b, we need A to be invertible. Additionally, the matrix dimension should not be too large.
Since we generally want to calculate matrices with large dimensions, we will develop iterative methods.
- Iterative methods:
- Jacobi method ( Matlab | Python | R )
- Gauss-Seidel method ( Matlab | Python | R )
- JSOR method ( Matlab | Python | R )
- SOR method ( Matlab | Python | R )
- Crout tridiagonals ( Matlab | Python | R )
Nonlinear Equations
We will use iterative methods, creating a script for Newton and another commented one where changes can be made to quickly modify the method to be used.
- Newton ( Matlab | Python | R )
- Jarrat ( Matlab )
Systems of Nonlinear Equations
We will use iterative methods, creating a script for Newton and another commented one where changes can be made to quickly modify the method to be used.
- Newton ( Matlab )
- Jarrat ( Matlab )
Polynomials
Functions that help us find the roots and coefficients necessary for Gauss quadratures.
- Legendre ( Python | R )
- Chebyshev ( Python | R )
- Laguerre ( Python | R )
- Hermite ( Python | R )