naginterfaces.library.ode.bvp_ps_lin_solve¶
- naginterfaces.library.ode.bvp_ps_lin_solve(a, b, c, bmat, y, bvec, f)[source]¶
bvp_ps_lin_solve
finds the solution of a linear constant coefficient boundary value problem by using the Chebyshev integration formulation on a Chebyshev Gauss–Lobatto grid.For full information please refer to the NAG Library document for d02ue
https://support.nag.com/numeric/nl/nagdoc_30.3/flhtml/d02/d02uef.html
- Parameters
- afloat
, the lower bound of domain .
- bfloat
, the upper bound of domain .
- cfloat, array-like, shape
The Chebyshev coefficients , , for the right-hand side of the boundary value problem. Usually these are obtained by a previous call of
bvp_ps_lin_coeffs()
.- bmatfloat, array-like, shape
must contain the coefficients , for , for , in the problem formulation of Notes.
- yfloat, array-like, shape
The points, , for , where the boundary conditions are discretized.
- bvecfloat, array-like, shape
The values, , for , in the formulation of the boundary conditions given in Notes.
- ffloat, array-like, shape
The coefficients, , for , in the formulation of the linear boundary value problem given in Notes. The highest order term, , needs to be nonzero to have a well posed problem.
- Returns
- bmatfloat, ndarray, shape
The coefficients have been scaled to form an equivalent problem defined on the domain .
- ffloat, ndarray, shape
The coefficients have been scaled to form an equivalent problem defined on the domain .
- ucfloat, ndarray, shape
The Chebyshev coefficients in the Chebyshev series representations of the solution and derivatives of the solution to the boundary value problem. The elements contain the coefficients representing the solution , for . contains the coefficients representing the th derivative of , for .
- residfloat
The maximum residual resulting from substituting the solution vectors returned in into the equations representing the linear boundary value problem and associated boundary conditions.
- Raises
- NagValueError
- (errno )
On entry, .
Constraint: .
- (errno )
On entry, .
Constraint: is even.
- (errno )
On entry, and .
Constraint: .
- (errno )
On entry, .
- (errno )
On entry, .
Constraint: .
- (errno )
Internal error while unpacking matrix during iterative refinement.
Please contact NAG.
- (errno )
Singular matrix encountered during iterative refinement.
Please check that your system is well posed.
- Warns
- NagAlgorithmicWarning
- (errno )
During iterative refinement, the maximum number of iterations was reached.
and .
- (errno )
During iterative refinement, convergence was achieved, but the residual is more than . .
- Notes
bvp_ps_lin_solve
solves the constant linear coefficient ordinary differential problemsubject to a set of linear constraints at points , for :
where , is an matrix of constant coefficients and are constants. The points are usually either or .
The function is supplied as an array of Chebyshev coefficients , for the function discretized on Chebyshev Gauss–Lobatto points (as returned by
bvp_ps_lin_cgl_grid()
); the coefficients are normally obtained by a previous call tobvp_ps_lin_coeffs()
. The solution and its derivatives (up to order ) are returned, in the form of their Chebyshev series representation, as arrays of Chebyshev coefficients; subsequent calls tobvp_ps_lin_cgl_vals()
will return the corresponding function and derivative values at the Chebyshev Gauss–Lobatto discretization points on . Function and derivative values can be obtained on any uniform grid over the same range by calling the interpolation functionbvp_ps_lin_grid_vals()
.
- References
Clenshaw, C W, 1957, The numerical solution of linear differential equations in Chebyshev series, Proc. Camb. Phil. Soc. (53), 134–149
Coutsias, E A, Hagstrom, T and Torres, D, 1996, An efficient spectral method for ordinary differential equations with rational function coefficients, Mathematics of Computation (65(214)), 611–635
Greengard, L, 1991, Spectral integration and two-point boundary value problems, SIAM J. Numer. Anal. (28(4)), 1071–80
Lundbladh, A, Hennigson, D S and Johannson, A V, 1992, An efficient spectral integration method for the solution of the Navier–Stokes equations, Technical report FFA–TN, 1992–28, Aeronautical Research Institute of Sweden
Muite, B K, 2010, A numerical comparison of Chebyshev methods for solving fourth-order semilinear initial boundary value problems, Journal of Computational and Applied Mathematics (234(2)), 317–342