numerically approximate the solution to a first-order initial-value problem - Maple Help

Home : Support : Online Help : Education : Student Package : Numerical Analysis : Visualization : Student/NumericalAnalysis/InitialValueProblem

Student[NumericalAnalysis][InitialValueProblem] - numerically approximate the solution to a first-order initial-value problem

 Calling Sequence InitialValueProblem(ODE, IC, t=b, opts) InitialValueProblem(ODE, IC, b, opts)

Parameters

 ODE - equation; first order ordinary differential equation of the form $\frac{ⅆ}{ⅆt}y\left(t\right)=f\left(t,y\right)$ IC - equation; initial condition of the form y(a)=c, where a is the left endpoint of the initial-value problem t - name; the independent variable b - algebraic; the point for which to solve; the right endpoint of this initial-value problem opts - (optional) equations of the form keyword=value, where keyword is one of method, submethod, numsteps, output, comparewith, digits, order, or plotoptions; options for numerically solving the initial-value problem

Description

 • Given an initial-value problem consisting of an ordinary differential equation ODE, a range a <= t <= b, and an initial condition y(a) = c, the InitialValueProblem command computes an approximate value of y(b).
 • If the second calling sequence is used, the independent variable t will be inferred from ODE.
 • The InitialValueProblem command computes its numeric solution using the specified method and submethod (if applicable). Options given in opts are also observed.
 • The endpoints a and b must be expressions that can be evaluated to floating-point numbers. The initial condition IC must be of the form y(a)=c, where c can be evaluated to a floating-point number.
 • The methods for numerically solving initial-value problems can be explored interactively with the InitialValueProblem tutor.

Notes

 • By their very nature, multi-step methods (such as the Adams methods) impose a minimum on the number of steps allowed. If numsteps is lower than this minimum, then the minimum will be used instead to determine the step size. In general, if $k$ previous function values are required to perform the multi-step method, then numsteps must be at least $k-1$.
 • This procedure operates using floating-point numerics; that is, inputs are first evaluated to floating-point numbers before computations proceed, and numbers appearing in the output will be in floating-point format.

Examples

 > $\mathrm{with}\left(\mathrm{Student}[\mathrm{NumericalAnalysis}]\right):$
 > $\mathrm{DE1}:=\frac{ⅆ}{ⅆt}y\left(t\right)=y\left(t\right)-{t}^{2}+1:$
 > $\mathrm{InitialValueProblem}\left(\mathrm{DE1},y\left(0\right)=0.5,t=3\right)$
 ${5.066}$ (1)
 > $\mathrm{InitialValueProblem}\left(\mathrm{DE1},y\left(0\right)=0.5,t=3,\mathrm{output}=\mathrm{Error}\right)$
 ${0.8916}$ (2)
 > $\mathrm{DE2}:=\frac{ⅆ}{ⅆt}y\left(t\right)=1-\mathrm{cos}\left(t\right):$
 > $\mathrm{DE3}:=\frac{ⅆ}{ⅆt}y\left(t\right)=y\left(t\right)-{t}^{2}+\frac{{t}^{3}}{9}:$

the order of the Taylor polynomial used by a Taylor method in the comparewith option can be specified as the second item in the list:

 > $\mathrm{InitialValueProblem}\left(\mathrm{DE2},y\left(1\right)=3.10,t=5,\mathrm{method}=\mathrm{rungekutta},\mathrm{submethod}=\mathrm{rkf},\mathrm{comparewith}=\left[\left[\mathrm{taylor},2\right]\right],\mathrm{output}=\mathrm{information},\mathrm{digits}=3\right)$
 $\left[\begin{array}{cccccc}{t}& \left[{\mathrm{Maple\text{'}s numeric solution}}\right]& \left[{\mathrm{R-K-F}}\right]& \left[{\mathrm{Error}}\right]& \left[{\mathrm{2nd-Ord. Taylor}}\right]& \left[{\mathrm{Error}}\right]\\ {1.}& {3.10}& {3.10}& {0.}& {3.10}& {0.}\\ {1.80}& {3.77}& {3.77}& {0.00238}& {3.74}& {0.03}\\ {2.60}& {5.03}& {5.03}& {0.00403}& {5.03}& {0.}\\ {3.40}& {6.60}& {6.60}& {0.00299}& {6.68}& {0.08}\\ {4.20}& {8.01}& {8.01}& {0.00305}& {8.17}& {0.16}\\ {5.}& {8.90}& {8.90}& {0.000395}& {9.09}& {0.19}\end{array}\right]$ (3)
 > $\mathrm{InitialValueProblem}\left(\mathrm{DE2},y\left(1\right)=3.10,t=5,\mathrm{method}=\mathrm{rungekutta},\mathrm{submethod}=\mathrm{rkf},\mathrm{comparewith}=\left[\left[\mathrm{taylor},1\right],\left[\mathrm{taylor},2\right]\right],\mathrm{output}=\mathrm{plot}\right)$
 > $\mathrm{InitialValueProblem}\left(\mathrm{DE3},y\left(0\right)=1,t=3,\mathrm{method}=\mathrm{taylor},\mathrm{order}=2,\mathrm{comparewith}=\left[\left[\mathrm{taylor},3\right],\left[\mathrm{adamsmoulton},\mathrm{step3}\right]\right],\mathrm{output}=\mathrm{plot}\right)$