find numerical solution of ODE boundary value problems
dsolve(odesys, numeric, vars, options)
set or list; ordinary differential equation(s) and boundary conditions
name; instruct dsolve to find a numerical solution
(optional) any indeterminate function of one variable, or a set or list of them, representing the unknowns of the ODE problem
(optional) equations of the form keyword = value
The dsolve command with the numeric or type=numeric option on a real-valued two-point boundary value problem (BVP), finds a numerical solution for the ODE or ODE system BVP.
The type of problem (BVP or IVP) is automatically detected by dsolve, and an applicable algorithm is used. The optional equation method=bvp[submethod] indicates that a specific BVP solver is to be used. The available submethods are traprich, trapdefer, midrich, and middefer. The first two methods, traprich and trapdefer,are trapezoid methods that use Richardson extrapolation enhancement or deferred correction enhancement, respectively. The remaining two methods, midrich and middefer, are midpoint methods with the same enhancement schemes.
There are two major considerations when choosing a submethod for a BVP. The trapezoid submethods are generally more efficient for typical problems, but the midpoint submethods are capable of handling harmless end-point singularities that the trapezoid submethods cannot. For the enhancement schemes, Richardson extrapolation is generally faster, but deferred corrections uses less memory on difficult problems.
The available methods are fairly general, and should work on a variety of BVPs. They are not well suited to solve BVPs that are stiff or have solutions with singularities in their higher order derivatives.
The solution method is capable of handling both linear and nonlinear BVPs with fixed, periodic, and even nonlinear boundary conditions. For nonlinear boundary conditions, however, it may be necessary to provide an initial solution profile that approximately satisfies the boundary conditions (see 'approxsoln' below). The method is also capable of handling BVP systems with undetermined parameters, given a sufficient number of boundary conditions to determine their values.
Computation can be performed in both hardware precision and arbitrary precision, based on the setting of Digits. If Digits is smaller than the hardware precision for the machine, then computations are performed in hardware precision (see evalhf). If Digits is larger, then computations are performed in Maple floating point. In both cases, many of the more computationally intensive steps are performed in compiled external libraries.
The return value of dsolve and the manipulation of the input system is controlled by the following three optional equations, which are discussed in dsolve[numeric].
keyword or array
name or list of names
In addition to the output options available for all numerical ODE problems, the option output=mesh is also available. It specifies that dsolve return an array-form output where independent variable values are chosen as the discrete mesh used internally by the method. This also has the effect of changing the interpolant default to false because only the discrete solution is required. See interpolant below.
The 'known' option specifies user-defined known functions, and is discussed in dsolve[numeric].
The options listed below are specific to BVP and include options to control the solution process, the accuracy of the result, and the initial mesh or solution profile to be used.
array, list or procedure
Numeric value that gives an absolute error tolerance for the solution. In all but exceptional cases the true solution should be within the error tolerance value of the continuous approximate solution obtained by the method. The default value of abserr is Float(1,-6).
Note: This is an absolute error tolerance, so if the scale of the problem is such that the solution values are much smaller/larger than unitary, this parameter requires adjustment.
As for IVPs (see dsolve[numeric,IVP]), the system is converted to a first order system internally before the numerical solution is computed. The absolute error tolerance is applied to all components of the converted system.
Gives the left and right boundary points of the solution interval in the form leftpt..rightpt. This enables the method to be used to compute the solution of an initial value problem over a fixed interval using the absolute global error bound specified by abserr.
Boolean value that determines whether mesh adaptation is used to obtain the solution. By default this is true.
The method applied is based on arc-length, with additional rules to prevent adjacent steps from changing their size too rapidly, restrictions on the largest and smallest allowable step sizes as compared with the corresponding fixed step size, and restrictions preventing the mesh points near the boundaries from becoming too widely spaced.
Note: Some problems work better with fixed step-size meshes.
Integer value that determines the maximum number of points dsolve uses to compute the numerical solution. The numeric BVP solver internally uses a discrete mesh of points to calculate the approximate solution, which is adjusted as greater accuracy is required. If the desired accuracy cannot be obtained with the current limitation imposed by maxmesh, an error is returned. The default value for maxmesh is 128. Its value must be between 32 and 134217728.
Integer value that determines the number of points dsolve uses to compute the initial solution profile. In some cases, the default initial 8 point mesh does not have sufficient resolution to obtain the initial solution profile, so increasing this value can give a solution when the default value does not. Its value must be between 8 and 134217728.
'approxsoln'= array, list or procedure
Argument that enables specification of an initial approximate discrete solution to be used as a starting point for the problem. There are many forms that this argument can take.
The simplest forms are the output of another dsolve/numeric computation when output is specified as an array (Matrix form output), or as a procedure (procedurelist, listprocedure, or operator output).
Another form is as a two-dimensional array where the names of the dependent variables and independent variables are given in the first column, followed by their values at different mesh points in the following columns. All dependent variables in the (converted to first order) system, must be present. This form can also be specified using nested lists.
The final form is as a list of equations that describe the initial solution profile as functions of the independent variable. For example, for a second order BVP in u⁡x, this could be specified as u⁡x=f⁡x or as u⁡x=f⁡x,ⅆⅆxu⁡x=g⁡x, where the f⁡x,g⁡x are fully determined functions of x. In the former case, the required derivative values of u⁡x are computed by evaluation of the derivative of f⁡x.
In the cases with a discrete solution given in array form, the values of the independent variable must always be provided at either boundary, in increasing order over the solution region, and at a minimum of 8 distinct points. In addition, the specification of a discrete approximate solution cannot be used in combination with initmesh.
For systems with free parameters (determined through interaction with the boundary conditions) it is suggested that approximate values for the parameters also be provided.
Argument that allows solution of a BVP via a continuous transformation from an easier problem to the desired problem. This method is used in obtaining an initial solution profile, and is most helpful for problems for which the Newton iteration for the initial solution approximation does not converge. The continuation option provides the name for the continuation parameter for the problem. The continuation problem must be constructed so that the parameter c, when varied from 0 to 1, defines a different BVP for each value of c, where c=0 represents the simpler problem, and c=1 represents the problem to be solved. The continuation parameter can be present in the differential equation, the values for the boundary conditions, or both. Two examples of the use of continuation for the solution of BVP problems can be found in dsolve[numeric_bvp,advanced].
For best results, the continuation problem should be constructed so that the BVP solutions vary continuously with the parameter, and so that the rate of change of the solution, with respect to the parameter, is very roughly constant over the range c=0..1.
Argument that provides a minimum value for the allowed change in the continuation parameter when computing the initial solution profile. The value must be positive, and less than or equal to 110. The default value is 1100. This option is valid only when continuation has also been specified.
For some discussion of difficult BVP problems, and possible solutions, see dsolve[numeric_bvp,advanced].
Boolean that is true by default, and specifies that the solution should be refined until an interpolation of the solution gives the requested accuracy. When this is false, the solution is improved until only the discrete solution has the requested accuracy. Also see the output=mesh argument.
Results can be plotted by using the function odeplot in the plots package.
Linear boundary value problem:
dsol1 ≔ dsolve⁡ⅆ2ⅆx2⁢y⁡x−2⁢y⁡x=0,y⁡0=1.2,y⁡1=0.9,numeric
dsol1 ≔ procx_bvp...end proc
Nonlinear boundary value problem:
deq2 ≔ ⅆ2ⅆx2⁢y⁡x+2+y⁡x2⁢y⁡x1+y⁡x2=1
bc2 ≔ y⁡0=0,y⁡2=3:
dsol2 ≔ dsolve⁡deq2,bc2,numeric,output=listprocedure
dsol2≔x=procx...end proc,y⁡x=procx...end proc,ⅆⅆxy⁡x=procx...end proc
fy ≔ subs⁡dsol2,y⁡x
fy ≔ procx...end proc
Using BVP Solver for an IVP:
dsys3 ≔ ⅆⅆx⁢y⁡x−y⁡x=0,y⁡1=1
dsol3 ≔ dsolve⁡dsys3,numeric,method=bvp,range=0..1,abserr=1.⁢10-10
dsol3 ≔ procx_bvp...end proc
Boundary value problem with an unknown parameter:
dsys4 ≔ ⅆ2ⅆx2⁢y⁡x−a⁢y⁡x=0,y⁡0=1,y⁡1=1,D⁡y⁡0=2
dsol4 ≔ dsolve⁡dsys4,numeric,output=operator
dsol4≔x=procx...end proc,y=procx...end proc,D⁡y=procx...end proc,a=procx...end proc
Ascher, U.; Mattheij, R.; and Russell, R. "Numerical Solution of Boundary Value Problems for Ordinary Differential Equations." SIAM Classics in Applied Mathematics. Vol. 13. (1995).
Ascher, U., and Petzold, L. "Computer Methods for Ordinary Differential Equations and Differential-Algebraic Equations." SIAM, Philadelphia. 1998.
Download Help Document