World's most popular travel blog for travel bloggers.

# Solving second-order ODEs with Taylor series approximation of second derivative and linear algebra

, ,
Problem Detail:

I was told about an algorithm to solve ODEs which I thought was very clever. I am sure its not something new. It works by discarding the $\mathcal{O}(h^2)$-term from the usual formula for computing the second derivative:

$$f''_i = \frac{f_{i-1} + f_{i+1} - 2f_{i}}{h^2} + \mathcal{O}(h^2), \qquad i = 0,1,2,\cdots,N$$

one can rewrite the equations for the derivatives for all $i$, as a set of linear equations, then use smart Gauss elimination from linear algebra to find expression for $f$ with exactly $5N$ floating point operations.

(1) Does this method already have a name?

(2) Should I be excited about this algorithm? Is this a particularly good method? Or are there other very different algorithms for solving ODEs which are much better?

###### Asked By : Marius Jonsson

This is essentially the (implicit) Finite Difference Method. There are different variations based on the discretization (implicit, explicit, Crank-Nicolson, leap-frog, etc). Some better than others. For the implicit approach, you can use Thomas Algorithm (modified Gaussian elimination) to solve the tridiagonal system. But you can also use Cyclic Reduction (or one of its variations) which allows you to solve the system in parallel on GPUs and clusters. Much much larger solvers rely on Krylov subspace methods. There are other ODE/PDE solves like Method of Lines, Finite Element Method, and many many others that you'd encounter in a good text on Numerical Analysis (e.g., Kincaid, Cheney).