updatesR4/numeric - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

Home : Support : Online Help : updatesR4/numeric

New Numerical Features That Have Been Added to Maple V for Release 4

 

Special functions:

Differential Equations:

Linear Algebra:

Numerical Approximation of Functions

Statistics:

Financial Calculations

Miscellaneous:

Special functions:

• 

Arbitrary precision evaluation, over the complex plane, of a wider range of special functions, including Elliptic and Inverse Elliptic, family of Bessel functions.

• 

Bessel family: AiryAi, AiryBi, BesselI, BesselJ, BesselK, BesselY, HankelH1, HankelH2, KelvinBer, KelvinBei, KelvinKer, KelvinKei, KelvinHer, KelvinHei, StruveH, StruveL, AngerJ, WeberE:

z:=evalf(1+2/3*I):

AiryAi(z), AiryBi(z);

(1)

 .1037571496 - .1044950325 I, .9630190393 + .5220371079 I

nu:=evalf(2/3+4/5*I):

BesselI(nu,z), BesselJ(nu,z), BesselK(nu,z), BesselY(nu,z);

(2)

 .7244935146 - .06234310868 I, .5109964553 - .1847149940 I,

     .3598077053 - .2438873156 I,

     -.5709515960 - .0002188584214 I

HankelH1(nu,z), HankelH2(nu,z);

(3)

 .5112153138 - .7556665900 I, .5107775969 + .3862366020 I

KelvinBer(nu,z), KelvinBei(nu,z), KelvinKer(nu,z), KelvinKei(nu,z),
KelvinHer(nu,z), KelvinHei(nu,z);

(4)

 -.8089166307 - 2.183698556 I, 2.267853794 - .8137995614 I,

     -1.776971141 - .9961751070 I,

     -1.078568331 + 1.766448520 I,

     -.6866379254 + 1.124556055 I,

     1.131254963 + .6341847698 I

StruveH(nu,z), StruveL(nu,z);

(5)

 .3106257308 + .01505583261 I, .3511670099 + .07163120875 I

AngerJ(nu,z), WeberE(nu,z);

(6)

 .8531469480 - .9735866595 I, .9933652429 + .3464383081 I

• 

FresnelC, FresnelS:

FresnelC(z),FresnelS(z);

(7)

 1.682212498 + .4016272750 I, .07110045109 + 1.175585852 I

• 

dawson:

dawson(z);

(8)

 .7494749046 - .1808917014 I

• 

Elliptic and Inverse Elliptic: EllipticK, EllipticE, EllipticPi, EllipticF, EllipticE, EllipticPi, EllipticCK, EllipticCE, EllipticCPi, EllipticNome

k:=-0.1+2.3*I:

  

Complete elliptic integrals of the first, second and third kind:

EllipticK(k),EllipticE(k),EllipticPi(nu,k);

(9)

 .9413942917 - .02100700736 I, 2.883535667 + .08445357415 I,

     .9032179896 + .4174342314 I

  

Incomplete elliptic integrals of the first, second and third kind:

EllipticF(z,k),EllipticE(z,k),EllipticPi(z,nu,k);

(10)

 .7242068410 + .3592870858 I, .4926925228 + 1.780640518 I,

     .5430830974 + .4039826151 I

  

Complementary complete elliptic integrals of the first, second and third kind:

EllipticCK(k),EllipticCE(k),EllipticCPi(nu,k);

(11)

 .6317085569 - .9674715411 I, .2138917976 + 1.929945189 I,

     EllipticCPi(.6666666667 + .8000000000 I, -.1 + 2.3 I)

  

Elliptic Nome:

q:=EllipticNome(k);

(12)

 q := -.1130622230 - .004343557919 I

• 

Jacobi Amplitude and  Elliptic functions: JacobiAM, JacobiSN, JacobiCN, JacobiDN, JacobiNS, JacobiNC, JacobiND, JacobiSC, JacobiCS, JacobiSD, JacobiDS, JacobiCD, JacobiDC

JacobiAM(z,k);

(13)

 -.1157677377 + .03628288589 I

JacobiSN(z,k), JacobiCN(z,k), JacobiDN(z,k);

(14)

 -.1155853604 + .03604793064 I,

     .9939602854 + .004191931060 I,

     -.9896343559 + .001229140163 I

JacobiNS(z,k), JacobiNC(z,k), JacobiND(z,k);

(15)

 -7.884711038 - 2.459026953 I, 1.006058520 - .004242954191 I,

     -1.010472657 - .001255021634 I

JacobiSC(z,k), JacobiCS(z,k);

(16)

 -.1161326869 + .03675675114 I, -7.826781562 - 2.477227297 I

JacobiSD(z,k), JacobiDS(z,k);

(17)

 .1168410872 - .03628038614 I, 7.806003418 + 2.423846140 I

JacobiCD(z,k), JacobiDC(z,k);

(18)

 -1.004364430 - .005483273379 I,

     -.9956248604 + .005435560172 I

• 

Jacobi Theta Functions: JacobiTheta1, JacobiTheta2, JacobiTheta3, JacobiTheta4

JacobiTheta1(z,q), JacobiTheta2(z,q),
JacobiTheta3(z,q), JacobiTheta4(z,q);

(19)

 1.200435806 - .4743634442 I, .01315436282 - 1.009987991 I,

     1.175151117 + .3717688097 I,

     .8212434354 - .3687317774 I

• 

Weierstrass P, P', zeta and sigma functions: WeierstrassP, WeierstrassPPrime, WeierstrassZeta, WeierstrassSigma

g2:=-0.11-0.7*I: g3:=0.22-0.4*I:

WeierstrassP(z,g2,g3), WeierstrassPPrime(z,g2,g3),
WeierstrassZeta(z,g2,g3), WeierstrassSigma(z,g2,g3);

(20)

 .4087407191 + .1175456787 I, .3493485143 + 1.127304153 I,

     .6741545534 - .4702886991 I,

     .9993746759 + .6595322132 I

• 

General Pochhammer function over the complex plane: pochhammer

pochhammer(1.0+0.2*I,-0.3+0.7*I);

(21)

 .5216047723 - .3157393579 I

Differential Equations:

  

Many extensions to dsolve/numeric extending Maple's power in developing numerical solutions to differential equations.

• 

Classical: dsolve[classical]

restart;

deq1 := diff(y(t),t$3)=y(t)+diff(x(t),t),diff(x(t),t$2)=
x(t)*y(t)-diff(y(t), t$2):

init1 := y(0)=1,D(y)(0)=2,(D@@2)(y)(0)=-1,x(0)=4,D(x)(0)=4.3:

ans1 := dsolve({deq1,init1},{x(t),y(t)},numeric,method=classical[abmoulton],
corrections=2):

ans1(1.0);

(22)

 [t = 1.0, x(t) = 13.1246093794391730,

     d

     -- x(t) = 18.7876915356564993,

     dt

     y(t) = 3.76283413231971675,

     d

     -- y(t) = 5.31760397612483793,

     dt

      2

     d

     --- y(t) = 10.2504683625320059]

       2

     dt

• 

Gear: dsolve[gear] - a C.W.Gear single-step extrapolation method.

Digits := 10:

deq1 := {diff(y(x), x$3) = y(x)*diff(y(x), x)-x}:

init1 := {(D@@2)(y)(1) = 4, D(y)(1) = 3, y(1) = 2.4 }:

ans1 := dsolve(deq1 union init1, y(x), type=numeric,
method=gear[polyextr], stepsize=0.015, minstep=Float(1,-11),
errorper=Float(1,-5)):

ans1(1.01);

(23)

 [x = 1.01, y(x) = 2.43020104070929621,

     d

     -- y(x) = 3.04031295467141982,

     dx

      2

     d

     --- y(x) = 4.06288854913227304]

       2

     dx

• 

Mgear: dsolve[mgear] -  a C.W.Gear multiple-step extrapolation method.

Digits := 12:

deq3 := diff(y(t), t$2) = 100*(exp(-10*t)+exp(10*t)):

ans3 := dsolve({deq3}, y(t), numeric, method=mgear[msteppart],
initial=array([2,0]), start=0):

Error, (in dsolve/numeric) the 'mgear' method has been removed, please use 'rosenbrock' or 'lsode' instead

ans3(0.7653);

(24)

 [t = .7653, y(t) = 2106.95826948761987,

     d

     -- y(t) = 21069.5691650687149]

     dt

• 

Lsode: dsolve[lsode] - the "Livermore Stiff ODE Solver"

Digits := 10:

deq1 := {diff(y(x), x$3) = y(x)*diff(y(x), x) - x }:

init1 := { (D@@2)(y)(1) = 4, D(y)(1) = 3, y(1) = 2.4 }:

ans1 := dsolve(deq1 union init1, y(x), type=numeric,
method=lsode[adamsfull]):

ans1(1.5);

(25)

 [x = 1.5, y(x) = 4.59316878380162308,

     d

     -- y(x) = 6.33685490613474300,

     dx

      2

     d

     --- y(x) = 11.0436021501494359]

       2

     dx

Linear Algebra:

• 

Numerical computations for matrix-decomposition routines: linalg[cholesky], linalg[QRdecomp], linalg[LUdecomp]

with(linalg):

A := matrix([[1.,2.,3.],[4.,5.,6.]]):

R := QRdecomp(A,Q='q',rank='r');

(26)

eval(q);

(27)

r;

(28)
• 

linalg[eigenvals], linalg[inverse]: use hardware floating-point when possible.

Numerical Approximation of Functions

• 

numapprox[chebmult]: Tools to manipulate Chebyshev series:

with(numapprox):  Digits:=3:

a:=chebyshev(sin(x),x):

b:=chebyshev(exp(x),x):

chebmult(a,b);

(29)

 .496 T(0, x) + 1.22 T(1, x) + .494 T(2, x) + .0728 T(3, x)

      - .00212 T(4, x) - .00227 T(5, x) - .000344 T(6, x)

                                -6

      - .0000390 T(7, x) + .5 10   T(8, x)

               -5                  -6

      + .137 10   T(9, x) + .136 10   T(10, x)

Statistics:

• 

ANOVA (oneway): stats[anova]

with(stats[anova],oneway):

  

example with variance ratio of 0.1 with 1 and 4 degrees of freedom. Level of significance is 0.23 < 0.95 (non-signif)

oneway( [ [1.0,2.0,3.0],[1.0,2.0,4.0] ] );

(30)
• 

least median of squares regression: fit[leastmediansquare]

with(stats[fit]):

leastmediansquare[[x,y]]( [[1,2,3,4],[2,3,5,5]] );

(31)

Financial Calculations

  

The package finance provides functions for calculations related to finance. Some of the functions are: annuity, cashflows, perpetuity.

  

Amortization table of a loan of 100 at 10% interest, with payments of 50 per period

A:=finance[ amortization ] ( 100, 50, .10 ):

amortization_table[N, Payment, Interest, Principal, Balance]=matrix(A[1]);

Error, (in linalg:-matrix) invalid argument Vector[row](5, [n,Payment,Interest,Principal,Balance])

 amortization_table[N, Payment, Interest, Principal, Balance

         [0     0       0      -100    100 ]

     ] = [1     50     10.0    40.0    60.0]

         [2     50     6.00    44.0    16.0]

         [3    17.6    1.60    16.0     0  ]

cost_of_loan:=A[2];

(32)

Miscellaneous:

• 

The routines factor, convert/parfrac, resultant and content have been extended to handle floating points (for content, it just works for simple cases).

f := (2.3*x)/(5.4*x^3-2.3*x+1):

convert(f,parfrac,x);

(33)

     .224            .344 + 1.21 x

 - -------- + .185 ------------------

   x + .809         2

                   x  - .810 x + .229

factor(x^3+5.0);

(34)

              2

 (x + 1.71) (x  - 1.71 x + 2.92)

resultant( 1.1*x+1.2, 1.3*x+1.4, x);

(35)

content( 5.4*x*y, x);

(36)
• 

The routine Maple_floats computes the values of various parameters and constants associated with the arbitrary precision floating point computation environment.

readlib(Maple_floats):

Maple_floats(MAX_FLOAT);

(37)

      2147483647

 .9 10

Maple_floats(sqrt(MAX_FLOAT)/LN_MAX_FLOAT);

(38)

               1073741814

 .6067023828 10


Download Help Document