Numerical PDE Methods Available for pdsolve/numeric

Description


•

This page contains a description of all numerical PDE methods available for time dependent problems, including information on the order of accuracy, applicable PDE problems, if numerical boundary conditions are required, and the differencing scheme used. For more information on specifying a specific numeric method for solving a PDE, see pdsolve/numeric/method.


ForwardTime1Space[forward/backward]


•

The forward time forward/backward space method is an explicit single stage method that can be used to find solutions to first order time/space PDEs.

•

The method is accurate.

•

First order PDEs that describe righttraveling waves should use the backward method (specified as ForwardTime1Space[backward]), and specify the boundary condition at the left boundary, while lefttraveling waves require the forward method (specified as ForwardTime1Space[forward]), and the boundary condition at the right boundary. Numerical boundary conditions are not required.

•

As this is an explicit scheme, stability requires a restriction of the form for some depending upon the problem.

•

The scheme used to compute the value at the mesh point is the result of applying differencing to the PDE about the point and can obtained by substitution of the discretizations


into the PDE for the backward method. The forward method simply replaces the discretization for by



CenteredTime1Space[forward/backward]


•

The centered time forward/backward space method is an implicit single stage method that can be used to find solutions to PDEs containing the derivatives .

•

The method is accurate.

•

PDEs that describe righttraveling waves should use the backward method (specified as CenteredTime1Space[backward]), and specify the boundary condition at the left boundary, while lefttraveling waves require the forward method (specified as CenteredTime1Space[forward]), and the boundary condition at the right boundary. Numerical boundary conditions are not required.

•

This is an implicit scheme, and is unconditionally stable for many problems (though this may need to be checked).

•

The scheme used to compute the value at the mesh point is the result of applying differencing to the PDE about the point and is obtained by substitution of the discretizations


into the PDE for the backward method. The forward method simply replaces the discretizations for and by



BackwardTime1Space[forward/backward]


•

The backward time forward/backward space method is an implicit single stage method that can be used to find solutions to PDEs containing the derivatives .

•

The method is accurate.

•

PDEs that describe righttraveling waves should use the backward method (specified as BackwardTime1Space[backward]), and specify the boundary condition at the left boundary, while lefttraveling waves require the forward method (specified as BackwardTime1Space[forward]), and the boundary condition at the right boundary. Numerical boundary conditions are not required.

•

This is an implicit scheme, and is unconditionally stable for many problems (though this may need to be checked).

•

The scheme used to compute the value at the mesh point is the result of applying differencing to the PDE about the point and is obtained by substitution of the discretizations


into the PDE for the backward method. The forward method simply replaces the discretizations for and by



ForwardTimeCenteredSpace or Euler


•

The forward time centered space method is an explicit single stage method that can be used to find solutions to PDEs that are first order in time, and arbitrary order in space, with no mixed partial derivatives.

•

The method is accurate.

•

PDEs that are odd order in space require that numerical boundary conditions be specified so that each boundary has the same total number of conditions, and that the total number of boundary conditions is one greater than the differential order in the space variable. PDEs that are second order in space require no numerical boundary conditions, but still require the same number of conditions on each boundary.



CenteredTimeCenteredSpace or CrankNicholson


•

The centered time centered space method is an implicit single stage method that can be used to find solutions to PDEs that are first order in time, and arbitrary order in space, with mixed partial derivatives.

•

The method is accurate.

•

PDEs that are odd order in space require that numerical boundary conditions be specified so that each boundary has the same total number of conditions, and that the total number of boundary conditions is one greater than the differential order in the space variable. PDEs that are second order in space require no numerical boundary conditions, but still require the same number of conditions on each boundary.

•

This is an implicit scheme, and is unconditionally stable for many problems (though this may need to be checked).



BackwardTimeCenteredSpace or BackwardEuler


•

The backward time centered space method is an implicit method that can be used to find solutions to PDEs that are first order in time, and arbitrary order in space, with mixed partial derivatives.

•

The method is accurate.

•

PDEs that are odd order in space require that numerical boundary conditions be specified so that each boundary has the same total number of conditions, and that the total number of boundary conditions is one greater than the differential order in the space variable. PDEs that are second order in space require no numerical boundary conditions, but still require the same number of conditions on each boundary.

•

This is an implicit scheme, and is unconditionally stable for many problems (though this may need to be checked).



Box


•

The box method is an implicit single stage method that can be used to find solutions to PDEs that are first order in time, and arbitrary order in space, with mixed partial derivatives.

•

The method is accurate.

•

The method uses a spatial mesh with an even number of points, so necessarily one boundary must have one condition more than the other. Since the method is symmetric (would be no different if one boundary had the extra condition versus the other) the method is automatically adjusted to accommodate the boundary conditions.

•

PDEs that are even order in space require one additional numerical boundary condition, while PDEs that are odd order in space require no numerical boundary conditions.

•

This is an implicit scheme, and is unconditionally stable for many problems (though this may need to be checked).



LaxFriedrichs


•

The LaxFriedrichs method is an explicit single stage method that can be used to find solutions to PDEs that are first order in time, and odd order in space, with no mixed partial derivatives.

•

PDEs that are odd order in space require that numerical boundary conditions be specified so that each boundary has the same total number of conditions, and that the total number of boundary conditions is one greater than the differential order in the space variable. PDEs that are second order in space require no numerical boundary conditions, but do require the same number of conditions on each boundary.



LaxWendroff


•

The LaxWendroff method is an explicit single stage method that can be used to find solutions to linear PDEs that are first order in time and space.

•

The method is accurate.

•

The LaxWendroff method always requires a numerical boundary condition so that one boundary condition is specified for each boundary.

•

As this is an explicit scheme, stability requires a restriction of the form for some depending upon the problem.

•

The derivation of this scheme is complex, and involves computing difference schemes of derivatives of the input PDE, (which results in the linearity restriction), but is available in many standard textbooks.



Leapfrog


•

The Leapfrog method is an explicit two stage method that can be used to find solutions to PDEs that are first order in time, and arbitrary order in space, with no mixed partial derivatives.

•

The method is accurate, and as it is a two stage method, a startup method must be used.

•

PDEs that are odd order in space require that numerical boundary conditions be specified so that each boundary has the same total number of conditions, and that the total number of boundary conditions is one greater than the differential order in the space variable. PDEs that are even order in space require no numerical boundary conditions, but still require the same number of conditions on each boundary.

•

The scheme used to compute the value at the mesh point uses the formula


for the time derivative, and uses central differencing over points to compute all spatial derivatives.



DuFortFrankel


•

The DuFortFrankel method is an explicit two stage method that can be used to find solutions to linear PDEs that are first order in time, and even order in space, with no mixed partial derivatives. In some cases it can be used to find solutions of nonlinear PDEs.

•

Since this method is restricted to PDEs that are even order in space, no numerical boundary conditions are required, but the number of conditions on each boundary must be the same.



Constructing a Custom Method


•

Construction of a new method or scheme for use by pdsolve is somewhat involved, and requires some basic Maple programming knowledge. In essence, you must construct a routine that derives the desired method for an arbitrary point , for an input PDE, and returns that information, and information on the method itself in the entries of an input table.

•

Construction of new methods has the following limitations.


 The PDE must be first order in time.


 The scheme cannot use more than two additional stages.


 The time and space step sizes are constant.


 The scheme cannot use discrete values of the space variable that are outside the stencil of the method.

•

The following is the code for the CenteredTime1Space method and is used as an example to describe what is needed.

`pdsolve/numeric/findif/CenteredTime1Space` := proc(

PDE, # The PDE to be discretized

u, # The dependent variable, with dependencies (e.g. u(x,t))

x, # The space independent variable

t, # The time independent variable

v, # The name to be used for discretization, v[timeidx,spaceidx]

ix, # The value of the central space index

h, # The space step size (symbolic)

k, # The time step size (symbolic)

parms, # List of additional parameters for the method (the index

# for the 'method' argument.

# e.g. for "method=CenteredTime1Space[forward]" the list

# is ['forward'].

INFO) # Input/Output table of information

local sb;

# First validate that this method works for the input PDE

if INFO["timeord"]<>1 or INFO["spaceord"]<>1 then

error("The CenteredTime1Space scheme can only be used with firstorder PDE");

elif parms=[] or not member(parms,{['forward'],['backward']}) then

error("The CenteredTime1Space scheme requires a parameter, 'forward' or 'backward'");

end if;

# Set output parameters

INFO["directional"] := true;

# Now compute the discretization of derivatives that may

# appear in the PDE

sb := diff(u,t)=(v[1,ix]v[0,ix])/k,u=(v[1,ix]+v[0,ix])/2;

if parms=['forward'] then

sb := sb,diff(u,x)=(v[1,ix+1]v[1,ix] + v[0,ix+1]v[0,ix])/2/h,

diff(u,x,t)=(v[1,ix+1]v[1,ix]v[0,ix+1]+v[0,ix])/k/h;

else

sb := sb,diff(u,x)=(v[1,ix]v[1,ix1] + v[0,ix]v[0,ix1])/2/h,

diff(u,x,t)=(v[1,ix]v[1,ix1]v[0,ix]+v[0,ix1])/k/h;

end if;

# Now evaluate the PDE with respect to the discretization schemes and

# adjust explicit occurrences of the time/space variables

eval(PDE,{sb,x=x[ix],t=t+k/2});

end proc:




The input data is fairly well described by the comments present in the parameter list of the example, only a few items need be discussed.


The name of the procedure for the method must be of the form `pdsolve/numeric/findif/<method name>`, as pdsolve checks for the presence of the routine based on the argument of the 'method' option.


The input PDE is an expression (not an equation) that is equivalent to the PDE being numerically solved by pdsolve. If the input to pdsolve is an equation, it is converted to an expression. It is converted to diff notation (not operator notation), so if is present in the input PDE, this routine sees instead.


The returned expression is to be used to compute the discrete solution value at , where is the input parameter.


The INFO table has entries that can be used to more easily determine if the method being derived is valid for the input PDE and is also used to output certain information about the discretization. In addition, the flag can be set as output.

•

The INFO table has the following entries that can be used by this routine.


The INFO["timeord"] entry holds an integer giving the differential order of the PDE with respect to the time variable.


The INFO["spaceord"] entry holds an integer giving the differential order of the PDE with respect to the space variable.


The INFO["mixed"] entry holds boolean value indicating if mixed partial derivatives are present in the PDE.


The INFO["directional"] flag should be set to 'true' by the routine for any implicit methods where the specific solving unknown is important. Otherwise, numeric may shift the method depending on the location of the boundary conditions. If not set, it is assumed to be false.


For example, the Box method applied to a first order PDE is of the same form if the boundary condition is given on the left, as if the boundary condition is given on the right. As a result, for this scheme, INFO["directional"] should be false (the default).


Note: Explicit methods have INFO["directional"] set to true automatically, as there is only ever one discrete dependent variable value present in the scheme for a future time step.


The pdsolve command performs well for a direct discretization of the PDE, due to the optimization settings, so use of or on the discretized PDE within the method procedure can degrade performance. It is best to experiment with this when writing a custom method.



