bvp: Boundary Value Problems In pracma: Practical Numerical Math Functions

Description

Solves boundary value problems of linear second order differential equations.

Usage

 1 bvp(f, g, h, x, y, n = 50)

Arguments

 f, g, h functions on the right side of the differential equation. If f, g or h is a scalar instead of a function, it is assumed to be a constant coefficient in the differential equation. x x, x are the interval borders where the solution shall be computed. y boundary conditions such that y(x) = y, y(x) = y. n number of intermediate grid points; default 50.

Details

Solves the two-point boundary value problem given as a linear differential equation of second order in the form:

y'' = f(x) y' + g(x) y + h(x)

with the finite element method. The solution y(x) shall exist on the interval [a, b] with boundary conditions y(a) = y_a and y(b) = y_b.

Value

Returns a list list(xs, ys) with the grid points xs and the values ys of the solution at these points, including the boundary points.

Note

Uses a tridiagonal equation solver that may be faster then qr.solve for large values of n.

References

Kutz, J. N. (2005). Practical Scientific Computing. Lecture Notes 98195-2420, University of Washington, Seattle. 