library.pde Submodule

Module Summary

Interfaces for the NAG Mark 28.5 pde Chapter.

pde - Partial Differential Equations

This module is concerned with the numerical solution of partial differential equations.

See Also

naginterfaces.library.examples.pde :

This subpackage contains examples for the pde module. See also the Examples subsection.

Functionality Index

Automatic mesh generation

triangles over a plane domain: dim2_triangulate()

Black–Scholes equation

Convection-diffusion system(s)


one space dimension

using upwind difference scheme based on Riemann solvers: dim1_parab_convdiff()

Elliptic equations

discretization on rectangular grid (seven-point two-dimensional molecule): dim2_ellip_discret()

equations on rectangular grid (seven-point two-dimensional molecule): dim2_ellip_mgrid()

finite difference equations (five-point two-dimensional molecule): dim2_ellip_fd()

finite difference equations (seven-point three-dimensional molecule): dim3_ellip_fd()

Helmholtz’s equation in three dimensions: dim3_ellip_helmholtz()

Laplace’s equation in two dimensions: dim2_laplace()

First-order system(s)


one space dimension

using Keller box scheme: dim1_parab_keller()

PDEs, general system, one space variable, method of lines


collocation spatial discretization

coupled DAEs, comprehensive: dim1_parab_dae_coll()

easy-to-use: dim1_parab_coll()

finite differences spatial discretization

coupled DAEs, comprehensive: dim1_parab_dae_fd()

coupled DAEs, remeshing, comprehensive: dim1_parab_remesh_fd()

easy-to-use: dim1_parab_fd()

Second order system(s)


two space dimensions

in rectangular domain: dim2_gen_order2_rectangle()

in rectilinear domain: dim2_gen_order2_rectilinear()

Utility function

average values for dim1_blackscholes_closed(): dim1_blackscholes_means()

basic SIP for five-point two-dimensional molecule: dim2_ellip_fd_iter()

basic SIP for seven-point three-dimensional molecule: dim3_ellip_fd_iter()

exact Riemann solver for Euler equations: dim1_parab_euler_exact()

HLL Riemann solver for Euler equations: dim1_parab_euler_hll()

interpolation function for collocation scheme: dim1_parab_coll_interp()

interpolation function for finite difference

Keller box and upwind scheme: dim1_parab_fd_interp()

Osher’s Riemann solver for Euler equations: dim1_parab_euler_osher()

return coordinates of grid points for dim2_gen_order2_rectilinear(): dim2_gen_order2_rectilinear_extractgrid()

Roe’s Riemann solver for Euler equations: dim1_parab_euler_roe()

For full information please refer to the NAG Library document



Example for naginterfaces.library.pde.dim2_gen_order2_rectangle().

General system of second-order PDEs, method of lines, finite differences, remeshing, two space variables, rectangular region.

>>> main()
naginterfaces.library.pde.dim2_gen_order2_rectangle Python Example Results.
Solve a predator-prey problem.
Solution at every 2nd grid point in level 3 at time   0.0250:
       x          y         approx c1    approx c2
   1.000e+00   1.000e+00    1.132e+02    1.132e+06