Introduction to pde1dMg

The section describes an algorithm and a corresponding integrator function pde1dMg for solving a system of partial differential equations

Equation 1

utut=f(u,x,t),xL<x<xR,t>t0

This software is a one-dimensional differential equation solver. It requires the user to provide initial and boundary conditions in addition to a function for the evaluation of ut. The integration method is noteworthy due to the maintenance of grid lines in the space variable, x. Details for choosing new grid lines are given in Blom and Zegeling, (1994). The class of problems solved with pde1dMg is expressed by Equation 1 and given in more detail by:

Equation 2

NPDEk=1Cj,k(x,t,u,ux)ukt=xmx(xmRj(x,t,u,ux))Qj(x,t,u,ux),j=1,,NPDE,...xL<x<xR,...t>t0,...m0,1,2

The vector u[u1,,uNPDE]T is the solution. The integer value NPDE1 is the number of differential equations. The functions Rj and Qj can be regarded, in special cases, as flux and source terms. The functions u,Cj,k,Rj,Qj are expected to be continuous. Allowed values for the integer m are any of m=0,1,2. These are respectively for problems in Cartesian, cylindrical or polar, and spherical coordinates. In the two cases with m>0, the interval [xL,xR] must not contain x=0 as an interior point.

The boundary conditions have the master equation form

Equation 3

βj(x,t)Rj(x,t,u,ux)=γj(x,t,u,ux),at x=xL and x=xR,j=1,NPDE

In the boundary conditions the functions βj and γj are continuous. In the two cases with m>0, with an endpoint of [xL,xR] at 0, the finite value of the solution at x=0 must be ensured. This requires the specification of the solution at x=0, or it implies that Rj|x=xL=0 or Rj|x=xR=0. The initial values satisfy u(x,t0)=u0(x),...x[xL,xR] , where u0 is a piece-wise continuous vector function of x with NPDE components.

The user must pose the problem so that mathematical definitions are known for the functions

Cj,k,Rj,Qj,βj,γj and u0

These functions are provided to the function pde1dMg in the form of two user-supplied functions. This form of the usage interface is explained below and illustrated with several examples. u0 can be supplied as the input argument u or by an optional user-supplied function. Users comfortable with the description of this algorithm may skip directly to the Examples section.

Description Summary

Equation 1 is approximated at N=ngrids time-dependent grid values xL=x0<x1<<xi(t)<<xN+1=xR. Using the total differential dudt=ut+uxdxdt transforms the differential equation to the form

ut=dudtuxdxdt=f(u,x,t),...xL<x<xR

Using central divided differences for the factor ux leads to the system of ordinary differential equations in implicit form

dUidt(Ui+1Ui1)(xi+1xi1)dxidt=Fi,...t>t0,...i=1,,N

The terms Ui,Fi respectively represent the approximate solution to the partial differential equation and the value of f(u,x,t) at the point (u,x,t)=(ui,xi(t),t). The truncation error from this approximation is second-order in the space variable x. The above ordinary differential equations are underdetermined, so additional equations are added for determining the time-dependent grid points. These additional equations contain parameters that can be adjusted by the user. Often it will be necessary to modify these parameters to solve a difficult problem. For this purpose the following quantities are needed:

Δxi=xi+1xi,...ni=Δx1iμi=niκ(κ+1)(ni+12ni+ni1),...0iNn1n0,...nN+1nN

The values ni are the so-called point concentration of the grid. The parameter κ0 denotes a spatial smoothing value. Now the grid points are defined implicitly so that

μi1+τdui1dtMi1=μi+τduidtMi,...1iN

The parameter τ0 denotes a time-smoothing value. If the value τ is chosen to be large, this results in a fixed spatial grid. Increasing τ from its default value avoids the error condition where grid lines cross. The divisors are defined by

M2i=α+NPDE1NPDEj=1(Uji+1Uji)2(Δxi)2

The value κ determines the level of clustering or spatial smoothing of the grid points. Decreasing κ from its default values also decreases the amount of spatial smoothing. The parameters Mi approximate arc length and help determine the shape of the grid or xi distribution. The parameter τ prevents the grid movement from adjusting immediately to new values of the Mi , thereby avoiding oscillations in the grid that cause large relative errors in the solution. This is important when applied to solutions with steep gradients.

The discrete form of the differential equation and the smoothing equations are combined to yield the implicit system of differential equations

A(Y)dYdt=L(Y),Y=[U11,,UNPDE1,x1,]T

This is usually a stiff differential-algebraic system. It is solved using the integrator differentialAlgebraicEqs. If differentialAlgebraicEqs is needed during the evaluations of the differential equations or boundary conditions, it must be done in a separate thread to avoid possible problems with pde1dMg’s internal use of differentialAlgebraicEqs. The only options for differentialAlgebraicEqs set by pde1dMg are the Maximum BDF Order, and the absolute and relative error values, documented as maxBdfOrder, and atolRtolScalars.