The M-equation
Here is a short Python code for solving the M-equation, described in section 20.6 of AOFD (2nd edition). The equation solved is
$$
W {\partial^3 W \over \partial z^3} = \kappa \frac{\partial^4 W}{\partial z^4}
$$
with configurable boundary conditions.
The code will allow you to reproduce Figs 20.12 and 20.13 of AOFD (2nd edition), or the corresponding figures in the first edition.
For the record, the figures in the book were obtained with an old Fortran code that solved the equations 'by hand' -- first differencing them and then solving them iteratively. The Python code uses the scipy function solve_bvp, and so is much shorter and less explicit. The code is not especially well documented; however, it is simple enough to read. You can run it as is with Python 2 or 3 and it should 'just work' and produce a plot.
Code: click to download
Code: click to view
Sample PDF output: click to view
Sample PDF output: click to download