New Packages in Maple 9 - Maple Programming Help

New Packages in Maple 9

 • Maple 9 contains many new packages.
 • For information on enhanced Maple 9 packages, see Enhanced Packages in Maple 9: Part 1 and Enhanced Packages in Maple 9: Part 2.
 • This help page describes the following new packages.

Student Packages

 • Two new packages have been added to the Student package: Precalculus and LinearAlgebra.
 • For information on enhancements to the Student package, see Enhanced Packages in Maple 9: Part 2.
 • The $\mathrm{Student}\left[\mathrm{Precalculus}\right]$ package consists of a set of Maplet applications that helps you visualize the basic concepts that must be mastered before studying calculus: lines, polynomials, rational functions, other standard functions, composition of functions, as well as introductions to tangent lines and limits.  Using each Maplet application, you can adjust the parameters or functions to experiment with the concept.
 • The $\mathrm{Student}\left[\mathrm{LinearAlgebra}\right]$ package has three components: computation, visualization, and interaction.  The computation component has many of the same commands as the top-level (non-Student) LinearAlgebra package, but with simpler calling sequences and a more constrained computation domain.  The visualization component includes commands that help to graphically illustrate the fundamental concepts of linear algebra, such as the action of a matrix on a vector or set of vectors, the solution of a linear system or least squares problem, and the solution of an eigenproblem.  The interaction component presents many of these concepts through Maplet interfaces, allowing you to more easily experiment with the effects of changing parameters or functions.

ScientificErrorAnalysis

 • The new ScientificErrorAnalysis package provides representation and construction of numerical quantities that have a central value and associated uncertainty or error, which is some measure of the degree of precision to which the quantity's value is known. First-order calculations of error analysis can be performed with these quantities.
 • The ScientificErrorAnalysis package takes into account correlations. For example, find the ratio of the electron magnetic moment anomaly (a[e]) and the fine structure constant (alpha).
 > with(ScientificConstants):
 > emma := Constant( a[e] );
 ${\mathrm{emma}}{≔}{\mathrm{Constant}}{}\left({{a}}_{{e}}\right)$ (1)
 > fsc := Constant( alpha );
 ${\mathrm{fsc}}{≔}{\mathrm{Constant}}{}\left({\mathrm{\alpha }}\right)$ (2)
 Find the ratio and its error.
 > combine( emma/fsc, errors );
 ${\mathrm{Quantity}}{}\left({0.1589140953}{,}{9.844093508}{}{{10}}^{{-12}}\right)$ (3)
 Find the error, but without taking the correlation into account.
 > combine( emma/fsc, errors, correlations = false );
 ${\mathrm{Quantity}}{}\left({0.1589140953}{,}{5.138085491}{}{{10}}^{{-11}}\right)$ (4)
 This can also be done with user-defined quantities-with-error.

DiscreteTransforms

 • The new DiscreteTransforms package computes the fast Fourier transform (and inverse transform) of single or multi-dimensional data.
 This package replaces the limited FFT and iFFT commands in Maple, as it is capable of computing the fast Fourier transform of sequences of arbitrary length, limited only by the available storage (memory).
 • The FourierTransform and InverseFourierTransform functions work in hardware precision, so are limited to 15 Digits of accuracy, but run in compiled code, so are very fast.
 Example:
 > Z := Vector(100000,             i->evalhf(sin(i/1000))+I*evalhf(i/1000),             datatype=complex[8]):
 > tt := time():
 > DiscreteTransforms[FourierTransform](Z,inplace=true):
 > time()-tt;
 ${0.024}$ (5)

ArrayTools

 • The new ArrayTools package provides low-level manipulation of rectangular Arrays, Vectors, and Matrices, and rectangular Array, Vector, and Matrix data aliasing. This package is provided primarily for programming purposes.
 Examples of the capabilities that this package provides are:
 - Efficient data filling (ArrayTools[Fill])
 - Raw data copying of portions of one Array to another (ArrayTools[Copy])
 - In-place data reordering (ArrayTools[DataTranspose])
 - Aliasing the data (or part of the data) of an Array to another Array with, for example, different ordering, indices, or dimensions (ArrayTools[Alias])
 - Aliasing a complex Array as a double-sized real valued Array, which can be used within evalhf (ArrayTools[ComplexAsFloat])

FileTools

 • The new FileTools package provides an interface for performing file input and output, and file manipulation.  New features include file locking, file statistics querying, and hardware datatype byte reordering. It also provides basic functions like Copy, Rename, and Remove.

CodeTools

 • The new CodeTools package provides functions to assist Maple programmers improve the quality of their code.  Currently CodeTools provides a Profiling subpackage that performs statement-level profiling of Maple code. Also included in the Profiling package are functions for performing coverage analysis of Maple code. Coverage analysis allows a programmer to determine which statements are utilized during the execution of the code.

IntegerRelations

 • The new IntegerRelations package contains two routines, LLL, and PSLQ, which solve specific computational problems. The LLL function is the Lenstra-Lenstra-Lovasz lattice basis reduction. The PSLQ function is Bailey and Fegusson's partial sum of least squares algorithm.

identify

 • The new identify function is closely related to and dependent on the IntegerRelations package. It attempts to determine the symbolic value of a floating-point number.
 > identify(3.146264370);
 $\sqrt{{2}}{+}\sqrt{{3}}$ (6)

OrderBasis

 • The new OrderBasis function computes an order basis for a set of functions. Roughly, it finds all polynomial coefficients that give an identity of the form:

$\mathrm{f1}\left(x\right)\mathrm{v1}\left(x\right)+\mathrm{...}+\mathrm{fn}\left(x\right)\mathrm{vn}\left(x\right)=0$

 up to a certain number of terms and with the degree of each vi bounded. This is similar to the IntegerRelations[PSLQ] algorithm, which finds integer relations for floating-point numbers.

gfun

 • The new gfun package produces and manipulates generating functions.
 • The package provides tools to compute with generating functions defined by equations. For example, given two generating functions defined by linear differential equations with polynomial coefficients, there is a procedure that computes the differential equation satisfied by their product.

MathematicalFunctions

 • The new MathematicalFunctions package provides general information on mathematical function in Maple, including identities, alternative definitions, and mathematical properties.
 • The new related FunctionAdvisor command also provides information on mathematical function in Maple.

QDifferenceEquations

 • The new QDifferenceEquations package solves the following problems.
 1 Find polynomial solutions of a linear q-difference equation with polynomial coefficients.
 2 Find rational solutions of a linear q-difference equation with polynomial coefficients.
 3 Find the universal denominator of the rational solutions of a linear q-difference equation with polynomial coefficients.
 4 Compute the q-dispersion of two polynomials.
 • For a given linear q-difference equation with polynomial coefficients, the main functionality of this package is to find closed-form polynomial or rational solutions. For finding rational solutions, the package constructs a universal denominator of such a solution. The construction of the universal denominator is based on the computation of a q-dispersion of two polynomials.
 • The functions PolynomialSolution and RationalSolution can solve a single q-difference equation or a system of such equations. In the latter case, the functions invoke LinearFunctionalSystems[PolynomialSolution] and LinearFunctionalSystems[RationalSolution] to find solutions.
 > with(QDifferenceEquations);
 $\left[{\mathrm{AccurateQSummation}}{,}{\mathrm{AreSameSolution}}{,}{\mathrm{Closure}}{,}{\mathrm{Desingularize}}{,}{\mathrm{ExtendSeries}}{,}{\mathrm{IsQHypergeometricTerm}}{,}{\mathrm{IsSolution}}{,}{\mathrm{PolynomialSolution}}{,}{\mathrm{QBinomial}}{,}{\mathrm{QBrackets}}{,}{\mathrm{QDispersion}}{,}{\mathrm{QECreate}}{,}{\mathrm{QEfficientRepresentation}}{,}{\mathrm{QFactorial}}{,}{\mathrm{QGAMMA}}{,}{\mathrm{QHypergeometricSolution}}{,}{\mathrm{QMultiplicativeDecomposition}}{,}{\mathrm{QPochhammer}}{,}{\mathrm{QPolynomialNormalForm}}{,}{\mathrm{QRationalCanonicalForm}}{,}{\mathrm{QSimpComb}}{,}{\mathrm{QSimplify}}{,}{\mathrm{RationalSolution}}{,}{\mathrm{RegularQPochhammerForm}}{,}{\mathrm{SeriesSolution}}{,}{\mathrm{UniversalDenominator}}{,}{\mathrm{Zeilberger}}\right]$ (7)
 > eq1 := (1-q^10-(q-q^10)*x)*y(q^2*x)-(1-q^20-(q^2-q^20)*x)*y(q*x) + q^10*(1-q^10-(q^2-q^11)*x)*y(x) = (q^21-q^20-q^12+q^10+q^2-q)*x;
 ${\mathrm{eq1}}{≔}\left({1}{-}{{q}}^{{10}}{-}\left({-}{{q}}^{{10}}{+}{q}\right){}{x}\right){}{y}{}\left({{q}}^{{2}}{}{x}\right){-}\left({1}{-}{{q}}^{{20}}{-}\left({-}{{q}}^{{20}}{+}{{q}}^{{2}}\right){}{x}\right){}{y}{}\left({q}{}{x}\right){+}{{q}}^{{10}}{}\left({1}{-}{{q}}^{{10}}{-}\left({-}{{q}}^{{11}}{+}{{q}}^{{2}}\right){}{x}\right){}{y}{}\left({x}\right){=}\left({{q}}^{{21}}{-}{{q}}^{{20}}{-}{{q}}^{{12}}{+}{{q}}^{{10}}{+}{{q}}^{{2}}{-}{q}\right){}{x}$ (8)
 > sol1 := PolynomialSolution(eq1, y(x));
 ${\mathrm{sol1}}{≔}{{\mathrm{_C}}}_{{1}}{}{{x}}^{{10}}{+}{{\mathrm{_C}}}_{{2}}{}{x}{-}{{\mathrm{_C}}}_{{2}}{+}{1}$ (9)
 > IsSolution(sol1, eq1, y(x));
 ${\mathrm{true}}$ (10)
 > eq2 := q^3*(q*x+1)*y(q^2*x) - 2*q^2*(x+1)*y(q*x)+y(x)*(x+q) = (q^6-2*q^3+1)*x^2+x*(q^5-2*q^3+q);
 ${\mathrm{eq2}}{≔}{{q}}^{{3}}{}\left({q}{}{x}{+}{1}\right){}{y}{}\left({{q}}^{{2}}{}{x}\right){-}{2}{}{{q}}^{{2}}{}\left({x}{+}{1}\right){}{y}{}\left({q}{}{x}\right){+}{y}{}\left({x}\right){}\left({x}{+}{q}\right){=}\left({{q}}^{{6}}{-}{2}{}{{q}}^{{3}}{+}{1}\right){}{{x}}^{{2}}{+}{x}{}\left({{q}}^{{5}}{-}{2}{}{{q}}^{{3}}{+}{q}\right)$ (11)
 > sol2 := RationalSolution(eq2, y(x));
 ${\mathrm{sol2}}{≔}\frac{{q}{}{{x}}^{{2}}{+}{{x}}^{{3}}{+}{{\mathrm{_C}}}_{{1}}}{{x}{}\left({x}{+}{q}\right)}$ (12)
 > IsSolution(sol2, eq2, y(x));
 ${\mathrm{true}}$ (13)

LREtools[HypergeometricTerm]

 • The new LREtools[HypergeometricTerm] subpackage solves the following problems.
 1 Find polynomial solutions of a linear difference equation with polynomial coefficients depending on a hypergeometric term.
 2 Find a hypergeometric dispersion of two polynomials depending on a hypergeometric term.
 3 Find a solution of an orbit problem.
 4 Find a universal denominator of the rational solutions of a linear difference equation with polynomial coefficients depending on a hypergeometric term.
 5 Find rational solutions of a linear difference equation with polynomial coefficients depending on a hypergeometric term.
 • The hypergeometric term in the linear difference equation is given by some name, for example, t. It can be specified either directly in the form of equation, for example, $t=n!$ , or by the pair of the name of term variable and the ratio of two successive values of the term, for example, $\left[t,n+1\right]$. An equation can contain a hypergeometric term specified directly (not by a special name) as well. In this case, the procedure extracts the term from the equation, transforms the equation to the form with a name representing a hypergeometric term, and then solves the transformed equation.
 > eq:=(t+n^2)*z(n+1)-(2*n*t+2*t+n^2+2*n+1)*z(n);
 ${\mathrm{eq}}{≔}\left({{n}}^{{2}}{+}{t}\right){}{z}{}\left({n}{+}{1}\right){-}\left({{n}}^{{2}}{+}{2}{}{n}{}{t}{+}{2}{}{n}{+}{2}{}{t}{+}{1}\right){}{z}{}\left({n}\right)$ (14)
 > (sol,r) := LREtools[HypergeometricTerm][PolynomialSolution](eq,z(n),t=(2^n)*n!);
 ${\mathrm{sol}}{,}{r}{≔}{{\mathrm{_C}}}_{{1}}{}{{n}}^{{2}}{+}{t}{}{{\mathrm{_C}}}_{{1}}{,}\left[{t}{,}{2}{}{n}{+}{2}\right]$ (15)
 > LREtools[HypergeometricTerm][SubstituteTerm](sol,r,n);
 ${{\mathrm{_C}}}_{{1}}{}\left({{2}}^{{n}}{}{\mathrm{\Gamma }}{}\left({n}{+}{1}\right){+}{{n}}^{{2}}\right)$ (16)
 > eq:=y(n+2)-(n!+n)*y(n+1)+n*(n!-1)*y(n);
 ${\mathrm{eq}}{≔}{y}{}\left({n}{+}{2}\right){-}\left({n}{!}{+}{n}\right){}{y}{}\left({n}{+}{1}\right){+}{n}{}\left({n}{!}{-}{1}\right){}{y}{}\left({n}\right)$ (17)
 > (sol, r) := LREtools[HypergeometricTerm][PolynomialSolution](eq,y(n));
 ${\mathrm{sol}}{,}{r}{≔}\frac{{t}{}{{\mathrm{_C}}}_{{1}}}{{n}}{,}\left[{t}{,}{n}{+}{1}\right]$ (18)
 > LREtools[HypergeometricTerm][SubstituteTerm](sol,r,n);
 ${\mathrm{\Gamma }}{}\left({n}\right){}{{\mathrm{_C}}}_{{1}}$ (19)
 > p:=(x+2+2^2*s)*(x+100+e^100*v);q:=s*(x+s)*(v+x);ext:=[s=2^x,v=e^x];
 ${p}{≔}\left({x}{+}{2}{+}{4}{}{s}\right){}\left({{e}}^{{100}}{}{v}{+}{x}{+}{100}\right)$
 ${q}{≔}{s}{}\left({x}{+}{s}\right){}\left({v}{+}{x}\right)$
 ${\mathrm{ext}}{≔}\left[{s}{=}{{2}}^{{x}}{,}{v}{=}{{e}}^{{x}}\right]$ (20)
 > LREtools[HypergeometricTerm][HGDispersion](p,q,x,ext);
 ${100}$ (21)
 >
 • For information on enhancements to the LREtools package, see Enhanced Packages in Maple 9: Part 1.