Examples
The pdesol Demo Version includes several
application example files illustrating some of major pdesol capabilities. These files are
installed during the pdesol installation procedure, and contain the problem statements and
solutions. When you open a sample file, you can read both the problem statement and the
solution, or skip the latter. In either case, you can rerun the problems and generate new
solutions with the same or different general parameters.
List of Example Problems
| advec.pde |
Advection Problem [3.5 sec] |
| b&s.pde |
Black-Scholes Model for an American Put Option
[0.1 sec] |
| burgers.pde |
One-dimensional Burgers' Equation [48 sec] |
| CO2.pde |
Seven-Reservoir World Carbon Dioxide model [1.5 sec] |
| coolint.pde |
Cooldown of a Superconducting Magnet [0.1 sec] |
| curve.pde |
3D Chart Illustration [0.1 sec] |
| davidnko.pde |
Davidenko's Method for Nonlinear Algebraic Equations [0.3 sec] |
| fourierc.pde |
Fourier Second Law in Cylindrical Coordinates [18 sec] |
| glucose.pde |
Pancreatic Response to Glucose Infusion [0.1 sec] |
| humidcol.pde |
PI Control of a Packed Humidification Column [1.4 sec] |
| kdv.pde |
Korteweg-de Vries Equation [170 sec] |
| kdvpuls.pde |
Korteweg-de Vries Equation with Two-Pulse Init. Cond.[240 sec] |
| multireg.pde |
Diffusion in Two Regions [4.8 sec] |
| numerint.pde |
Numerical Integration Example [0.01sec] |
| river.pde |
River Pollution Model w/Point Source [1.8 sec] |
| schrodgr.pde |
Cubic Schrodinger Equation [260 sec] |
| steepdes.pde |
Steepest Descent Method for Nonlinear Algebraic Eq. [3.1 sec] |
| stiffsys.pde |
A Very Stiff ODE System Example [0.3 sec] |
| wave.pde |
One-dimensional Wave Equation [2.1 sec] |
| 4thordr1.pde |
Fourth-order PDE - Dirichlet BC [0.4 sec] |
| 4thordr2.pde |
Fourth-order PDE - Neumann BC [40 sec] |
[The numbers in brackets are approximate run-times obtained on a Pentium 166 MHz
machine with 32 MB RAM.]
Brief Descriptions of Sample Problems
The sample problems are briefly described below. The problem statements include
explanatory comments and notes; many of the features illustrated by these problems are
also discussed in detail in the on-line help/tutorial file.
advec.pde: Advection Problem
This is an example of a first-order convective (hyperbolic) PDE. The equation
solved is the advection equation:
Ut + v Ux = 0
The solutions obtained show the propagation of a finite discontinuity
(step change) along x. Two equations are solved simultaneously to illustrate the
differences between centered and upwind approximations
for the convective (dU/dx) terms.
b&s.pde: Black-Scholes Model for an American Put Option
This example involves derivative security pricing using the Black-Scholes model given by:
Ut = -rx Ux - ½ (sx)^2 Uxx + r U
Specifically, it is used to value a 5-month American put option on a non-dividend paying
stock. The Black-Scholes equation is solved starting at zero time to maturity and marching
to "present" (5 months to maturity).
burgers.pde: One-dimensional Burgers' Equation
This is a standard test problem for PDE numerical methods, with known analytical
solutions. The equation is of the hyperbolic-parabolic type:
Ut = -U Ux + vis Uxx
For small values of 'vis', the Burgers' equation is strongly hyperbolic, and the solutions
can exhibit steep moving fronts which are difficult to resolve numerically. This example
presents solutions for a case of Burgers' equation (vis = 0.003) with ront sharpening as
time progresses.
CO2.pde: Seven-Reservoir World Carbon Dioxide Model
This model treats the carbon dioxide distribution problem in terms of up to seven
well-mixed reservoirs. The modified EULER scheme is used to integrate the ODE system.
coolint.pde: Cooldown of a Superconducting Magnet
This example illustrates the use of tabular input. The specific heat of iron is given in
tabular form as a function of temperature.
davidnko.pde: Davidenko's Method for Nonlinear Algebraic Equations
This illustrates application of an ODE integrator to solve nonlinear algebraic and
transcendental equations. Davidenko's method, which is a differential form of Newton's
method, is used to solve a 2x2 nonlinear algebraic system.
fourierc.pde: Fourier Second Law in Cylindrical Coordinates
This is an example of a parabolic PDE of the form:
Tt = Trr + (1/r) Tr
governing diffusion in cylindrical geometry. For a solid cylinder, the term "(1/r)
Tr" is indeterminant at r = 0. l'Hospital's rule is used to evaluate this
indeterminant form. The problem statement shows how the "divide by zero" at r =
0 can be avoided in pdesol (through the use of the "greater than" ("x >
0") construct) and how the proper value for the time derivative is specified at r =
0.
glucose.pde: Pancreatic Response to Glucose Infusion
This considers a mathematical model for the response of the human pancreas to an infusion
of glucose (glucose tolerance test). Input variables can be varied to observe responses
ranging from hypoglycemic to hyperglycemic. The Step function and the ">"
operator are used to express ODEs for the different application regions of the dependent
variables.
humidcol.pde: PI Control of a Packed Humidifcation Column
This is a dynamic simulation of a packed humidification column with a PI controller. The
integral controller equation is replaced by a differential equation for the error
integral, resulting a mixed ODE/PDE system. Constraints on the variables are effected
through "<" and ">" operators.
kdv.pde: Korteweg-de Vries Equation
This is a classical nonlinear PDE of the form:
Ut + 6 U Ux + Uxxx = 0
which balances front sharpening and dispersion to produce solitons, i.e. traveling waves
that do no change shape or speed. It was originally formulated to model shallow water
flow. A special third-order derivative routine is used to evaluate the dispersion term
(Uxxx) without the need for boundary conditions, as long as the computed solitons do not
closely approach the finite boundaries that are used in place of the infinite boundaries.
kdvpuls.pde: Korteweg-de Vries Equation with Two-Pulse Initial Condition
This is the same problem as above, but with a two-pulse initial condition. The pulses have
different amplitudes and speeds. As the solution progresses, the faster pulse catches up
and merges with the slower pulse. The two original pulses eventually reappear, and
continue to travel in their original shape.
multireg.pde: Diffusion in Two Regions
This is an example of how pdesol can be applied solve a system of PDEs defined over
different spatial regions or domains. Such problems arise frequently in scientific and
engineering applications. This example considers diffusion of a concentration of a
substance in two regions; diffusion can take place across the interface between the two
regions. One of the regions is mapped onto the other in order to solve the system of
equations over the same spatial domain using pdesol.
numerint.pde: Numerical Integration Example
This is another unconventional application of an ODE integrator to evaluate
one-dimensional integrals. In this example, the error function integral is evaluated by
integrating an equivalent ODE with an initial condition.
river.pde: River Pollution Model w/Point Source
This is an example of a hyperbolic-parabolic or convective-diffusion equation. The
equation models pollutant concentrations in a river and includes a spatial point source,
turned on during a finite time interval over the course of the solution.
schrodgr.pde: Cubic Schrodinger Equation
The Cubic Shrodinger Equation (CSE) governs the movement of solitons traveling with
constant velocity and amplitude (without changing shape). When separated into real and
imaginary parts, the CSE gives two coupled PDEs of the form:
Vt + Wxx + (V^2 + W^2) W = 0
Wt - Wxx - (V^2 + W^2) V = 0
with |U| = |V + i W| = sqrt(V^2 + W^2).
The equations require a fine grid in space in order to resolve the sharp spatial
variations of the solitons; 401 points are used in the example (802 equations).
steepdes.pde: Steepest Descent Method for Nonlinear Algebraic Equations
This is an ODE-based steepest descent method to solve nonlinear algebraic and
trascendental equations. It has a smaller domain of convergence than Davidenko's Method,
but can compute solutions when the system of nonlinear equations is singular or
ill-conditioned. It is applied to the same 2x2 nonlinear system used in the davidnko.pde
demo problem, starting with a set of initial conditions for which the Jacobian is
singular.
stiffsys.pde: A Very Stiff ODE System Example
This example considers a second-order, linear ODE system, with a ratio of eigenvalues of
1000000 (L1 = -1000000, L2 = -1), illustrating the use of an explicit integrator (RKF45)
and an implicit stiff integrator (LSODES) for the different time scales of the problem.
[See the help file for a detailed discussion on Stability and Stiffness].
wave.pde: One-dimensional Wave Equation
Second order hyperbolic PDEs, i.e. PDEs which are second-order in time, can be integrated
by expressing them as systems of two first-order PDEs. The one-dimensional wave equation:
Utt - Uxx = 0
is used as an example to illustrate this procedure.
4thordr1.pde: Fourth-order PDE
This is extension of the wave equation to fourth-order in space:
Utt - Uxxxx = 0
The example illustrates the use of stagewise differentiation to evaluate fourth-order
spatial derivatives.
[ Home ] [ Introduction ] [ Start ] [ Features ] [ Examples ] [ Demo Download ] [ Ordering ] [ Support ] [ customer ]
|