Friday, 25 January 2019

Numerical solution of singularly perturbed ODE


The sigulary perturbed ODEs are solved using the method of finite differences, using the formula for first and second derivative as:
$$y' = \frac{y(x+h) - y(x-h)}{2h}, \\ y'' = \frac{y(x+h) - 2y(x) + y(x-h)}{h^2} $$
respectively. Using the boundary conditions, then, a system of equations are formed which are solved by matrix method (alternatively they can be solved using Guass elimination as well), using the numpy library of python.


As you'll see in the final solution, as the perturbation parameter (e) is reduced, we get oscillations near the boundary. This implies that the solution is inconsistent near the boundary. The reason is our approach of taking constant step size (h) for the complete range. Below is the modified code using Shishkin mesh, which is a method of adatptive step size. As you'll see, that this approach jettisons the dependence of solution on the perturbation parameter (e) and hence the oscillations are removed.

Numerical solution of singularly perturbed ODE

The sigulary perturbed ODEs are solved using the method of finite differences, using the formula for first and second derivative as: $...