bvpxtend

Extends a boundary value problem solution to a new interval end.

Category: Mathematics > Numerical Integration and Differential Equations

Syntax

solext = bvpxtend(sol, xnew, ynew)

Returns a guess on the interval extended to xnew, starting from sol and the value ynew at the new point.

Description

This is the basis of continuation: solve an easy problem on a short interval, extend the guess, and solve again on a longer one, repeating until the target interval is reached. It helps with problems that are hard to start from a crude guess.

The extension is only a guess; you must still call the solver with the new boundary conditions.

Input arguments

sol
Solution structure from bvp4c or bvp5c.
xnew
New end point, outside the current interval.
ynew
Guess for the solution at xnew (optional).

Output arguments

solext
Structure usable as the solinit argument of a new solver call on the longer interval.

Example

Extending the interval

odefun = @(x, y) [y(2); -y(1)];
bcfun = @(ya, yb) [ya(1); yb(1) - 1];
sol = bvp4c(odefun, bcfun, bvpinit(linspace(0, 1, 5), [0; 1]));
solext = bvpxtend(sol, 2, [1; 0]);
solext.x(end)
Output
ans = 2

See also

bvp4c bvp5c bvpinit odextend