O'Reilly logo

GNU Octave by Jesper Schmidt Hansen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Finite differencing

The first step in our numerical implementation of the solver is to discretize the spatial coordinates into grid points (or nodes). The one-dimensional case is shown in the figure below, where the x coordinate is discretized into Ngrid grid points:

Finite differencing

If the distance between the grid points Δ x is constant, it can easily be seen that it is given by L/(Ngrid – 1). With this arrangement, the second order derivative of ϕ at x = x0 can then be approximated by an algebraic equation:

Finite differencing

(6.9)

where i is then the grid point located at x0. This ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required