Saturday, July 25, 2009

bvpget

Extract properties from the options structure created with bvpset

Syntax

  • val = bvpget(options,'name')
    val = bvpget(options,'name',default)

Description

val = bvpget(options,'name') extracts the value of the named property from the structure options, returning an empty matrix if the property value is not specified in options. It is sufficient to type only the leading characters that uniquely identify the property. Case is ignored for property names. [] is a valid options argument.

val = bvpget(options,'name',default) extracts the named property as above, but returns val = default if the named property is not specified in options. For example,

  • val = bvpget(opts,'RelTol',1e-4);

returns val = 1e-4 if the RelTol is not specified in opts.



bvpinit

Form the initial guess for bvp4c

Syntax

  • solinit = bvpinit(x,v)
    solinit = bvpinit(x,v,parameters)
    solinit = bvpinit(sol,[anew bnew])
    solinit = bvpinit(sol,[anew bnew],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 , then specify x(1) as and x(end) as . 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 , then x(1) <>, and similarly for .

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

  • Vector - For each component of the solution, 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.
  • Function - For a given mesh point, the function must return a vector whose elements are guesses for the corresponding components of the solution. The function must be of the form
    • 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.




x
Ordered nodes of the initial mesh.
y
Initial guess for the solution with solinit.y(:,i) a guess for the solution at the node solinit.x(i).
parameters
Optional. A vector that provides an initial guess for unknown parameters.

solinit = bvpinit(sol,[anew bnew]) forms an initial guess on the interval [anew bnew] from a solution sol on an interval . The new interval must be larger than the previous one, so either anew <= a < b <= bnew or anew >= a > b >= bnew. The solution sol is extrapolated to the new interval. If sol contains parameters, they are copied to solinit.

solinit = bvpinit(sol,[anew bnew],parameters) forms solinit as described above, but uses parameters as a guess for unknown parameters in solinit.



bvpset

Create/alter boundary value problem (BVP) options structure

Syntax

  • options = bvpset('name1',value1,'name2',value2,...)
    options = bvpset(oldopts'name1',value1,...)
    options = bvpset(oldopts,newopts)
    bvpset

Description

options = bvpset('name1',value1,'name2',value2,...) creates a structure options in which the named properties have the specified values. Any unspecified properties have default values. It is sufficient to type only the leading characters that uniquely identify the property. Case is ignored for property names.

options = bvpset(oldopts,'name1',value1,...) alters an existing options structure oldopts.

options = bvpset(oldopts,newopts) combines an existing options structure oldopts with a new options structure newopts. Any new properties overwrite corresponding old properties.

bvpset with no input arguments displays all property names and their possible values.

BVP Properties

These properties are available.


Property
Value
Description
RelTol
Positive scalar {1e-3}
A relative tolerance that applies to all components of the residual vector. The computed solution is the exact solution of

. On each subinterval of the mesh, the residual satisfies


AbsTol
Positive scalar or vector {1e-6}
An absolue tolerance that applies to all components of the residual vector. Elements of a vector of tolerances apply to corresponding components of the residual vector.
Vectorized
on | {off}
Set on to inform bvp4c that you have coded the ODE function F so that F([x1 x2 ...],[y1 y2 ...]) returns [F(x1,y1) F(x2,y2) ...]. That is, your ODE function can pass to the solver a whole array of column vectors at once. This allows the solver to reduce the number of function evaluations, and may significantly reduce solution time.
SingularTerm
Matrix
Singular term of singular BVPs.
Set to the constant matrix S for equations of the form
that are posed on the interval where .
FJacobian
Function | matrix | cell array
Analytic partial derivatives of ODEFUN.
For example, when solving , set this property to @FJAC if DFDY = FJAC(X,Y) evaluates the Jacobian of with respect to . If the problem involves unknown parameters , [DFDY,DFDP] = FJAC(X,Y,P) must also return the partial derivative of with respect to . For problems with constant partial derivatives, set this property to the value of DFDY or to a cell array {DFDY,DFDP}.
BCJacobian
Function |
cell array
Analytic partial derivatives of BCFUN.
For example, for boundary conditions , set this property to @BCJAC if [DBCDYA,DBCDYB] = BCJAC(YA,YB) evaluates the partial derivatives of with respect to and to . If the problem involves unknown parameters , then [DBCDYA,DBCDYB,DBCDP] = BCJAC(YA,YB,P) must also return the partial derivative of with respect to . For problems with constant partial derivatives, set this property to a cell array {DBCDYA,DBCDYB} or {DBCDYA,DBCDYB,DBCDP}.
Nmax
positive integer {floor(1000/n)}
Maximum number of mesh points allowed.
Stats
on | {off}
Display computational cost statistics.

No comments:

Post a Comment