New Packages for Advanced Mathematics Research in Maple 8
Copyright 2002 Waterloo Maple Inc.
We showcase some of the new Maple 8 packages for advanced mathematics, including
Calculus of Variations with the VariationalCalculus package
Introduction
The new VariationalCalculus package provides routines for solving problems in the calculus of variations, which studies nature's most "efficient" curves and surfaces. Classical problems from the calculus of variations include:
Such problems can often be solved with the Euler-Lagrange equation, which generalizes the Lagrange Multiplier Theorem for minimizing functions of real variables subject to constraints. The Euler-Lagrange equation is easy to write down in general but notoriously difficult to write down and solve for most practical problems. The VariationalCalculus package automates the construction and analysis of the Euler-Lagrange equation.
Example: The Brachistochrone Problem
The Brachistochrone problem can be stated as follows: Given two endpoints in the plane, find the curve y(x) between them such that a ball of unit mass rolls along the curve under the influence of gravity in minimum time.
First we write down the falling time over an infintesimal distance dx in terms of y(x) and yInit , assuming the gravitational constant is 1. This is found in standard textbooks on classical mechanics.
We then use the EulerLagrange function to compute the Euler-Lagrange equations for this functional in terms of y(x) and its derivatives. This returns a set of ODEs.
Extract the first ODE from the list
Compute y(x) as a parametric curve (x(s), y(s)) using the dsolve command with the parametric option.
Specify the endpoints of the curve: (0,1) and (1, 1/2)
The parameter s is not equivalent to time t , so we must solve for the value of s at which
Use the endpoints to solve for the unknown constants K[1] and _C1
The finite-length curve (x(s), y(s)) is parametrized over , so
The path along which a ball would roll in minimum time under the influence of gravity. The result is surprising because the curve actually dips below the right end point.
SNAP: Symbolic-Numeric Algorithms for Polynomials
Many polynomials used in practice have inexactly known coefficients. You may have a polynomial that describes your data, fitted using least-squares. You may have a formula with parameters for each coefficient, but the values of the parameters may be known only through experimental measurements. Such polynomials arise in many applied problems, from direct mathematical models through normal forms and bifurcation theory to geometric problems described in floating-point arithmetic for Computer-Aided Design.
The idea that we don't know the coefficients precisely moves us from the domain of algebra to the domain of analysis. In particular, this allows us to bring to bear modern tools of numerical analysis on problems of computational algebra and geometry.
Experience with numerical linear algebra suggests that it will be useful to replace classical discrete algorithms for polynomial problems with continuous, iterative algorithms for approximate polynomial problems.
The new SNAP package in Maple 8 provides tools for the algebraic manipulation of numeric polynomials. It includes support for quotient, remainder and numeric gcd, numerical computations that give the last numerically stable euclidean reduction, an approximation to the distance of a closest common root of two relatively prime numeric polynomials and similar operations.
Examples using the SNAP Package
The AreCoprime function determines whether two numeric polynomials are relatively prime up to a given error bound . For example,
The EpsilonGCD(a,b,z) function returns a univariate numeric polynomial g together with a positive float epsilon such that g is an epsilon-GCD for the input polynomials ( a , b ).
The distance to common divisors is near 0, meaning that an epsilon-GCD exists.
The distance to common divisors is relatively large, meaning an epsilon-GCD could not be found.
The EuclideanReduction(a,b,z) function computes in a stable manner a polynomial pair that is equivalent to the input polynomials ( a , b ) but has smaller degrees.
Matrix Polynomial Algebra
Matrices of polynomials have many algebraic properties that are similar to ordinary polynomials. They may be added, multiplied, have degrees and may be placed in normal form. They may even have right and left factors and right or left greatest common factors. The MatrixPolynomialAlgebra package provides tools for the algebraic manipulation of matrix polynomials. In particular, there are tools that perform basic polynomial operations , such as determining degrees and coefficients; perform algebraic operations , such as matrix polynomial left and right division, and determining greatest common divisors and least common multiples; convert to special forms of matrix polynomials , such as normal forms and reduced forms; and determine bases for the kernel of a matrix polynomial .
Techniques based on matrix polynomials are used in many applications, for example in linear system theory, control theory and signal processing. For example, multi-input/multi-output (MIMO) linear systems of the form can be studied (after the taking of Laplace transforms) through the transfer function . Similarly, when designing feedback control systems, matrix polynomial equations of the form may arise, which yield the controller transfer matrix . In both applications given above, one needs to be able to work with polynomial matrix fractions. But polynomial matrix fractions do not have a unique representation, and so a fundamental question is how to get the "best" matrix fraction representation. For example, "best" means that is irreducible or that the denominator is in canonical form . Hence a need for coprimeness tests and matrix polynomial GCDs and for algorithms computing various reduced and canonical forms such as the Hermite, Popov and Smith forms.
Examples using the Matrix Polynomial Algebra package
The Coeff command extracts the coefficients of the powers of a variable in a polynomial matrix.
The LeftDivision(A, B, x) function divides B into A on the left, producing a quotient Q and a remainder R such that A = B . Q + R . The RightDivision () function works analogously. For example, if
then a quotient Q and remainder R can be determined via
The result can then be verified via
The MatrixGCRD(A,B,z) function computes the greatest common right divisor of A and B along with the associated matrix diophantine equation
with the information about the diophantine equation given in the list U
The HermiteForm[row](A) function computes the row reduced echelon form of an m x n rectangular matrix of univariate polynomials in x over the field of rational numbers Q , or rational expressions over Q
Modular Linear Algebra
The LinearAlgebra:-Modular sub-package is a highly efficient suite of tools for performing dense linear algebra computations in , the integers modulo m over the positive range.
As a programmer package, the key focus is on efficient computation mod m, so for all routines that accept modular data in Matrix/Vector form, no checking of the input data (to verify that all data is in the range 0..m-1) is performed.
Conversions between Special Functions
A flexible conversion facility in the mathematical language is as important as a dictionary in spoken languages. Maple 8 introduces such a tool in a computer algebra system for the first time, implemented as a net of conversion routines permitting the expression of any mathematical function in terms of another one, whenever that is possible, as a finite sum of terms. When the parameters of the functions being converted depend on symbols in a rational manner, any assumptions on these symbols made by the user are taken into account at the time of performing the conversions (see assuming ).
Converting the original expression ee directly to hypergeom we arrive at an identity for hypergeometric functions
The main idea behind the Maple 8 conversion network is to split the set of mathematical functions into three main subsets, according to their hypergeometric representation as 2F1, 1F1 and 0F1 hypergeometric functions. Then, generally speaking, conversions - when possible - can be performed among functions of the same class. The Maple 8 routines allow you to convert to any of 58 mathematical functions, including all the elementary transcendental ones and most of the special functions of mathematical physics:
arccos , arccosh , arccot , arccoth , arccsc , arccsch , arcsec , arcsech , arcsin , arcsinh , arctan , arctanh , cos , cosh , cot , coth , csc , csch , exp , ln , sec , sech , sin , sinh , tan , tanh , GAMMA , dilog , polylog , AiryAi , AiryBi , HankelH1 , HankelH2 , BesselI , BesselJ , BesselK , BesselY , MeijerG , hypergeom , Ei , erf , KummerM , KummerU , WhittakerM , WhittakerW , CylinderU , CylinderV , CylinderD , LaguerreL , HermiteH , GegenbauerC , LegendreP , LegendreQ , ChebyshevT , ChebyshevU , EllipticE , EllipticK , JacobiP
Taking into account the possible split of the set of mathematical functions into hypergeometric classes as well as their classification found in typical handbooks like Abramowitz and Stegun, the Maple 8 routines also permits converting to a function class ; that is, attempting to rewrite a given expression by using any of the functions of a specified class.
The function classes understood by the Maple 8 mathematical function conversion network are:
trig , trigh , arctrig , arctrigh , elementary , GAMMA_related , Kelvin , Airy , Hankel , Bessel_related , 0F1 , Ei_related , erf_related , Kummer , Whittaker , Cylinder , 1F1 , Orthogonal_polynomials , Elliptic_related , Legendre , Chebyshev
The new conversion routines also introduce the concept of "rule conversion", that is, a conversion where the input and output are expressed using the same function but applying identity rules to it. For example, the HermiteH function
can have its (first) parameter raised or lowered by one. Below, "raise a" stands for "raise the first parameter":
For functions depending on more parameters, for example, LegendreP or JacobiP , you can raise the second or third parameters using "raise b" or "raise c". The rules known by the Maple 8 conversion routines are:
"raise a" , "lower a" , "normalize a" , "raise b" , "lower b" , "normalize b" , "raise c" , "lower c" , "normalize c" , "mix a and b" , "1F1 to 0F1" , "0F1 to 1F1"
The mathematical identities which can be derived using the new conversion routines can be checked visually in Maple 8 using the new plotcompare routine, which draws four 3-D plots, comparing the real and imaginary parts of two expressions when evaluated over a complex variable z = x + I y .
All the Maple 8 conversion routines listed in the tables above understand a uniform set of optional arguments for restricting the conversion process in varied manners, for example, performing (or excluding) the conversion process only for some functions (see convert,to_special_function ), therefore providing the necessary flexibility for optimal symbolic manipulation.