The finite-difference method is a straightforward and effective numerical technique for solving ordinary and partial differential equations. A continuous system, described by differential equations, is discretized and transformed into a set of linear algebraic equations, and the solution to a continuous system is expressed at discrete values with a set accuracy level.