23.12.2012 Views

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

MATLAB Function Reference Volume 1: A - E - Bad Request

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

vpinit<br />

2bvpinit<br />

Purpose Form the initial guess for bvp4c<br />

Syntax solinit = bvpinit(x,v)<br />

solinit = bvpinit(x,v,parameters)<br />

solinit = bvpinit(sol,[anew bnew])<br />

solinit = bvpinit(sol,[anew bnew],parameters)<br />

Description solinit = bvpinit(x,v) forms the initial guess for bvp4c in common<br />

circumstances.<br />

2-182<br />

x is a vector that specifies an initial mesh. If you want to solve the boundary<br />

value problem (BVP) on [ ab , ] , then specify x(1) as a and x(end) as b.<br />

The<br />

function bvp4c adapts this mesh to the solution, so often a guess like<br />

x = linspace(a,b,10) suffices. However, in difficult cases, you must place<br />

mesh points where the solution changes rapidly. The entries of x must be<br />

ordered and distinct, so if a < b,<br />

then x(1) < x(2) < ... < x(end), and<br />

similarly for a> b.<br />

v is a guess for the solution. It can be either a vector, or a function:<br />

• Vector – For each component of the solution, bvpinit replicates the<br />

corresponding element of the vector as a constant guess across all mesh<br />

points. That is, v(i) is a constant guess for the ith component y(i,:) of the<br />

solution at all the mesh points in x.<br />

• <strong>Function</strong> – For a given mesh point, the function must return a vector whose<br />

elements are guesses for the corresponding components of the solution. The<br />

function must be of the form<br />

y = guess(x)<br />

where x is a mesh point and y is a vector whose length is the same as the<br />

number of components in the solution. For example, if you use @guess,<br />

bvpinit calls this function for each mesh point y(:,j) = guess(x(j)).<br />

solinit = bvpinit(x,v,parameters) indicates that the BVP involves<br />

unknown parameters. Use the vector parameters to provide a guess for all<br />

unknown parameters.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!