# naginterfaces.library.pde.dim1_​parab_​coll¶

naginterfaces.library.pde.dim1_parab_coll(m, ts, tout, pdedef, bndary, u, xbkpts, npoly, uinit, acc, comm, itask, itrace, ind, data=None, io_manager=None, spiked_sorder='C')[source]

dim1_parab_coll integrates a system of linear or nonlinear parabolic partial differential equations (PDEs) in one space variable. The spatial discretization is performed using a Chebyshev collocation method, and the method of lines is employed to reduce the PDEs to a system of ordinary differential equations (ODEs). The resulting system is solved using a backward differentiation formula method.

For full information please refer to the NAG Library document for d03pd

https://www.nag.com/numeric/nl/nagdoc_27.3/flhtml/d03/d03pdf.html

Parameters
mint

The coordinate system used:

Indicates Cartesian coordinates.

Indicates cylindrical polar coordinates.

Indicates spherical polar coordinates.

tsfloat

The initial value of the independent variable .

toutfloat

The final value of to which the integration is to be carried out.

pdedefcallable (p, q, r, ires) = pdedef(t, x, u, ux, ires, data=None)

must compute the values of the functions , and which define the system of PDEs.

The functions may depend on , , and and must be evaluated at a set of points.

Parameters
tfloat

The current value of the independent variable .

xfloat, ndarray, shape

Contains a set of mesh points at which , and are to be evaluated. and contain successive user-supplied break-points and the elements of the array will satisfy .

ufloat, ndarray, shape

contains the value of the component where , for , for .

uxfloat, ndarray, shape

contains the value of the component where , for , for .

iresint

Set to or .

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
pfloat, array-like, shape

must be set to the value of where , for , for , for .

qfloat, array-like, shape

must be set to the value of where , for , for .

rfloat, array-like, shape

must be set to the value of where , for , for .

iresint

Should usually remain unchanged. However, you may set to force the integration function to take certain actions as described below:

Indicates to the integrator that control should be passed back immediately to the calling function with the error indicator set to = 6.

Indicates to the integrator that the current time step should be abandoned and a smaller time step used instead. You may wish to set when a physically meaningless input or output value has been generated. If you consecutively set , dim1_parab_coll returns to the calling function with the error indicator set to = 4.

bndarycallable (beta, gamma, ires) = bndary(t, u, ux, ibnd, ires, data=None)

must compute the functions and which define the boundary conditions as in equation (3).

Parameters
tfloat

The current value of the independent variable .

ufloat, ndarray, shape

contains the value of the component at the boundary specified by , for .

uxfloat, ndarray, shape

contains the value of the component at the boundary specified by , for .

ibndint

Specifies which boundary conditions are to be evaluated.

must set up the coefficients of the left-hand boundary, .

must set up the coefficients of the right-hand boundary, .

iresint

Set to or .

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
betafloat, array-like, shape

must be set to the value of at the boundary specified by , for .

gammafloat, array-like, shape

must be set to the value of at the boundary specified by , for .

iresint

Should usually remain unchanged. However, you may set to force the integration function to take certain actions as described below:

Indicates to the integrator that control should be passed back immediately to the calling function with the error indicator set to = 6.

Indicates to the integrator that the current time step should be abandoned and a smaller time step used instead. You may wish to set when a physically meaningless input or output value has been generated. If you consecutively set , dim1_parab_coll returns to the calling function with the error indicator set to = 4.

ufloat, array-like, shape

If the value of must be unchanged from the previous call.

xbkptsfloat, array-like, shape

The values of the break-points in the space direction. must specify the left-hand boundary, , and must specify the right-hand boundary, .

npolyint

The degree of the Chebyshev polynomial to be used in approximating the PDE solution between each pair of break-points.

uinitcallable u = uinit(npde, x, data=None)

must compute the initial values of the PDE components , for , for .

Parameters
npdeint

The number of PDEs in the system.

xfloat, ndarray, shape

, contains the values of the th mesh point, for .

dataarbitrary, optional, modifiable in place

User-communication data for callback functions.

Returns
ufloat, array-like, shape

must be set to the initial value , for , for .

accfloat

A positive quantity for controlling the local error estimate in the time integration. If is the estimated error for at the th mesh point, the error test is:

commdict, communication object, modified in place

Communication structure.

On initial entry: need not be set.

Specifies the task to be performed by the ODE integrator.

Normal computation of output values at .

One step and return.

Stop at first internal integration point at or beyond .

itraceint

The level of trace information required from dim1_parab_coll and the underlying ODE solver. may take the value , , , or .

No output is generated.

Only warning messages from the PDE solver are printed.

Output from the underlying ODE solver is printed. This output contains details of Jacobian entries, the nonlinear iteration and the time integration during the computation of the ODE system.

If , is assumed and similarly if , is assumed.

The advisory messages are given in greater detail as increases. You are advised to set , unless you are experienced with submodule ode.

indint

Indicates whether this is a continuation call or a new integration.

Starts or restarts the integration in time.

Continues the integration after an earlier exit from the function. In this case, only the argument should be reset between calls to dim1_parab_coll.

dataarbitrary, optional

User-communication data for callback functions.

io_managerFileObjManager, optional

Manager for I/O in this routine.

spiked_sorderstr, optional

If is spiked (i.e., has unit extent in all but one dimension, or has size ), selects the storage order to associate with it in the NAG Engine:

spiked_sorder =

row-major storage will be used;

spiked_sorder =

column-major storage will be used.

Two-dimensional arrays returned from callback functions in this routine must then use the same storage order.

Returns
tsfloat

The value of corresponding to the solution values in . Normally .

ufloat, ndarray, shape

will contain the computed solution at .

xfloat, ndarray, shape

The mesh points chosen by dim1_parab_coll in the spatial direction. The values of will satisfy .

indint

.

Raises
NagValueError
(errno )

On entry, on initial entry .

Constraint: on initial entry .

(errno )

On entry, .

Constraint: or .

(errno )

On entry, , , and .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, , and .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, .

Constraint: .

(errno )

On entry, and .

Constraint: or

(errno )

On entry, .

Constraint: , or .

(errno )

On entry, .

Constraint: , or .

(errno )

On entry, is too small: and .

(errno )

On entry, and .

Constraint: .

(errno )

In setting up the ODE system an internal auxiliary was unable to initialize the derivative. This could be due to your setting in or .

(errno )

Singular Jacobian of ODE system. Check problem formulation.

(errno )

was too small to start integration: .

(errno )

set to an invalid value in call to or .

(errno )

Serious error in internal call to an auxiliary. Increase for further details.

(errno )

Error during Jacobian formulation for ODE system. Increase for further details.

(errno )

Flux function appears to depend on time derivatives.

Warns
NagAlgorithmicWarning
(errno )

Underlying ODE solver cannot make further progress from the point with the supplied value of . , .

(errno )

Repeated errors in an attempted step of underlying ODE solver. Integration was successful as far as : .

(errno )

In evaluating residual of ODE system, has been set in or . Integration is successful as far as : .

(errno )

Integration completed, but a small change in is unlikely to result in a changed solution. .

Notes

dim1_parab_coll integrates the system of parabolic equations:

where , and depend on , , , and the vector is the set of solution values

and the vector is its partial derivative with respect to . Note that , and must not depend on .

The integration in time is from to , over the space interval , where and are the leftmost and rightmost of a user-defined set of break-points . The coordinate system in space is defined by the value of ; for Cartesian coordinates, for cylindrical polar coordinates and for spherical polar coordinates.

The system is defined by the functions , and which must be specified in .

The initial values of the functions must be given at , and must be specified in .

The functions , for , which may be thought of as fluxes, are also used in the definition of the boundary conditions for each equation. The boundary conditions must have the form

where or .

The boundary conditions must be specified in . Thus, the problem is subject to the following restrictions:

1. , so that integration is in the forward direction;

2. , and the flux must not depend on any time derivatives;

3. the evaluation of the functions , and is done at both the break-points and internally selected points for each element in turn, that is , and are evaluated twice at each break-point. Any discontinuities in these functions must, therefore, be at one or more of the break-points ;

4. at least one of the functions must be nonzero so that there is a time derivative present in the problem;

5. if and , which is the left boundary point, then it must be ensured that the PDE solution is bounded at this point. This can be done by either specifying the solution at or by specifying a zero flux there, that is and . See also Further Comments.

The parabolic equations are approximated by a system of ODEs in time for the values of at the mesh points. This ODE system is obtained by approximating the PDE solution between each pair of break-points by a Chebyshev polynomial of degree . The interval between each pair of break-points is treated by dim1_parab_coll as an element, and on this element, a polynomial and its space and time derivatives are made to satisfy the system of PDEs at spatial points, which are chosen internally by the code and the break-points. In the case of just one element, the break-points are the boundaries. The user-defined break-points and the internally selected points together define the mesh. The smallest value that can take is one, in which case, the solution is approximated by piecewise linear polynomials between consecutive break-points and the method is similar to an ordinary finite element method.

In total there are mesh points in the spatial direction, and ODEs in the time direction; one ODE at each break-point for each PDE component and () ODEs for each PDE component between each pair of break-points. The system is then integrated forwards in time using a backward differentiation formula method.

References

Berzins, M, 1990, Developments in the NAG Library software for parabolic equations, Scientific Software Systems, (eds J C Mason and M G Cox), 59–72, Chapman and Hall

Berzins, M and Dew, P M, 1991, Algorithm 690: Chebyshev polynomial software for elliptic-parabolic systems of PDEs, ACM Trans. Math. Software (17), 178–206

Zaturska, N B, Drazin, P G and Banks, W H H, 1988, On the flow of a viscous fluid driven along a channel by a suction at porous walls, Fluid Dynamics Research (4)