/Numerical_Analysis

My personal MATLAB toolbox for numerical analysis

Primary LanguageMATLABMIT LicenseMIT

Numerical Analysis

  • My personal MATLAB toolbox for numerical analysis
  • May. 12, 2021 ~ Present

1. Numerical solution of first order ODEs

Forward Euler Method - Explicit | Code

yi+1 = yi + f(ti, yi)Δt + O(Δt2)

  • It uses the slope at each point to exgtrapolate and find the next point
  • O(Δt2)

Backward Euler Method - Implicit

yi+1 = yi + f(ti+1, yi+1)Δt + O(Δt2)

  • O(Δt2)

Midpoint Method

yi+1 = yi-1 + 2f(ti, yi)Δt + O(Δt3)

  • Symmetric method using Taylor expansion that involves only odd powers of Δt
  • O(Δt3) -> More accurate
    -> but require special initialization

Reference

[1] Bergara, A. "Finite Difference Numerical Methods of Partial Differential Equations in Finance with MATLAB." Master and Banca (2011).