New features that have been added to Maple for version V release 2
|
-------------------------------------------------------------------
|
Development of Improved User Interfaces
|
=======================================
|
New user interfaces which include as a minimum 2 and 3-dimensional graphics,
|
and some command line editing facility have been designed since the release
|
of Maple V for the X Window system, Sunview, PC MS/DOS, Macintosh, Amiga DOS,
|
Vax VMS, NeXT, and the PC under Windows. The new user interfaces for Maple V
|
release 2 will include worksheets, real mathematical formulae output,
|
and a help browser.
|
1: Maple Worksheets
|
-------------------
|
Beginning with the Macintosh user interface for Maple V, the new user
|
interfaces will all support the concept of a "worksheet" which integrates text,
|
Maple input commands, Maple output, and graphics into one document. Worksheets
|
have been standardized and are being ported to other platforms for release 2,
|
notably X windows. They provide editable input and text fields, simple
|
commands for recalculating parts of worksheets etc. A collection of examples
|
of applications of Maple will be now be distributed in the form of worksheets.
|
A new save facility is being added that will also save the state of a worksheet
|
as well as the display.
|
2: Two-dimensional output
|
-------------------------
|
Beginning with release 2 of the X Window interface, new interfaces will
|
display output using mathematical, Greek, and italics fonts for improved
|
display of mathematical formulae.
|
3: Help topic browser
|
---------------------
|
Beginning with Sunview user interface in Maple V, new user interfaces will
|
include a help browser for accessing the on-line help information.
|
4: Unix Maple interface
|
-----------------------
|
Now supports command line editing using a vi and emacs like editor.
|
Hitting the interrupt key Ctrl-C twice will no longer kill a Maple session, it
|
will only interrupt the current calculation. The quit key Ctrl-can be used
|
to immediately kill the Maple session. Also, running a Maple session in a
|
shell under the X Window system, interface(plotdevice=x11); will allow you to
|
access the X plotting facilities.
|
5: X Window interface
|
---------------------
|
The interface has been redesigned to follow Motif style conventions. The help
|
index is accessible from a menu. The user input fields and the Maple output
|
fields are completely separated.
|
6: Improved error messages
|
--------------------------
|
The new type checking facility results in better error messages, e.g.
|
> f := proc(n:integer) if n < 0 then 0 else n fi end:
|
> f(x);
|
Error, f expects its 1st argument, n, to be of type integer, but received x
|
Graphics
|
========
|
The Maple plotting facility consists of two parts, the rendering of the picture
|
which is written in C, and the point generation which is done in Maple. The
|
basic 2 dimensional plotting command is plot(f(x),x=a..b); It creates a
|
PLOT data structure which is then displayed. The 3 dimensional plotting command
|
is plot3d(f(x,y),x=a..b,y=c..d); It creates a PLOT3D data structure.
|
Thus the PLOT and PLOT3D data structures define the what can be displayed.
|
Details on these data structures can be obtained from ?plot3d,structure
|
1: Improvements to rendering and the PLOT and PLOT3D data structures
|
--------------------------------------------------------------------
|
- better (more robust but slower) hidden line removal algorithm
|
- the PLOT3D data structure supports text and polygon primitives
|
- PLOT and PLOT3D include support for 2 and 3 D frame sequence animation
|
- the PLOT3D data structure supports a contour plot style option,
|
which is also accessible interactively from the style menu
|
- The plotting primitives in the PLOT and PLOT3D data structures have
|
been made more flexible e.g. each object can have its style and
|
color assigned individually.
|
- a wider choice of colors, with more user control of surface coloring
|
(PLOT3D).
|
- addition of Lighting models
|
- We have also made the PLOT and PLOT3D data structures compatible.
|
2: Device support
|
-----------------
|
- encapsulated postscript, color postscript and grayscale shading postscript
|
output are now supported
|
- addition of HP Laserjet output
|
- a wider selection of output devices for PLOT3D are supported in particular
|
any device that is supported in 2 dimensions including tektronics, i300
|
imagen laser printer, Unix plot, DEC ln03 laser printer etc.
|
3: New plotting facilities and improvements (plots package)
|
-----------------------------------------------------------
|
This is a list of the new plotting tools. All are written in Maple, making
|
use of the PLOT and PLOT3D data structures. For details see the section
|
on the plots package in the section on the Library Packages.
|
- 2d and 3d animation
|
- 2d and 3d implicit plotting
|
- 2d and 3d vectorfield and gradient plots
|
- Density plots
|
- Plotting of dsolve(..,numeric) procedures in ODEplot
|
- Plotting of polygons and polyhedra
|
- Log and log-log plots e.g.
|
- Phase portraits and direction field plots, plotting of 1-st order and
|
2-nd order differential equations (in DEtools package)
|
- Ability to specify color function for objects in plot3d, tubeplot,
|
vectorfield and gradient plots, etc.
|
New and Enhanced Mathematical Facilities
|
========================================
|
1: New Mathematical functions known to Maple
|
--------------------------------------------
|
- The floor and ceiling functions floor(x) and ceil(x)
|
- The Elliptic integrals where 0<k<1 and let c = sqrt(1-k^2)
|
LegendreE(x,k) = int( (1-k^2*t^2)/sqrt(1-t^2)/sqrt(1-k^2*t^2), t=0..x )
|
LegendreEc(k) = int( (1-k^2*t^2)/sqrt(1-t^2)/sqrt(1-k^2*t^2), t=0..1 )
|
LegendreEc1(k) = int( (1-k^2*t^2)/sqrt(1-t^2)/sqrt(1-c^2*t^2), t=0..1 )
|
LegendreF(x,k) = int( 1/sqrt(1-t^2)/sqrt(1-k^2*t^2), t=0..x )
|
LegendreKc(k) = int( 1/sqrt(1-t^2)/sqrt(1-k^2*t^2), t=0..1 )
|
LegendreKc1(k) = int( 1/sqrt(1-t^2)/sqrt(1-c^2*t^2), t=0..1 )
|
LegendrePi(x,k,a) = int( 1/(1-a*t^2)/sqrt(1-t^2)/sqrt(1-k^2*t^2), t=0..x )
|
LegendrePic(k,a) = int( 1/(1-a*t^2)/sqrt(1-t^2)/sqrt(1-k^2*t^2), t=0..1 )
|
LegendrePic1(k,a) = int( 1/(1-a*t^2)/sqrt(1-t^2)/sqrt(1-c^2*t^2), t=0..1 )
|
- Routines for complex numbers Re(z), Im(z), argument(z), conjugate(z), csgn(z)
|
- Routines for computing the magnitude of a number ilog[b](x), ilog10(x)
|
- Utility routine polar(z) to allow computing with complex numbers in polar
|
form i.e. polar(a,b) = a cos(b) + I a sin(b)
|
- The logarithmic integral Li(x) = Ei(ln(x) for x > 1
|
- The exponential integrals Ei(n,x) = int(exp(t)/t^n,t=1..infinity) for
|
Re(x)>0; extended by analytic continuation to the entire complex plane
|
except for 0 when n=1). Note Ei(x) is the Cauchy principle value.
|
- Ssi(x) the shifted sine integral
|
- W(n,x), the W function satisfying exp(W(x))*W(x) = x where n, any integer
|
specifies a branch cut. Note W(x) is the principle branch
|
- erfc(n,x) = int(erfc(n-1,t),t=x..infinity), for n=1,2,... where
|
erfc(0,x) = erfc(x). Note erfc(n,z) corresponds to "i^n erfc z" notation
|
in Abramowitz & Stegun
|
- The derivatives of signum, csgn, trunc, frac, round, floor, ceil implemented
|
as signum(1,x), csgn(1,x) etc.
|
2: Enhanced numerical facilities
|
--------------------------------
|
- automatic complex numerical arithmetic, i.e. +, -, *, /, ^
|
- extend evalf to the complex domain for all elementary functions and erf(z),
|
erfc(z), erfc(n,z), GAMMA(z), GAMMA(a,z) (incomplete Gamma function),
|
Beta(u,v), Psi(z), Psi(n,z), W(z), W(n,z) (all branches), Ei(z),
|
Ci(z), Si(z), Chi(z), Shi(z), Ssi(z)
|
- Dawson's integral dawson(x) = exp(-x^2) * int(exp(t^2),t=0..x)
|
- Elliptic integrals, LegendreE(x,k), LegendreEc(k), LegendreEc1(k),
|
LegendreF(x,k), LegendreKc(k), LegendreKc1(k), LegendrePi(x,k,a),
|
LegendrePic(k,a), LegendrePic1(k,a)
|
- Li(x) = Ei(ln(x) the logarithmic integral defined only for real x > 1
|
- fsolve has a new algorithm for solving a univariate polynomial over R or C
|
which should always succeed and, all digits should be accurate to 0.6 ulps.
|
- Addition of the remez algorithm for minimax rational function approximation
|
- Addition of an adaptive double exponential algorithm for numerical integration
|
- Addition of Levin's u transform for the numerical evaluation of infinite
|
sums, products and limits
|
- The routines gauselim, gaussjord, rowspace, colspace, eigenvals, eigenvects,
|
inverse, det, in the linalg package now all handle matrices of floating point
|
and complex floating point entries
|
3: Algebraic numbers and algebraic functions
|
--------------------------------------------
|
The evala facility in Maple V supports polynomial operations over algebraic
|
number fields. This facility is used in indefinite integration, eigenvectors,
|
and solving polynomial equations. E.g. Maple can factor the polynomial
|
3 1/2 2 1/2 1/2
|
x + (- 28 + 16 2 ) x + (- 288 2 + 384) x - 1792 + 1280 2
|
over the algebraic number field Q(sqrt(2)) as follows
|
> a := x^3+(-28+16*sqrt(2))*x^2+(-288*sqrt(2)+384)*x-1792+1280*sqrt(2):
|
> factor(a,sqrt(2));
|
1/2 1/2
|
(x - 8) (x - 8 + 8 2 ) (x - 12 + 8 2 )
|
Because Maple can do this factorization, it means Maple can compute the
|
eigenvalues (also the eigenvectors -- see below) of the following matrix, e.g.
|
> A := matrix( [[5-5*sqrt(2), -2+4*sqrt(2), 5+sqrt(2)],
|
> [-5+sqrt(2), 10-4*sqrt(2), 3+3*sqrt(2)],
|
> [-3+3*sqrt(2), -2+4*sqrt(2), 13-7*sqrt(2)]] ):
|
> eigenvals(A);
|
1/2 1/2
|
8, 12 - 8 2 , 8 - 8 2
|
The generalization of the evala facility to algebraic functions in Maple V
|
release 2 means that we can replace the sqrt in the above problem by a sqrt of
|
a formula and not just an integer, e.g. sqrt(a). Many parts of Maple work
|
better because of this. The examples in the following sections on integration,
|
polynomial factorization, and symbolic eigenvectors, Norms and Traces, etc.
|
illustrate other new capabilities in Maple which build on this facility.
|
4: Polynomial factorization over algebraic number and function fields
|
---------------------------------------------------------------------
|
Maple V can factor multivariate polynomials over the rational numbers Q and
|
univariate polynomials over algebraic number fields Q(alpha) as in the above
|
example. Maple V release 2 can factor multivariate polynomials over
|
algebraic number fields. For example let's factor the polynomial x^6+y^6
|
first over the rationals Q then over Q(i) i.e. the complex rationals.
|
> factor(x^6+y^6);
|
2 2 4 2 2 4
|
(x + y ) (x - x y + y )
|
> factor(x^6+y^6,I);
|
2 2 2 2
|
(x - I x y - y ) (x + I x y - y ) (x - I y) (x + I y)
|
Maple V release 2 can also factor multivariate polynomials over algebraic
|
function fields e.g. let's factor the following polynomial over Q(sqrt(a)).
|
> f := x^3 + (16*a^(1/2)-28)*x^2 + (64*a-288*a^(1/2)+256)*x
|
> -512*a+1280*a^(1/2)-768:
|
> factor(f,sqrt(a));
|
1/2 1/2
|
(x - 12 + 8 a ) (x + 8 a - 8) (x - 8)
|
Two new factorization routines split and AFactor have been added to the
|
library. split(a,x) factors a univariate polynomial in x into linear factors
|
over its splitting field. evala(AFactor(a)) does a complete factorization
|
of a multivariate polynomial, i.e. over the algebraic closure of Q, e.g.
|
> evala(AFactor(x^2-2*y^2));
|
2 2
|
(x - RootOf(_Z - 2) y) (x + RootOf(_Z - 2) y)
|
The RootOf value that you see in the output above is Maples notation for
|
the algebraic numbers which are the solutions to the polynomial equation
|
_Z^2 - 2 = 0. In this case, the solutions are +- sqrt(2), i.e. they can
|
be written in terms of exact radicals. The user can convert from (and to)
|
the RootOf notation to the radical notation using the convert function
|
> convert(",radical);
|
1/2 1/2
|
(x - 2 y) (x + 2 y)
|
5: Symbolic Eigenvalue and Eigenvector computation.
|
---------------------------------------------------
|
The eigenvector routine linalg[eigenvects] returns the eigenvectors of a matrix
|
represented exactly in terms of the roots of the characteristic polynomial.
|
For example, for our matrix A used previously, we obtain the eigenvectors
|
> A := matrix( [[5-5*sqrt(2), -2+4*sqrt(2), 5+sqrt(2)],
|
> [-5+sqrt(2), 10-4*sqrt(2), 3+3*sqrt(2)],
|
> [-3+3*sqrt(2), -2+4*sqrt(2), 13-7*sqrt(2)]] ):
|
> eigenvects(A);
|
1/2 1/2 1/2
|
[8 - 8 2 , 1, {[ -1, - 2 , 1 ]}], [12 - 8 2 , 1, {[ 1, -1, 1 ]}],
|
[8, 1, {[ 1, 1, 1 ]}]
|
The output is a sequence of lists [e,m,b] where e is the eigenvalue, m
|
its multiplicity, and b a basis for the eigenspace for e. In Maple V, the
|
eigenvects command could handle algebraic numbers, including rational numbers.
|
Now it can handle algebraic functions, hence matrices of polynomials, e.g.
|
> A := matrix(4,4,[[a,a,a,0], [b,b,0,c], [b,0,c,c], [0,a,a,a]]);
|
[ a a a 0 ]
|
[ ]
|
[ b b 0 c ]
|
A := [ ]
|
[ b 0 c c ]
|
[ ]
|
[ 0 a a a ]
|
> factor(charpoly(A,x));
|
3 2 2 2 2 2
|
(x - a) (x - x a - c x - b x + b c x - c a x - b x a + c a + b a + a b c)
|
> alias(alpha=RootOf(op(2,"),x)): # Denote the roots of the cubic by alpha
|
> eigenvects(A);
|
[a, 1, {[ - c/b, 0, 0, 1 ]}],
|
2
|
2 b a - alpha + alpha c + alpha a + c a
|
[alpha, 1, {[ 1, - ----------------------------------------,
|
a (b - c)
|
2
|
b a + alpha b - alpha + alpha a + 2 c a
|
----------------------------------------, 1 ]}]
|
a (b - c)
|
Note: the optional argument 'radical' to the eigenvects command can asks Maple
|
to express roots of polynomials as exact radicals where possible instead of in
|
terms of the RootOf representation.
|
6: ODEs with Bessel and Hypergeometric function solutions
|
---------------------------------------------------------
|
Many more cases are handled with a better algorithm, which gives results
|
in terms of Bessel functions rather than hypergeometric functions, e.g.
|
> diff(y(x),x,x) + (4*k+1)/(x+2)*diff(y(x),x) + (4*(x+2)^6 + 3/(x+2)^2)*y(x);
|
/ d
|
/ 2 (1 + 4 k) |---- y(x)|
|
| d | dx / / 6 3
|
|----- y(x)| + --------------------- + |4 (x + 2) + --------| y(x)
|
| 2 | x + 2 | 2|
|
dx / (x + 2) /
|
> dsolve(",y(x));
|
(- 2 k) 2 1/2 4
|
y(x) = (x + 2) (_C1 BesselJ(1/4 (4 k - 3) , 1/2 (x + 2) )
|
2 1/2 4
|
+ _C2 BesselY(1/4 (4 k - 3) , 1/2 (x + 2) ))
|
7: Symbolic Fourier transform
|
-----------------------------
|
The call fourier(f(s),s,w) computes the fourier transform
|
infinity
|
/
|
| - I t w
|
F(w) = | f(t) e dt
|
|
|
/
|
- infinity
|
For example,
|
> fourier(s,s,w);
|
2 I Pi Dirac(1, w)
|
> fourier(1/(4 - I*t)^(1/3),t,w);
|
1/2
|
3 GAMMA(2/3) exp(- 4 w) Heaviside(w)
|
---------------------------------------
|
2/3
|
w
|
8: New limit algorithm
|
----------------------
|
The idea behind the new algorithm is the following. First locate the most
|
varying part of the expression. Treat this indeterminate as a symbol and
|
compute a series expansion in this symbol alone. If there is no constant
|
coefficient in the resulting series, you are done, otherwise, recurse on
|
that constant coefficient. Here are some examples
|
> f := exp(exp(exp(Psi(Psi(Psi(n))))))/n;
|
exp(exp(exp(Psi(Psi(Psi(n))))))
|
f := -------------------------------
|
n
|
> limit(f,n=infinity);
|
0
|
> f := n*(GAMMA(n-1/GAMMA(n))-GAMMA(n)+ln(n));
|
/ 1
|
f := n |GAMMA(n - --------) - GAMMA(n) + ln(n)|
|
GAMMA(n) /
|
> limit( f, n=infinity );
|
1/2
|
9: Symbolic simplifications for min, max, trunc, round, ceil, floor, Re, Im
|
---------------------------------------------------------------------------
|
These routines now do quite a number of symbolic simplifications.
|
Note, interval arithmetic is used by the signum function in these examples
|
to prove that the constant Pi < sqrt(10) and that cos(2) < 0.
|
> min( min(Pi,sqrt(10)), min(a+1,a-1), a );
|
min(Pi, a - 1)
|
> Re( ln(Pi-sqrt(10)) + sqrt(cos(2)) );
|
1/2
|
ln(- Pi + 10 )
|
10: Norms and Traces in algebraic number and function fields
|
------------------------------------------------------------
|
Norm(alpha,L,K) and Trace(alpha,L,K) compute the norm (trace) of an algebraic
|
number or function in L over field K. I.e. the input is over the field L and
|
the output is over the field K a subfield of L. The fields L and K are
|
specified by sets of RootOf's which define the field extensions. For example
|
> alias( s2 = RootOf(x^2-2=0), s3 = RootOf(x^2-3=0) ):
|
> L := {s2,s3}: # so L = Q(sqrt(2),sqrt(3)) and
|
> K := {s2}; # K = Q(sqrt(2))
|
> evala(Trace(x-s2-s3,L,K));
|
2 x - 2 s2
|
> evala(Norm(x-s2-s3,L,K));
|
2
|
x - 2 s2 x - 1
|
> evala(Norm(x-s2-s3)); # K = Q
|
4 2
|
x - 10 x + 1
|
11: Computing with field extensions: Indep, Primfield
|
-----------------------------------------------------
|
These are tools for computing with nested field extensions. Indep(L) searches
|
for relations between between the set of field extensions (RootOfs) L.
|
Primfield(L,K) computes a primitive element alpha for a set of field
|
extensions L over the subfield K of L, e.g.
|
> evala(Primfield({s2,s3}));
|
3 3
|
[ [%1 = s3 + s2], [s3 = 11/2 %1 - 1/2 %1 , s2 = - 9/2 %1 + 1/2 %1 ]]
|
4 2
|
%1 := RootOf(_Z - 10 _Z + 1)
|
The result is a list of two elements. The first element defines the primitive
|
element alpha as a RootOf the minimal polynomial over K. We see that the
|
minimal polynomial in this example is x^4-10*x^2+1. It equates alpha in terms
|
of L, i.e. here alpha = sqrt(3)+sqrt(2). The second entry expresses the field
|
extensions of K in terms of alpha. Here sqrt(2) = alpha^3/2-9*alpha/2, and
|
sqrt(3) = 11/2*alpha-alpha^3/2.
|
12: Continued fractions
|
-----------------------
|
The cfrac routine in the numtheory package now computes continued fraction
|
expansions for real numbers, polynomials, series, and formulae. Several forms
|
are available including simple, regular, simregular, etc. The utility routines
|
nthconver, nthnumer, nthdenom return the nth convergent, numerator, denominator
|
e.g. here is the continued fraction for Pi, and the first few convergents
|
> with(numtheory):
|
> cf := cfrac(Pi,5);
|
1
|
cf := 3 + --------------------------
|
1
|
7 + ----------------------
|
1
|
15 + -----------------
|
1
|
1 + -------------
|
1
|
292 + -------
|
1 + ...
|
> seq( nthconver(cf,i), i=0..5 );
|
333 355 103993 104348
|
3, 22/7, ---, ---, ------, ------
|
106 113 33102 33215
|
> cf := cfrac(exp(x),x,4,simregular);
|
x
|
cf := 1 + -------------------------------
|
x
|
1 - 1/2 -----------------------
|
x
|
1 + 1/6 ---------------
|
x
|
1 - 1/6 -------
|
1 + ...
|
> seq(nthconver(cf,i),i=0..3);
|
2
|
1 + 1/2 x 1 + 2/3 x + 1/6 x
|
1, 1 + x, ---------, ------------------
|
1 - 1/2 x 1 - 1/3 x
|
13: Diophantine approximation
|
-----------------------------
|
The functions minkowski and kronecker in the number theory package solve
|
the linear diophantine approximation problem, namely, given real or p-adic
|
numbers a[i][j] and epsilon[i], and m equations of the form
|
|| sum( a[i][j]*x[j], j=1..m ) || <= epsilon[i], for i=1..m
|
where || z || means, in the real case, the distance between z and the nearest
|
integer z, for p-adic case || z || means p-adic valuation (see function valuep
|
in padic package), solve for integers x[j]. I.e. find integers x[j] and y[i]
|
such that abs( sum(a[i][j]*x[j],j=1..n) - y[i] ) <= epsilon[i] for i=1..m
|
(in the real case). This homogeneous case is solved by the minkowski function
|
where the equations are input in the form
|
abs( sum( a[i][j]*x[j], j=1..m ) - y[i] ) <= epsilon[i], for i=1..m
|
For example
|
> eqn1 := abs( E*x1 + 2^(1/2)*x2 - y1 ) <= 10^(-2):
|
> eqn2 := abs( 3^(1/3)*x1 + Pi*x2 - y2 ) <= 10^(-4):
|
> minkowski( {eqn1,eqn2}, {x1,x2}, {y1,y2} );
|
[x1 = 7484], [x2 = -2534], [y1 = 16760], [y2 = 2833]
|
The non-homogeneous case (more difficult) i.e. for real or p-adic alpha[i],
|
equations of the form
|
|| sum( a[i][j]*x[j], j=1..n ) + alpha[i] || <= epsilon[i], for i=1..m
|
are solved by the kronecker function.
|
New and Enhanced Integration Facilities
|
=======================================
|
1: Dirac and Heaviside
|
----------------------
|
Integration now knows about the Heaviside and Dirac functions, e.g.
|
> int(f(x)*Dirac(x),x=-infinity..infinity);
|
f(0)
|
> int(f(x)*Heaviside(x),x=-3..4);
|
4
|
/
|
|
|
| f(x) dx
|
|
|
/
|
0
|
2: Elliptic integrals
|
---------------------
|
Integration now recognizes Elliptic integrals and reduces them to a normal
|
form in terms of Legendre functions
|
> f := sqrt( (1-x^2) * (1/25 + x^2/4) );
|
2 1/2 2 1/2
|
f := 1/10 (1 - x ) (4 + 25 x )
|
> int(1/f,x=1/2..1);
|
10 1/2 1/2 1/2
|
---- 29 LegendreF(1/2 3 , 5/29 29 )
|
29
|
> evalf(");
|
2.327355206
|
3: Algebraic functions
|
----------------------
|
Integration of algebraic functions is now using the Risch-Trager algorithm.
|
This includes a full implementation of the algebraic part including integrands
|
which involve parameters and algebraic numbers, e.g.
|
> alias(alpha=RootOf(y^3-x^2-a,y); # i.e. alpha = (x^2+a)^(1/3)
|
> f := (4*alpha^2*x^3+(5*x^4+3*x^2*a)*alpha-3*x^2-3*a)/(x^2+a)/x^2;
|
2 3 4 2 2
|
4 alpha x + (5 x + 3 x a) alpha - 3 x - 3 a
|
f := ------------------------------------------------
|
2 2
|
(x + a) x
|
> int(f,x);
|
x - 1 2
|
- 3 ----- + 3 x alpha + 3 alpha
|
x
|
and an implementation of the transcendental part for algebraic functions
|
which do not contain parameters, e.g.
|
> alias(alpha=RootOf(y^2-x^3-1,y)); # i.e. beta = sqrt(x^3+1)
|
> f := (3*x^4-6*x^3+5*x^2-2*x+2)/(x^5-2*x^4-x+2*x^3+1)*beta
|
> +(3*x^4+5*x^2-5*x^3-2*x)/(x^5-2*x^4-x+2*x^3+1);
|
4 3 2 4 2 3
|
(3 x - 6 x + 5 x - 2 x + 2) beta 3 x + 5 x - 5 x - 2 x
|
f := ----------------------------------- + ------------------------
|
5 4 3 5 4 3
|
x - 2 x - x + 2 x + 1 x - 2 x - x + 2 x + 1
|
> int(f,x);
|
2 3
|
x + x + 1 - 2 x beta
|
2 beta - ln(----------------------)
|
3 2 2
|
(x - x + 1)
|
4: Integration of the W function
|
--------------------------------
|
Indefinite integration now uses an inverse function transformation to
|
transform integrals involving the W function (where note W(x) is the function
|
defined to satisfy exp(W(x))*W(x)=x ) of linear arguments to elementary
|
functions, hence the following integrals are computed
|
> int(x/W(x),x);
|
2 2
|
x x
|
1/2 ---- + 1/4 -----
|
W(x) 2
|
W(x)
|
> int(1/W(x),x);
|
x
|
---- - Ei(1, - W(x))
|
W(x)
|
5: The Exponential integral, error function, and related integrals
|
------------------------------------------------------------------
|
Indefinite integration of the forms g(x)*sin(f(x)) and g(x)*cos(f(x)) where
|
g(x) is a rational function in x and f(x) is a quadratic polynomial in x are
|
expressed in terms of the Fresnel integrals FresnelC(x) and FresnelS(x),
|
and the cosine and sine integrals Ci(x) and Si(x). Note, Maple V can do
|
these examples, but the answer involves complex error functions and
|
Exponential integrals of complex arguments
|
> int( 5*x^4*sin(2*x^2+1), x );
|
3 2 15 2
|
- 5/4 x cos(2 x + 1) + ---- x sin(2 x + 1)
|
16
|
15 1/2 / x x
|
- ---- Pi |cos(1) FresnelS(2 -----) + sin(1) FresnelC(2 -----)|
|
32 | 1/2 1/2 |
|
Pi Pi /
|
> int( sin(u*x^2-v)/x, x );
|
2 2
|
1/2 cos(v) Si(u x ) - 1/2 sin(v) Ci(u x )
|
6: New classes of definite integrals
|
------------------------------------
|
Several new classes of infinite indefinite integrals are now handled.
|
These are computed by evaluating derivatives of special functions
|
and exploiting symmetry. For example, for p>0 and q>0, the class
|
infinity
|
/
|
| (a - 1) s q
|
| x exp(- p x - ----) dx
|
| s
|
/ x
|
0
|
in general can be expressed in terms of the Bessel K function e.g.
|
> assume(p>0);
|
> assume(q>0);
|
> int( x^2*exp(-p*x^3-q/x^3), x=0..infinity );
|
1/2 1/2 1/2
|
q BesselK(1, 2 p q )
|
2/3 -------------------------------
|
1/2
|
p
|
Note, the appearance of p and q in this answer indicates that assumptions
|
about p and q have been made.
|
Also, several classes involving Bessel functions e.g. for u>0,v>0, the class
|
infinity
|
/
|
| s w s/2
|
| exp(- u t ) t BesselJ(v, c t ) dt
|
|
|
/
|
0
|
in general results in 1 F 1, the confluent hypergeometric function, e.g.
|
> int( exp(-t)*t^2*BesselJ(1,sqrt(t)), t=0..infinity );
|
15 1/2
|
---- Pi hypergeom([7/2], [2], -1/4)
|
16
|
Also classes involving the error functions, e.g. for u>0
|
> assume(u>0);
|
> Int( exp(-u*x^2)*erf(b*x), x=0..infinity ) =
|
> int( exp(-u*x^2)*erf(b*x), x=0..infinity );
|
b
|
infinity arctan(-----)
|
/ 1/2
|
| 2 u
|
| exp(- u x ) erf(b x) dx = -------------
|
| 1/2 1/2
|
/ Pi u
|
0
|
7: Handling singularities in an indefinite integral
|
---------------------------------------------------
|
Definite integration now uses a new algorithm to resolve integrals which have
|
discontinuities (removable or non-removable) in the result from indefinite
|
integration. For example,
|
> int( 1/(5+3*cos(x)), x=0..13*Pi/2 );
|
1/2 arctan(1/2) + 3/2 Pi
|
This result was obtained by first computing the indefinite integral
|
> int( 1/(5+3*cos(x)), x );
|
1/2 arctan(1/2 tan(1/2 x))
|
then by taking limits given the following information about the discontinuities
|
> readlib(discont)(",x);
|
{2 Pi _Z1 + Pi}
|
A second example showing that Maple can prove that this integral diverges,
|
instead of returning unevaluated -- meaning I don't know.
|
> int(1/x^2,x=-1..1);
|
infinity
|
Also, the addition of the CauchyPrincipalValue option to int handles this one
|
> int( 1/x, x=-1..1, CauchyPrincipalValue);
|
0
|
> int( exp(-t)/t, t=-2..infinity, CauchyPrincipalValue );
|
- Ei(2)
|
8: Numerical integration uses exponential quadrature
|
----------------------------------------------------
|
An adaptive, double-exponential routine has been implemented to handle
|
those integrals for which the default Clenshaw-Curtis quadrature routine
|
(based on Chebyshev series) does not succeed. This new routine replaces the
|
use of an 8'th order adaptive Newton-cotes routine, which, being a fixed
|
order method, does not perform well at high precision.
|
9: User interface for indefinite integration
|
--------------------------------------------
|
An interface for indefinite integration has been added to allow users to
|
teach Maple about how to compute the indefinite integral of an expression f(x)
|
involving the function g(x) by writing a Maple procedure for `int/g` just as
|
one would write `diff/g` for differentiating g(x). The call int(g(x),x) will
|
result in the calling `int/g`(f(_X)) i.e. the whole expression in terms of
|
the global _X will be passed to `int/g`. The routine should return FAIL if
|
it cannot compute the integral.
|
New and Enhanced System Facilities
|
==================================
|
1: Type declarations for parameters
|
-----------------------------------
|
Procedures accept type declarations as illustrated by the following example.
|
The purpose of this facility note is to encourage better type checking.
|
proc( a:t )
|
....
|
end
|
is equivalent to writing
|
proc(a)
|
if nargs > 0 and not type(a,'t') then ERROR(message) fi;
|
....
|
end
|
Note, the type checking is not static, it is done when the procedure is called.
|
The error message generated automatically is illustrated by this example
|
> f := proc(n:integer) if n < 0 then 0 else n fi end:
|
> f(x);
|
Error, f expects its 1st argument, n, to be of type integer, but received x
|
2: D extended to computation sequences and programs
|
---------------------------------------------------
|
The D operator can now compute partial derivatives of functions which are
|
defined as procedures. This is known as automatic differentiation. Consider
|
> f := proc(x) local t1,t2;
|
> t1 := x^2;
|
> t2 := sin(x);
|
> 3*t1*t2+2*x*t1-x*t2
|
> end:
|
> # The following computes the derivative of f wrt x, the first argument
|
> D[1](f);
|
proc(x) local t1x,t2x,t1,t2;
|
t1x := 2*x;
|
t1 := x^2;
|
t2x := cos(x);
|
t2 := sin(x);
|
3*t1x*t2+3*t1*t2x+2*t1x*x+2*t1-t2x*x-t2
|
end
|
The reader can check that this really does compute the derivative of f by
|
verifying that diff(f(x),x) - D(f)(x) = 0. The advantage of automatic
|
differentiation is twofold. Firstly, it is much more efficient, in general, to
|
represent a function as a program instead of as a formula. Secondly, it is
|
more general as functions can have conditional statements and loops.
|
For example, given the array(0..n) of the coefficients of a polynomial b,
|
we can represent the polynomial as a program in Horner form as follows.
|
> f := proc(x,b,n) local i,s;
|
> s := 0;
|
> for i from n by -1 to 0 do s := s*x+b[i] od;
|
> s
|
> end:
|
> f(x,b,4);
|
(((b[4] x + b[3]) x + b[2]) x + b[1]) x + b[0]
|
> fx := D[1](f);
|
fx := proc(x,b,n)
|
local sx,i,s;
|
sx := 0;
|
s := 0;
|
for i from n by -1 to 0 do sx := sx*x+s; s := s*x+b[i] od;
|
sx
|
end
|
3: Program optimization -- optimize extended to computations sequences
|
----------------------------------------------------------------------
|
The optimize routine has been extended to optimize Maple procedures.
|
Currently it does common subexpression optimization on computation sequences,
|
i.e. procedures with assignment statements to local variables only, e.g.
|
> f := proc(x) local t; t := x^2; 3*t*sin(x)+2*x*t-x*sin(x) end:
|
> readlib(optimize)(f);
|
proc(x) local t,t1; t := x^2; t1 := sin(x); 3*t*t1+2*x*t-x*t1 end
|
4: Multiple libraries -- readlib takes multiple pathnames
|
---------------------------------------------------------
|
Maple automatically reads code from the Maple library using the readlib
|
function. The global variable libname specifies where the Maple library is.
|
This can now be assigned a sequence of names. E.g. if the user does
|
> libname := dir1, libname, dir3;
|
this means that when readlib(f) is executed, Maple will search for f first
|
under dir1, and if unsuccessful, it will search under the Maple library,
|
and if unsuccessful under dir3. This means users can have their own
|
development library and have it override the Maple library.
|
5: Assume facility
|
------------------
|
One of the deficiencies of Maple and other systems is in handling problems
|
which contain symbolic parameters where the result depends on the domain or
|
range of values that the symbolic parameter(s) takes. E.g. consider
|
> Int( exp(-a*t)*ln(t), t=0..infinity );
|
infinity
|
/
|
|
|
| exp(- a t) ln(t) dt
|
|
|
/
|
0
|
The answer to this integral depends on the value of the parameter a. If a is
|
real and positive, the answer is finite. If a is real and non-positive, the
|
answer is infinite. How can the user tell Maple that a is real and positive?
|
The solution adopted in Maple V release 2 is to state the assumption about
|
a, i.e. that a is real and positive as follows
|
> assume(a>0);
|
The result of this assumption is that the variable a has been assigned a new
|
value which prints as a which Maple knows is real (implicitly) and positive.
|
> a;
|
a
|
> about(a);
|
Originally a, renamed a:
|
is assumed to be: RealRange(Open(0),infinity)
|
The assume facility is presently being integrated into Maple, in particular,
|
Maple can now compute the definite integral above because Maple can determine
|
that a is positive because signum(a) returns 1.
|
> signum(a);
|
1
|
> int( exp(-a*t)*ln(t), t=0..infinity );
|
ln(a) gamma
|
- ------ - -----
|
a a
|
Note: Maple V users should stop using signum(a) := 1; because this is a
|
side effect and does not work in conjunction with option remember.
|
The assume facility includes a data base of known properties, and a deduction
|
facility for answering questions like
|
> is(a+1>0);
|
true
|
A deficiency of the assume facility is that the user needs to know what to
|
assume in order to get answers out of facilities like definite integration.
|
This is a topic of current research and future versions of Maple will provide
|
different tools for this.
|
6: Automatic complex numeric arithmetic
|
---------------------------------------
|
Complex arithmetic in Maple V had to be done with the evalc function.
|
Now, complex numeric arithmetic is automatic.
|
The evalc function is used only for symbolic arithmetic. Example
|
This includes complex rational arithmetic
|
> (2+I/3)^2;
|
35/9 + 4/3 I
|
And complex floating point arithmetic
|
> sin( (2.0+I/3)^2 );
|
- 1.378776230 - 1.294704958 I
|
The evalc function is now used only for exact symbolic expansions e.g.
|
> evalc(exp(2+Pi/3*I));
|
1/2
|
1/2 exp(2) + 1/2 I exp(2) 3
|
> evalc( sqrt(a+I*b) );
|
2 2 1/2 1/2 2 2 1/2 1/2
|
(1/2 (a + b ) + 1/2 a) + I csgn(b - I a) (1/2 (a + b ) - 1/2 a)
|
> assume(a>0);
|
> assume(b>0);
|
> evalc(sqrt(a+b*I));
|
2 2 1/2 1/2 2 2 1/2 1/2
|
(1/2 (a + b ) + 1/2 a) + I (1/2 (a + b ) - 1/2 a)
|
7: Arrow operators now accept if statements
|
-------------------------------------------
|
The arrow operators, e.g. x -> x/(x^2-1); have been extended to handle
|
if statements so that they can be used to define piecewise functions.
|
E.g. x -> if x < 0 then 0 elif x < 1 then x else 0 fi;
|
8: I/O facilities and changes
|
-----------------------------
|
- printf: output a given expression with format (as in the "C"
|
printf, with the added option of %a for algebraic), and also
|
includes the C escapes: b for backspace, t for tab, n for newline, e.g.
|
> printf(`n = %dtvar = %stresult = %an`, 10, y, 3*y^2+1);
|
n = 10 var = y result = 3*y^2+1
|
- sscanf: decode a string according to a format ("inverse" of
|
printf, identical to the "C" sscanf function).
|
- input (tty and read) and output (lprint and save) of numbers in scientific
|
E/e notation e.g. 1.2e+3 versus Float(12,2) or 1.2*10^3
|
- readline: read a line of an arbitrary file and return it as a string
|
- parse: parse a string into a Maple expression
|
- readdata: reads a file of numerical data arranged in columns
|
- output (lprint and save) of powers using ^ instead of **
|
9: New types
|
------------
|
- type(a,arctrig) tests if a is an arc trigonometric function
|
- type(a,complex(t)) tests if an expression of the form a + b*I where a and b
|
are of type t. Typical cases of t are complex(integer), i.e. Z[i], the
|
Gaussian integers, complex(rational), i.e. Q(i), complex(float), i.e. a
|
complex floating point number, and complex(numeric) which is any of these.
|
- type(a,nothing) always returns false
|
- type(f,mathfunc) tests if a function is a "math" function
|
The definition is that f is either an operator, or evalf/f exists,
|
i.e. Maple knows how to evaluate it in floating point.
|
This includes abs, exp, erf, BesselJ, etc. but also int, sum, limit,
|
and arrow procedures with option operator e.g. x -> sin(x)*cos(x);
|
- type(a,TEXT) tests if a is a TEXT object (used for help files)
|
10: What is Maple doing?
|
------------------------
|
The userinfo facility, that was introduced in Maple V as a replacement
|
for assigning printlevel to 2, 3, or 4, has been completed.
|
For information on what Maple is doing, and what algorithms it is using
|
for a specific function, e.g. integration, one does infolevel[int] := 4;
|
For information on all functions one does infolevel[all] := 4;
|
11: Single library archive
|
--------------------------
|
On the personal computers, the Macintosh, PC, Amiga and NeXT, the Maple V
|
library is now being distributed as a single file. This saves a significant
|
amount of storage, and avoids problems with systems which have difficulty
|
maintaining large numbers of files. This will be done on other platforms
|
as well. An override mechanism is also provided so files can be updated.
|
The library archive file also resolves problems on systems which have limited
|
filename lengths and case insensitive filenames.
|
12: errorbreak
|
--------------
|
Maple has added some user control for how Maple responds on encountering errors
|
when reading in a file. This is provided by the interface option errorbreak.
|
- With interface(errorbreak=0); the entire input file is read and all errors
|
that are encountered are displayed. This was the Maple V behavior.
|
- With interface(errorbreak=1); processing stops after the first syntax error
|
thus avoiding nonsensical multiple syntax error messages that are often
|
consequences of the first one. This is the new default behavior.
|
- With interface(errorbreak=2); processing stops after the first error,
|
whatever it is, i.e. syntax (parse time) or semantic (execution) errors.
|
Algorithmic Improvements
|
========================
|
1: Integration of rational functions
|
------------------------------------
|
The Trager-Rothstein algorithm computes the integral of a rational function
|
f(x) over a field K as a sum of logs over K(alpha), an algebraic extension
|
of K of minimal degree. E.g. consider the following rational function
|
in Q(x) where note the denominator is irreducible over Q.
|
> f := (6*x^5+6*x^2-4*x+8*x^3-4)/(x^6+2*x^3+1-2*x^2);
|
5 2 3
|
6 x + 6 x - 4 x + 8 x - 4
|
f := ----------------------------
|
6 3 2
|
x + 2 x + 1 - 2 x
|
Applying the Trager-Rothstein algorithm yields the following result
|
-----
|
3
|
(1 + alpha) ) ln(x - alpha x + 1)
|
/
|
-----
|
2
|
(alpha - 2) = 0
|
I.e. there are two logs corresponding to two roots +- sqrt(2) of the
|
polynomial alpha^2-2 = 0. Hence, Maple gets the following nice result
|
> int(f,x);
|
1/2 3 1/2 1/2 3 1/2
|
(1 + 2 ) ln(x - 2 x + 1) + (1 - 2 ) ln(x + 2 x + 1)
|
The first improvement in release 2 is in handling coefficient fields which are
|
function fields, and not just number fields. I.e. the input rational function
|
could involve parameters as well as numbers. This is because of the extension
|
of evala to handle algebraic functions and not just algebraic numbers.
|
The Lazard-Trager improvement allows this answer to be obtained directly
|
without having to compute in the more complicated field K(alpha), i.e. in
|
this example, it doesn't have to compute over Q(sqrt(2)), only Q.
|
2: Bivariate polynomial Gcd's over Z
|
------------------------------------
|
We have implemented the dense modular method of Collins for computing Gcds
|
of polynomials with in 2 variables with integer coefficients. The method
|
works by computing computing many gcd's of polynomials in 1 variable modulo
|
different primes and combining these solutions using polynomial interpolation
|
and the Chinese remainder theorem. Note, in Maple V, we implemented this
|
method for univariate polynomials. Also, this is a dense method. For sparse
|
polynomials in many variables it is not a good method. Comparing this with
|
the default EEZGCD algorithm in Maple V, we obtain the following improvement.
|
We created three dense bivariate polynomials g,a,b each of degree n with
|
random n digit coefficients and computed gcd(a*g, b*g).
|
n 10 15 20
|
Maple V 65.0 1,877 18,763
|
Maple V rel 2 10.6 33.7 393.7
|
3: Integer version of the LLL lattice reduction algorithm
|
---------------------------------------------------------
|
The LLL (Lenstra Lenstra Lovasz) lattice reduction algorithm has been sped
|
up by a factor of 3 or so for the case of an integer matrix.
|
4: Factorization over algebraic number fields
|
---------------------------------------------
|
We have implemented Lenstra's algorithm for factorization of polynomials over an
|
algebraic number field. For some polynomials it runs considerably faster than
|
the default algorithm. But it depends very much on the polynomial.
|
5: Faster numerical evaluation of the arctrig functions
|
-------------------------------------------------------
|
The running time of the algorithms used for the numerical evaluation of
|
exp(x) and ln(x) at high precision is O(n^2 log_2 n) for n digits.
|
This is O(log_2 n) integer multiplications each of which is O(n^2).
|
The algorithms for the trig functions sin, cos, tan use repeated argument
|
reduction to obtain an O(n^(5/2)) algorithm. The same idea is now used
|
by the arctrig functions, e.g.
|
Digits arcsin(Pi/4) arctan(Pi/4)
|
Maple V Maple V rel 2 Maple V Maple V rel 2
|
500 25 3.0 23 2.5
|
1000 176 11.0 148 11.2
|
2000 1245 50.4 1038 45.2
|
6: Optimized the evaluation of list and set subscripts
|
------------------------------------------------------
|
List and set subscripts i.e. s[i] where s is a list or set have been sped up
|
by a factor of 3 to 5.
|
7: Optimized the evaluation of numerical arithmetic
|
---------------------------------------------------
|
Evaluation of numerical expressions e.g. n-i+1, 2*n-2*j+2, has been sped up to
|
avoid the creation of an intermediate data structure. This is a significant
|
improvement in the cases of small integers, e.g. array subscript calculations.
|
Consider these two codes for computing the Fibonacci numbers F(n)
|
> F1 := proc(n) if n < 2 then n else F1(n-1)+F1(n-2) fi end;
|
> F2 := proc(n) F2(n-1)+F2(n-2) end; F2(0) := 0; F2(1) := 1;
|
The improvement in the arithmetic that occurs in F(n-1)+F(n-2) yields
|
Maple V Maple V rel 2
|
n F1 F2 F1 F2
|
16 1.05 0.73 0.78 0.47
|
18 2.73 2.17 2.17 1.32
|
20 7.30 5.20 5.92 3.55
|
22 20.17 13.45 15.20 8.53
|
8: Floating point solutions to polynomials
|
------------------------------------------
|
We have rewritten the code for computing floating point approximations to roots
|
of polynomials. The new code will increase the intermediate precision so that
|
the roots found are fully accurate, i.e. accurate to 0.6 ulp. We have
|
also implemented a routine in the kernel in C to use hardware floating point
|
arithmetic. If the roots found using this routine are accurate then the fsolve
|
routine will execute faster, as illustrated in the following examples. T(n,x)
|
is the n'th Chebyshev polynomial of the first kind. It has all real roots.
|
F(n,x) is the n'th Fibonacci polynomial which has all complex roots except 0.
|
The jump in times indicates where hardware precision is no longer sufficient.
|
Maple V Release 2
|
n T(n,x) F(n,x) T(n,x) F(n,x)
|
10 1.68 1.86 0.45 0.23
|
20 8.95 11.43 2.17 1.43
|
30 FAIL 36.72 6.08 3.47
|
40 FAIL 34.22 7.57
|
50 106.2 50.45
|
9: Character tables for Sn
|
--------------------------
|
In computing the character table for Sn the symmetric group on n letters we
|
are now making use of the conjugate partitions and symmetry in the table.
|
The improvement is better than a factor of 2 for large n. Note the table has
|
dimension p(n) by p(n) where p(n) is the number of partitions of n so requires
|
exponential space in n to store.
|
The data here are for computing combinat[character](n)
|
Maple V Release 2
|
n
|
8 6.6 3.5
|
10 26.0 12.6
|
12 102.0 43.4
|
14 446.8 160.3
|
New Library Functions
|
=====================
|
AFactor, AFactors -- absolute factorization over the complex numbers
|
argument -- complex argument of a complex number
|
assume -- for making assumptions about variables e.g. assume(a>0);
|
ceil -- ceiling function
|
csgn -- complex sign
|
discont -- compute a set of possible discontinuities of an expression
|
floor -- floor function
|
fourier, invfourier -- symbolic fourier transform and inverse
|
ilog, ilog10 -- IEEE integer logarithm function
|
Indep -- test algebraic extensions over Q for independence
|
invfunc -- table of inverse functions
|
is, isgiven -- for testing properties against the assume database
|
Norm -- computes the norm of the algebraic number or function over a field K
|
Primfield -- computes a primitive element over a given algebraic number field
|
powmod -- computes a(x)^n mod b(x) using binary powering
|
ratrecon, Ratrecon -- rational function reconstruction (Euclidean algorithm)
|
readdata -- reads a file of numerical data arranged in columns
|
spline -- computes a natural cubic spline from a set of data
|
split -- splits a polynomial into linear factors over its splitting field
|
sqrfree -- a square-free factorization of a multivariate polynomial
|
symmdiff -- symmetric difference of sets
|
Trace -- computes the trace of the algebraic number or function over a field K
|
unload -- unload a Maple library function
|
Library Packages
|
=================
|
The package mechanism has been extended to support an initialization routine.
|
The initialization routine should be placed either in the package as the
|
routine package[init], or as the routine `package/init` in the library in
|
the file `package/init.m`; This routine is executed by with(package);
|
It is up to the initialization routine to decide what to do if it is called
|
a second time.
|
Below is a list of the new packages and modifications to existing packages.
|
1: approx (Numerical Approximation Package)
|
-------------------------------------------
|
- infnorm: compute the (weighted) infinity norm of an approximation
|
- minimax: compute a (weighted) minimax numerical approximation
|
- remez: Remez algorithm for minimax rational function approximation
|
The main function in this package is minimax which has the following
|
functionality: minimax(f,x=a..b,n,w) or minimax(f,x=a..b,[m,n],w); It uses
|
the Remez algorithm to compute the best minimax polynomial of degree <= n,
|
or rational function with numerator of degree <= m, and denominator of
|
degree <= n to the function f on the range [a,b]. The optional 4'th parameter
|
w specifies a weight function (default 1). For example, here is a [4,4]
|
rational approximation to erf(x) on [0,3] which I've rounded to 7 decimal
|
digits. The approximation is accurate to almost 5 digits on [0,3].
|
> evalf(minimax(erf(x),x=0..3,[4,4]), 7);
|
.00002407481 + (1.127063 + ( - .2493939 + (.09458902 + .06665265 x) x) x) x
|
---------------------------------------------------------------------------
|
1. + ( - .2313770 + (.4509384 + ( - .06758241 + .08086507 x) x) x) x
|
2: combinat (Combinatorial Functions Package)
|
---------------------------------------------
|
- conjpart: conjugate partition
|
3: DEtools (Differential Equation Plots Package)
|
------------------------------------------------
|
A package for plotting differential equations including systems of ODEs
|
and some special PDEs, allowing the associated vector field to be plotted
|
and solution curves for different initial conditions.
|
- DE1: plot a first order linear ODE for given initial conditions
|
- DE2: plot a system of two first order linear ODEs
|
- PDEplot: plot the surface of a first order, quasi-linear PDE of the form
|
P(x,y,u) * D[1](u)(x,y) + Q(x,y,u) * D[2](u)(x,y) = R(x,y u)
|
- dfieldplot: plot a field plot for a single or two first order linear ODEs
|
- phaseportrait: plot a phase plot for a single or two first order linear ODEs
|
4: Gauss
|
--------
|
A package which allows one to create "domains" of computation in a similar way
|
that the AXIOM system allows. The advantage is that routines for computing
|
with polynomials, matrices, and series etc. can be parameterized by any
|
coefficient ring. E.g. given a ring R, the Gauss statement
|
> P := DenseUnivariatePolynomial(R,x):
|
creates a dense univariate polynomial domain P which contains all the routines
|
needed to do arithmetic with polynomials over R. The advantage is that the
|
the code supplied by the DenseUnivariatePolynomial function works for any
|
coefficient domain R which is a ring, i.e. has operations +, -, *, etc.
|
It is expected that many Maple library routines will be recoded in Gauss over
|
the next few versions. The initial implementation includes basic facilities
|
for computing with polynomials, matrices and series over number rings,
|
finite fields, polynomial rings, and matrix rings.
|
5: GaussInt (Gaussian Integer Package)
|
--------------------------------------
|
This is a set of routines for computing with Gaussian (complex) integers, i.e.
|
numbers of the form a + b I where a and b are integers. Included are routines
|
for computing the Gcd of two Gaussian integers, the factorization of a Gaussian
|
integer, and a test for primality, e.g.
|
> GIfactor(13);
|
(3 + 2 I) (3 - 2 I)
|
6: linalg (Linear Algebra Package)
|
----------------------------------
|
- blockmatrix: utility routine to create a block matrix
|
- gausselim, gaussjord, rowspace, colspace: now handle matrices of
|
floats, complex floats, and complex rationals
|
- eigenvals, eigenvects: now handle matrices of floats and complex floats
|
- entermatrix: utility routine for entering the entries of a matrix
|
- randvector: utility routine to create a random vector
|
- ratform: (synonym for frobenius) computes the rational canonical form
|
- Wronskian: computes the Wronskian matrix
|
7: numtheory: (Number Theory Package)
|
-------------------------------------
|
- cfrac: modified to handle different forms of continued fractions
|
real numbers, series, polynomials.
|
- cfracpol: computes continued fractions for the real roots of a polynomial
|
- kronecker: Diophantine approximation in the inhomogeneous case
|
- minkowski: Diophantine approximation in the homogeneous case
|
- nthnumer: returns the denominator of the n'th convergent
|
- nthdenom: returns the numerator of the n'th convergent
|
- nthconver: returns the n'th convergent of a simple continued fraction
|
- thue: compute the resolutions of Thue equations or Thue inequalities
|
- sq2factor: factorization in the UFD Z[sqrt(2)]
|
8: padic (Padic Number Package)
|
-------------------------------
|
A package for computing P-adic approximations to real numbers, e.g.
|
> with(padic):
|
> evalp(sqrt(2),7);
|
2 3 4 5 6 7 8 9
|
3 + 7 + 2 7 + 6 7 + 7 + 2 7 + 7 + 2 7 + 4 7 + O(7 )
|
> evalp(exp(3),3);
|
2 3 4 6 8 9
|
1 + 3 + 3 + 2 3 + 2 3 + 3 + 3 + O(3 )
|
9: plots (Plots Package)
|
------------------------
|
- animate: animate one or more functions in 2 dimensions, e.g.
|
a) sine - cosine waves
|
animate({sin(x*t),cos(x*t)},x=-2*Pi..Pi,t=0..2*Pi);
|
b) a polar coordinate unraveling
|
animate([sin(x*t),x,x=-4..4],t=1..4,coords=polar,numpoints=100,frames=100);
|
- animate3d: animate one or more curves or surfaces in 3 dimensions, e.g.
|
animate3d(cos(t*x)*sin(t*y), x=-Pi..Pi, y=-Pi..Pi,t=1..2);
|
- conformal: routine is typically 3 times faster
|
- contourplot: contour plot of a 3 dimensional surface, e.g.
|
contourplot(sin(x*y),x=-Pi..Pi,y=-Pi..Pi,grid=[30,30]);
|
- densityplot: density plot, e.g.
|
densityplot(sin(x*y),x=-Pi..Pi,y=-Pi..Pi,grid=[30,30]);
|
- fieldplot: field plot of a linear first order ODE
|
vfield := [x/(x^2+y^2+4)^(1/2),-y/(x^2+y^2+4)^(1/2)]:
|
fieldplot(vfield,x=-2..2,y=-2..2);
|
- fieldplot3d: field plot of a linear first order ODE
|
fieldplot3d([2*x,2*y,1],x=-1..1,y=-1..1,z=-1..1,
|
grid=[10,10,5],arrows=THICK,style=patch);
|
- gradplot: plot the gradient vector field of a 2 dimensional function
|
- gradplot3d: plot the gradient vector field of a 3 dimensional function, e.g.
|
gradplot3d( (x^2+y^2+z^2+1)^(1/2),x=-2..2,y=-2..2,z=-2..2);
|
- implicitplot: plot a curve defined implicitly by F(x,y) = 0, e.g.
|
implicitplot( x^2 + y^2 = 1, x=-1..1,y=-1..1 );
|
- implicitplot3d: plot a surface defined implicitly by F(x,y,z) = 0, e.g.
|
implicitplot3d( x^2+y^2+z^2 = 1, x=-1..1, y=-1..1, z=-1..1 );
|
- logplot: log plot, e.g. logplot(10^(20*exp(-x)),x=1..10);
|
- loglogplot: log log plot, e.g. loglogplot(10^(20*exp(-x)),x=1..100);
|
- odeplot: plot the solution of an ODE from dsolve
|
p := dsolve({D(y)(x) = y(x), y(0)=1}, y(x), numeric):
|
odeplot(p,[x,y(x)],-1..1);
|
- polygonplot: draw one or more polygons in 2 dimensions
|
ngon := n -> [seq([ cos(2*Pi*i/n), sin(2*Pi*i/n) ], i = 1..n)]:
|
polygonplot(ngon(8));
|
- polygonplot3d: draw one or more polygons in 3 dimensions
|
- polyhedraplot: for plotting tetrahedrons, octahedrons, hexahedrons,
|
dodecahedrons,icosahedrons e.g.
|
polyhedraplot([0,0,0],polytype=dodecahedron);
|
- surfdata: plot a surface input as a grid of data points
|
cosdata := [seq([ seq([i,j,evalf(cos((i+j)/5))], i=-5..5)], j=-5..5)]:
|
F:= (x,y) -> x^2 + y^2:
|
surfdata( cosdata, axes=frame, color=F );
|
- textplot: for plotting labelled points in 2 dimensions, e.g.
|
textplot([1,2,`one point in 2d`],align={ABOVE,RIGHT});
|
- textplot3d: for plotting labelled points in 3 dimensions, e.g.
|
textplot3d({[1,2,3,`one point in 3d`],[3,2,1,`second point in 3d`]});
|
10: networks: (Graph Networks Package)
|
--------------------------------------
|
A package of routines for creating, manipulating and computing properties of
|
graphs, i.e. graphs with edges and vertices. Primitives exist for computing
|
properties such as edge connectivity, biconnected components, and edge or
|
vertex set induced subgraphs. The graphs may have loops or multiple edges,
|
both directed and undirected, and arbitrary weights can be associated with
|
both edges and vertices. Graphs can be drawn as a picture (a plot) for
|
display. For example, here we create the Petersen graph and compute and factor
|
its characteristic polynomial.
|
> with(networks):
|
> factor(charpoly(petersen(),x));
|
4 5
|
(x - 3) (x + 2) (x - 1)
|
The spanpoly(G,p) function computes a polynomial for the undirected graph G
|
where p is a probability of failure associated with each edge. When G is
|
connected, this is the all-terminal reliability polynomial of G. Here is the
|
all-terminal reliability polynomial for the complete graph on 4 vertices.
|
> spanpoly(complete(4),p);
|
3 2 3
|
- p (- 16 + 33 p - 24 p + 6 p )
|
11: liesymm: (Lie Symmetries Package)
|
--------------------------------------
|
This package is for characterizing the contact symmetries of a system
|
of partial differential equations. The basic routines makeforms() and annul()
|
for automatic translation to and from differential forms now maintain and make
|
use of additional information which allow the full reconstruction of the
|
original system of PDEs, and handle a broader class of systems of PDEs.
|
> with(liesymm):
|
> e1 := Diff(h(t,x),x,x) = Diff(h(t,x),t):
|
> makeforms(e1,h(t,x),w);
|
[d(h) - w1 d(t) - w2 d(x), (d(w2) &^ d(t)) - w1 (d(x) &^ d(t))]
|
> annul(");
|
/ 2
|
| d | / d
|
{|----- h(t, x)| - |---- h(t, x)| = 0}
|
| 2 | dt /
|
dx /
|
In addition, knowledge of the original system of equations has been maintained
|
and used to carry out some basic simplifications of the system of PDEs
|
characterizing the contact symmetries. New routines include:
|
- indepvars, depvars: routines for enquiring or setting the independent and
|
dependent variables for the current problem. E.g. indepvars(); returns
|
[t, x] and depvars(); returns [h] in the example. This information is
|
established through use of commands like makeforms() and determine()
|
- choose: analogous to isolate() but for wedge products.
|
- reduce: makes use of knowledge of the dependencies to simplify the resulting
|
determining equations.
|
- autosimp: carries out some simple integrations and uses the results
|
to simplify the given system of PDEs.
|
- TD, Eta, extgen, prolong: for generating the extended operator
|
- value, dvalue: the value routine has been renamed to dvalue to avoid conflict
|
with the main value routine. This routine evaluates inert derivatives
|
(Diff) and returns its result in the inert form .
|
Share Library
|
=============
|
1: Contributions from Maple users
|
---------------------------------
|
The share library is a repository of applications codes, contributed primarily
|
by Maple users. It is distributed with each version of Maple in both src and
|
Maple ".m" format. However, our ambitions have expanded. The share library
|
has been completely reorganized. Beginning with this version, it also includes
|
- TeX/LaTeX introductory documents on using Maple
|
- TeX/LaTeX support documentation for applications codes
|
- updates to library routines, i.e. bug fixes, efficiency improvements etc.
|
- examples of applications of Maple to problem solving
|
We have also endeavored to ensure that each contribution comes with on-line
|
Maple style help files, and Maple style test files to help us ensure that the
|
code is working correctly.
|
2: How to access code from the share library from inside Maple
|
--------------------------------------------------------------
|
Users can access routines in the share library by reading them in directly
|
from the files using the read command. Also, where appropriate, one can now
|
access them directly from inside Maple using the with command.
|
The command with(share); looks to see if the share library exists, i.e. it
|
is adjacent to the Maple library (it simply tries to read a file from it).
|
If successful, it assigns the global variable "sharename" to the path where
|
it found the share library, and then it executes the statement
|
> libname := libname, sharename;
|
Now Maple's readlib command and with command will automatically search the
|
share library after first searching the Maple library. If unsuccessful, the
|
user can locate the share library and set the libname variable directly.
|
For example, the fit routine in the share library can be used to "fit" a
|
formula to some data in the least squares sense.
|
> with(share): # locate the share library
|
> readlib(fit): # now finds the fit routine from the share library
|
> fit([-1.5,0.5,1.5],[0,-2,-1.5], a*t^2+b*t+c, t);
|
2
|
.4999999997 t - .5000000001 t - 1.874999999
|
Documentation for the code is in the file. After reading in the fit routine,
|
additional documentation is included in TeX/LaTeX files.
|
See ?share,contents for a summary of the contents of the share library.
|
3: Electronic distribution version of the Maple share library
|
-------------------------------------------------------------
|
The share library will also be distributed electronically, firstly, over the
|
internet by using anonymous ftp, and secondly, by electronic mail, with an
|
electronic mail server. The electronic version is be updated periodically,
|
about once every 3 months, with new contributions, corrections to previous
|
contributions etc. Unlike the Maple version, it contains a directory of
|
updates to the Maple library, primarily simple bug fixes.
|
For directions on how to get code using anonymous ftp, electronic mail,
|
and how to install it and use it, see ?share for details.
|
4: Policy of the contributions to the share library
|
---------------------------------------------------
|
The code in the share library has been contributed freely by the authors to be
|
made freely available to all Maple users. It is not to be sold for profit or
|
changed without the author's permission. Authors who contribute code to the
|
share library will be asked to write Maple style on-line help documentation and
|
a test file. Authors will also be asked to sign a non-exclusive agreement to
|
let us distribute your code, and to let us change your code to maintain it.
|
Miscellaneous
|
=============
|
- the catenation operator . now expands in ``.(a,b,c).(1..3) to yield
|
a1, a2, a3, b1, b2, b3, c1, c2, c3
|
- expand of @ and @@ now handled e.g. expand((sin@@)(2)(x) ); ==> sin(sin(x))
|
- evalf of @ and @@ now handled e.g. evalf((sin@@2)(2)); ==> .7890723436
|
- anames(t) returns all names of type t
|
- a[1] := x; is disallowed if a is assigned an object other than
|
an array or table
|
- f()[1] is now allowed; it returns unevaluated
|
- Changes to fortran and C
|
- both now use appendto instead of writeto to append output to
|
a file instead of overwriting it
|
- both now translate subscripts e.g. a[i-2*j] where the 2 here
|
is understood to be an integer
|
- both now convert symbolic constants e.g. Pi to floating point
|
- optional parameter digits = n for specifying the precision to be used
|
in converting constants to floating point
|
- C now also breaks up large expressions which otherwise cause
|
some compilers to break
|
- Changes to dsolve/numeric
|
The output of dsolve({equations in x},{functions of x},numeric)
|
is a procedure f where f(x) returns a tuple of values. E.g
|
dsolve({...},{y(x),z(x)},numeric); returns f a procedure where
|
f(1) returns x=1, y(x)=y(1), z(x)=z(1)
|
The odeplot routine in the plots package can be used to plot the result.
|
- Mellin speeded up by a factor of 4-30
|
- ifactor has been sped up for the case of a perfect power
|
- series(f(x),x=a); now allows +-infinity for a
|
> series(ln(1-x),x=-infinity);
|
1 1 1 1 1
|
- ln(- 1/x) - 1/x - ---- - ---- - ---- - ---- + O(----)
|
2 3 4 5 6
|
2 x 3 x 4 x 5 x x
|
- signum(f) where f is a symbolic constant will use interval arithmetic at
|
Digits precision to determine the sign of f, e.g. signum(Pi-4*sin(1));
|
- the for loop clauses "by", "to", "from" and "while" can now
|
appear in any order
|
- Changes to automatic simplifications
|
- the ln(1/x) ==> -ln(x) automatic simplification has been turned off.
|
ln(a^n) ==> n ln(a) is now done iff signum(a) = 1, i.e. x is provably +ve
|
- the ln(exp(x)) ==> x automatic simplification has been turned off.
|
ln(exp(x)) ==> x is now down iff Im(x) returns 0, i.e. x is provable real
|
- the automatic simplification sqrt(x^2) ==> x (incorrect for -ve x) is being
|
fixed for the next version (the change is more difficult than the others)
|
- the arcsin(sin(x)) ==> x arctrig simplifications have been turned off
|
- inverse functions simplifications have been added e.g. sin@@(-1) ==> arcsin
|
- trig simplifications for multiples of Pi/8, Pi/10, Pi/12 have been added
|
> sin(Pi/8), sin(Pi/10), sin(Pi/12);
|
1/2 1/2 1/2 1/2 1/2
|
1/2 (2 - 2 ) , 1/4 5 - 1/4, 1/2 (2 - 3 )
|
- Changes to evalhf
|
- can now be interrupted
|
- now accepts break/next in for loops
|
- now understands round, floor, ceil, Dirac and Heaviside.
|
- improved error messages
|
- rounding on input to 1/2 ulp
|
- rounding on output to less than 1/2 ulp (except that result is
|
truncated to 4 words later and this may cause up to 2.0 ulps)
|
- arrays passed as local arguments now work
|
- a primitive printlevel debugging facility added for tracing assignments
|
though note this may yield a large output
|
- now understands true and false
|
- the old library file name limit of 9 characters has been removed.
|
The limit is now 55 characters for the path e.g. int/rischalg/intbasis
|
- fsolve recognizes the option real as well as complex. The default
|
is to compute the real roots.
|
- Additional simplifications for Dirac and Heaviside are provided through
|
the general purpose simplify facility, e.g.
|
> simplify( Heaviside(x-1)*Heaviside(x-3) );
|
Heaviside(x - 3)
|
> simplify( F(x+3)*Dirac(x) );
|
F(3) Dirac(x)
|
- Additional simplification routines for the arctrig functions are provided
|
through the general purpose simplifier, e.g.
|
> simplify( arctan(x)+arctan(1/x) );
|
1/2 signum(x) Pi
|
- A new description field has been added to procedures for stating a short
|
description of what a procedure computes. The idea is that most of the time,
|
people use the ? help facility to remind them of what the parameters are,
|
their order, the options, and what the computes, in particular, the return
|
type. The print facility provides this in conjunction with the new parameter
|
type declarations, and the description field, e.g. a library routine
|
> F := proc(n:integer)
|
> option `Copyright 1990 by the University of Waterloo`
|
> description `computes the n'th Fibonacci number, an integer`;
|
> if n < 2 then n else F(n-1)+F(n-2) fi;
|
> end:
|
> print(F);
|
proc(n:integer)
|
description `computes the n'th Fibonacci number, an integer`;
|
...
|
end
|
Changes in Functionality
|
========================
|
We have endeavored NOT to change the functionality of existing functions
|
in the system, language, and library from version V release I to release 2
|
so that users' code will work, and the new manuals will remain accurate.
|
In some cases it was necessary to make a change in order to fix a problem or
|
inconsistency. We have listed the changes that are most likely to affect
|
users below. Please note however that the .m format has changed, so all
|
users will need to reload any code from Maple V or Maple 4.3.
|
1: Complex numerical arithmetic is now automatic, i.e. +, -, *, /, ^, of
|
complex integers, complex rationals, and complex floats is done automatically.
|
Also evalf now works over the complex floats. Consequently many functions
|
now work better, and faster, with complex numbers.
|
2: Simple partial derivatives use the diff notation not the D notation, i.e.
|
the output of diff(f(x,y),x,y,x); which used to return D[1,1,2](f)(x,y)
|
now returns diff(diff(diff(f(x,y),x),x),y) which is displayed as follows
|
3
|
d
|
-------- f(x, y)
|
2
|
dy dx
|
Release 2 still assumes that partial derivatives commute as did Maple V.
|
This is coded in the routine `diff/diff` and can be changed as necessary.
|
Note, use convert to convert between the two representations, i.e.
|
convert(...,D); and convert(...,diff);
|
3: The function combinat[combine] has been renamed combinat[choose] to not
|
collide with the combine function and the trace function has been renamed
|
debug to not collide with linalg[trace], i.e. the trace of a matrix.
|
4: The meaning of x in plot(..., x=a..b); and plot(..., a..b) has changed to
|
be consistent with the 3-dimensional case. If you give a range as the 2nd
|
argument, i.e. plot(f,0..1); and plot3d(g,0..1,0..1); then Maple
|
understands this to mean: treat f and g as functions or mappings, e.g.
|
plot( sin, -3..3 ); and plot( binomial, -3..3, -3..3 );
|
On the other hand, if you give an equation/range as the second argument, i.e.
|
plot(f(x),x=0..1); or plot3d(g(x,y),x=0..1,y=0..1); then this is
|
understood to mean plot the expression or formula f(x) and g(x,y), e.g.
|
plot( sin(x), x=-3..3 ); and plot( binomial(n,k), n=-3..3, k=-3..3 );
|
Hence you can plot Maple procedures and operator expressions e.g.
|
plot( x -> if x < 0 then 1 else cos(x) fi, -2..2 );
|
plot( sin^2+cos@log, 0..3 );
|
5: The output from dsolve/numeric has changed to include the variables, e.g.
|
> sys := diff(y(x),x)=z(x),diff(z(x),x)=-y(x): fcns := {y(x), z(x)}:
|
> p:= dsolve({sys,y(0)=0,z(0)=1},fcns,numeric):
|
> p(0.5);
|
{x = .5000000000, y(x) = .4794255401, z(x) = .8775825652}
|
This can be plotted by by then doing
|
> plots[ODEplot](p,[[x,y(x)],[x,z(x)]],0..10);
|
6: Output from lprint and save of powers now uses ^ instead of ** and of
|
floating point numbers now uses scientific e/E notation instead of Float(m,e)
|
7: Some automatic simplifications have been turned off e.g. ln(1/x) ==> -ln(x)
|
A complete list is given in the section Changes to automatic simplifications
|
below under Miscellaneous. The ones most likely to affect users are those
|
simplifications which have been turned off -- because they are not correct
|
for all complex values of parameters.
|
8: Hitting the interrupt key twice will no longer kill a Maple session, it
|
will only interrupt the current calculation. The quit key can be used to
|
kill Maple. On Unix this usually is ^by default.
|
9: Indefinite integrals which require the exponential integral now return
|
in terms of Ei(1,x) not Ei(x) which is the Cauchy principle value. E.g.
|
> int( exp(-x)/x^3, x );
|
exp(- x) exp(- x)
|
- 1/2 -------- + 1/2 -------- - 1/2 Ei(1, x)
|
2 x
|
x
|
10: New semantics of evalf(f,n). The old semantics was first evaluate f,
|
then simplify the result (at Digits precision) yielding f', then evaluate and
|
simplify n yielding n' and assign Digits to n'. Now evalf f' at n' digits
|
precision, simplify the result and return. The new semantics is, first
|
evaluate n to n' and assign Digits to n', then evaluate f and simplify the
|
result (at precision Digits = n') yielding f', then evalf f' at
|
Digits = n' precision. This example illustrates what is going on here
|
x := 7.0;
|
evalf( 2/x*Pi, 20 );
|
In Maple V, 2/x*Pi evaluates to 2/7.0*Pi, and simplifying 2/7.0 is done
|
at Digits = 10 (the default) precision yielding .2857142857*Pi. Then
|
evalfing this at 20 digits we get .89759790129493458131 . In Maple V
|
release 2 all the arithmetic is being done at 20 digits precision
|
and we get .89759790102565521098 .
|
11: The fsolve command, when given a range, now solves on the closed interval
|
not the open interval. E.g. for the polynomial 1-x^2 with roots at +- 1,
|
fsolve(1-x^2,x,-1..1) now returns -1 and +1.
|