dsolve/numeric/taylorseries - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Differential Equations : dsolve : numeric : Methods : dsolve/taylorseries

dsolve/numeric/taylorseries

numerical solution of ordinary differential equations

 

Calling Sequence

Parameters

Description

Examples

References

Calling Sequence

dsolve(odesys, numeric, method=taylorseries)

dsolve(odesys, numeric, method=taylorseries[choice], vars, options)

Parameters

odesys

-

set or list; ordinary differential equation(s) and initial conditions

numeric

-

literal name; instruct dsolve to find a numerical solution

method=taylorseries

-

literal equation; numerical method to use

choice

-

submethod to use

vars

-

(optional) dependent variable or a set or list of dependent variables for odesys

options

-

(optional) equations of the form keyword = value

Description

• 

The dsolve command with options numeric and method=taylorseries finds a numerical solution to the differential equations, using a Taylor series method. This method can be used for high accuracy solutions.

  

Note: This method usually takes more time than other methods for low accuracy results. Therefore, it is better to use this method only when a high accuracy solution is desired.

• 

There are two choices for the submethod. The lazyseries choice specifies that dsolve should construct a routine to generate the taylor series coefficients using lazy series expansion prior to any integration. This is the default, and generally the most efficient method. The series choice specifies that at each integration step dsolve,series be called to compute a local series expansion.

• 

The following options are available for the taylorseries method:

'output'

=

keyword or array

'known'

=

name or list of names

'startinit'

=

boolean

'abserr'

=

numeric

'minstep'

=

numeric

'order'

=

integer

'range'

=

l..r

'storage'

=

boolean

'steppast'

=

boolean

  

 

  

'output'

  

Specifies the desired output from dsolve .

  

 

  

'known'

  

Specifies user-defined known functions. Basic usage is discussed in dsolve[numeric]. As mentioned there, in addition to the requirement of a procedural definition for the function that evaluates with numeric arguments, this method also requires `diff/` rules.

  

This `diff/` rule must provide the total derivative of the function with respect to the independent variable. Note: The key word here is total, and an example can be found below. This is in contrast to the rosenbrock method, for which the diff rule must provide partial derivatives.

  

An arbitrary number of total derivatives are required, which means that if the derivative of a known function is provided in terms of another user-defined function, then that function must also have a `diff/` rule for computation of the total derivative with respect to independent variable. If again, this new user-defined function provides the total derivative in terms of another user-defined function, then it must also have a `diff/` rule for computation of the total derivative with respect to independent variable, ad nauseum.

  

The final requirement is that the 'known' option can only be used for the default taylorseries choice, namely lazyseries.

  

 

  

'startinit'

  

Indicates whether successive computations should use continuation from a previously computed result, or start from the initial condition for every requested solution value.

  

Note: The continuation is so that the direction of integration is never reversed, relative to the initial condition.

  

 

  

'abserr'

  

A positive floating-point number that controls the absolute error for any individual step. The default value is Float(1,-Digits).

  

 

  

'minstep'

  

A floating-point number that gives the minimum step size be used. The default value is 0.00001.

  

 

  

'order'

  

Specifies the order of taylor series expansion used in the integration. The default value is given by max(22,trunc(3*Digits/2)).

  

 

  

'range'

  

Specifies a range over which the solution is precomputed and stored. With this option, all returned solution values are computed from one of the stored taylor series expansions - one stored for each step of the method. Use of this option has the effect of turning storage on.

  

 

  

'storage'

  

Causes the method to store the solution for all computed steps, and use the taylor polynomial over any regions where a solution has previously been computed and stored. By default this is false.

  

 

  

'steppast'

  

Causes the method to use the natural step size (that is, the step size proscribed by the error control) when integrating the solution, even if that natural step size would place the independent variable value (internally) past the requested point. The solution is then computed from the taylor polynomial spanning the region containing the requested point. This is more efficient for dense output, and continuation of the solution past the requested point. By default this is true.

• 

Results can be plotted using the odeplot function in the plots package.

Examples

'listprocedure' output

Digits20:

dsys1ⅆⅆtxt=yt,ⅆⅆtyt=xt+yt,x0=2,y0=1

dsys1:=ⅆⅆtxt=yt,ⅆⅆtyt=xt+yt,x0=2,y0=1

(1)

dsol1dsolvedsys1,numeric,method=taylorseries,output=listprocedure,abserr=1.10-20:

dsol1xevalxt,dsol1:dsol1yevalyt,dsol1:

dsol1x0,dsol1y0

2.,1.

(2)

dsol1x0.4,dsol1y0.4

2.6911846499155574031,2.6081175867723888825

(3)

dsol1x1.0,dsol1y1.0

5.5821687260840732723,7.8268911966878259776

(4)

'array' output

dsola1dsolvedsys1,numeric,method=taylorseries,output=Array0,0.2,0.4,0.6,0.8,1,abserr=1.10-20

dsola1:=txtyt0.2.1.0.22.26583101007906083231.69011736881425090500.42.69118464991555740312.60811758677238888250.63.33027738839202266843.84523969015730942530.84.25882542465858062305.52710131705538946431.5.58216872608407327237.8268911966878259776

(5)

'procedurelist' output (the default)

dsys2D2xt=yt,D2yt=Dxt+yt

dsys2:=D2xt=yt,D2yt=Dxt+yt

(6)

init2x0=1,Dx0=0,y0=0,Dy0=1

init2:=x0=1,y0=0,Dx0=0,Dy0=1

(7)

dsol2dsolvedsys2∪init2,numeric,method=taylorseries,output=Array0,0.6,1.1,1.5,2.3,2.5,abserr=1.10-20:

dsol21,11=dsol22,16,1,dsol21,15=dsol22,16,5

t=2.5,ⅆⅆtyt=1.9487171722808526958

(8)

Digits30:

deqn3ⅆ3ⅆt3yt2ⅆ2ⅆt2yt+2yt

deqn3:=ⅆ3ⅆt3yt2ⅆ2ⅆt2yt+2yt

(9)

init3y0=1,Dy0=1,D2y0=1

init3:=y0=1,Dy0=1,D2y0=1

(10)

dsol3dsolvedeqn3∪init3,numeric,method=taylorseries,abserr=1.10-30:

dsol30.5

t=0.5,yt=1.61793485679327790141188491578,ⅆⅆtyt=1.43910267665026980485200277955,ⅆ2ⅆt2yt=0.587882166803234441848359099341

(11)

Using storage via 'range'

Digits20:

dsys4ⅆ2ⅆt2yt+yt,y0=0,Dy0=1

dsys4:=ⅆ2ⅆt2yt+yt,y0=0,Dy0=1

(12)

dsol4dsolvedsys4,numeric,method=taylorseries,abserr=1.10-20,range=0..10π

dsol4:=procx_taylorseries...end proc

(13)

Can now randomly access values in the specified range (for example, using fsolve) without cost of re-integrating:

fsolvet→rhsdsol4t2,3..4

3.1415926535897932385

(14)

evalfπ

0.

(15)

fsolvet→rhsdsol4t2,6..7

6.2831853071795864769

(16)

fsolvet→rhsdsol4t2,9..10

9.4247779607693797154

(17)

fsolvet→rhsdsol4t2,25..30

28.274333882308139146

(18)

Example of dense output with/without 'steppast'

dsol5adsolvedsys4,numeric,method=taylorseries,abserr=1.10-20

dsol5a:=procx_taylorseries...end proc

(19)

tttime:

forito100dodsol5aπi100end do:

timett

0.050

(20)

dsol5bdsolvedsys4,numeric,method=taylorseries,abserr=1.10-20,steppast=false

dsol5b:=procx_taylorseries...end proc

(21)

tttime:

forito100dodsol5bπi100end do:

timett

0.113

(22)

Comparison of 'lazyseries' and 'series' options:

dsys6t+12ⅆ2ⅆt2yt+t+1ⅆⅆtyt+t+120.25yt=0,y0=0.6713967071418030,Dy0=0.09540051444747446

dsys6:=t+12ⅆ2ⅆt2yt+t+1ⅆⅆtyt+t+120.25yt=0,y0=0.6713967071418030,Dy0=0.09540051444747446

(23)

ds1dsolvedsys6,numeric,method=taylorseries'series',abserr=1.10-20

ds1:=procx_taylorseries...end proc

(24)

tttime:

ds13.0

t=3.0,yt=0.30192051329163941472,ⅆⅆtyt=0.22302601251572382302

(25)

timett

0.487

(26)

ds1dsolvedsys6,numeric,method=taylorserieslazyseries,abserr=1.10-20

ds1:=procx_taylorseries...end proc

(27)

tttime:

ds13.0

t=3.0,yt=0.30192051329163941472,ⅆⅆtyt=0.22302601251572382302

(28)

timett

0.016

(29)

Use of the 'known' option for multiple argument functions (requires diff rule). Given the function

fx,yx=∫0xⅇt210010ⅆtyx

fx,yx=∫0x110ⅇ150tⅆtyx

(30)

define 'f' as

f := proc(x,y) local t;
   if not type(evalf(x),'numeric') or
      not type(evalf(y),'numeric') then
      'procname'(x,y);
   else
      evalf(Int(exp(-t*2/100)/10,t=0..x))-y;
   end if;
end proc;

f:=procx,ylocalt;ifnottypeevalfx,'numeric'andtypeevalfy,'numeric'then'procname'x,yelseevalfInt1/10*exp−1/50*t,t=0..xyend ifend proc

(31)

Also, use a `diff/` rule for the total derivative with respect to x. Note that the diff rule provides the total derivative in terms of Maple known functions, and the original f(x,y), for which a `diff/` rule is already defined.

`diff/f` := proc(x,y);
   if args[3]=x then
      diff(x,args[3])*exp(-x*2/100)/10-f(x,y);
   elif args[3]=y then
      error "should not happen";
   else
      error "unable to differentiate";
   end if;
end proc;

diff/f:=procx,yifargs[3]=xthen1/10*diffx,args[3]*exp−1/50*xfx,yelifargs[3]=ythenerrorshould not happenelseerrorunable to differentiateend ifend proc

(32)

Using this information you can now call dsolve to obtain a solution procedure, then obtain solution values.

dsoldsolveⅆⅆxyx=fx,yx,y0=0,numeric,known=f,method=taylorseries

dsol:=procx_taylorseries...end proc

(33)

dsol10

x=10.,yx=0.82280691286027374071

(34)

References

  

Barton, D.; Willers, I.M.; and Zahar, R.V.M. Mathematical Software, pp. 369-389. Edited by J.R. Rice. New York: Academic Press, 1972 .

See Also

dsolve[ck45]

dsolve[classical]

dsolve[dverk78]

dsolve[gear]

dsolve[lsode]

dsolve[numeric,IVP]

dsolve[numeric]

dsolve[rkf45]

dsolve[rosenbrock]

plots[odeplot]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam