Finite Difference Method
This chapter will introduce one of the most straightforward numerical simulation methods: the finite difference method. We will show how to approximate derivatives using finite differences and discretize the equation and computational domain based on that. The discretization will be discussed for spatial and temporal derivatives sequentially. Then the treatment of the boundary and initial conditions will be explained with an example. A brief introduction to the error analysis in the finite difference method will also be provided. Most of the above introductions will be made in 2D. Therefore, the extension from 2D to 3D will be discussed to bridge the knowledge gap. In the final, MATLAB code for implementing the example in the boundary and initial condition section will be attached.