| MATLAB Function Reference | ![]() |
Form the initial guess for bvp4c
Syntax
solinit = bvpinit(x,v) solinit = bvpinit(x,v,parameters)
Description
solinit = bvpinit(x,v)
forms the initial guess for bvp4c in common circumstances.
x is a vector that specifies an initial mesh. If you want to solve the boundary value problem (BVP) on [a,b], then specify x(1) as a and x(end) as b. The function bvp4c adapts this mesh to the solution, so often a guess like x = linspace(a,b,10) suffices. However, in difficult cases, you must place mesh points where the solution changes rapidly. The entries of x must be ordered and distinct, so if a < b, then x(1) < x(2) < ... < x(end), and similarly for a > b.
v is a guess for the solution. It can be either a vector, or a function:
bvpinit replicates the corresponding element of the vector as a constant guess across all mesh points. That is, v(i) is a constant guess for the ith component y(i,:) of the solution at all the mesh points in x.y = guess(x)
where x is a mesh point and y is a vector whose length is the same as the number of components in the solution. For example, if you use @guess, bvpinit calls this function for each mesh point y(:,j) = guess(x(j)).
solinit = bvpinit(x,v,parameters)
indicates that the BVP involves unknown parameters. Use the vector parameters to provide a guess for all unknown parameters.
solinit is a structure with the following fields. The structure can have any name, but the fields must be named x, y, and parameters.
See Also
@ (function_handle), bvp4c, bvpget, bvpset, bvpval
| bvpget | bvpset | ![]() |