Other Improvements in Maple 15 - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : System : Information : Updates : Maple 15 : updates/Maple15/otherimprovements

Other Improvements in Maple 15

 

Introduction

The Bell polynomials

Magma

DynamicSystems

DEtools

PDEtools

VectorCalculus

numelems

upperbound, lowerbound

Array and Table Support in the member Command

indices and entries Commands

Array Type Check

EqualEntries command

Packed Record Structure

Testing Code

Easy Repetition of Debugger Commands

Updated Maple Programming Guide

StringTools

Introduction

Maple 15 includes additional enhancements for in the core areas of mathematics and Maple programming, and more support for application areas from physics to control design.  These improvements include:

• 

The introduction of Bell polynomials

• 

A new package for computing with magmas

• 

Improvements to the DynamicSystems package

• 

New commands for working with Arrays and other data structures

• 

Improvements to the Maple debugger

• 

A new Maple Programming Guide

The Bell polynomials

• 

New in Maple 15, BellB, IncompleteBellB and CompleteBellB respectively represent the Bell polynomials, the incomplete Bell polynomials - also called Bell polynomials of the second kind - and the complete Bell polynomials. The BellB polynomials are defined in terms of the Stirling numbers of the second kind as

BellBn,z=k=0nStirling2n,kzk

• 

For the definition of the IncompleteBellB polynomials see IncompleteBellB. The CompleteBellB polynomials are in turn defined in terms of the IncompleteBellB polynomials as

CompleteBellBn,z1,z2,...,zn=k=1nIncompleteBellBn,k,z1,z2,...,znk+1

• 

The Bell polynomials appear in various applications, including for instance Faà di Bruno's formula

ⅆnⅆxnfgx=k=0nfkgxIncompleteBellBn,k,gx,gx,...,gnk+1x

  

where fkgx represents the kth derivative of fx evaluated at gx; the exponential of a formal power series

ⅇn=1anznn!=n=0znCompleteBellBn,a1,...,an

  

and as coefficients in the following exponential generating function

ⅇⅇt1z=n=0BellBn,ztnn!

  

Examples

BellB(n, z) = sum(Stirling2(n, k)*z^k, k=0..n);

BellBn,z=k=0nStirling2n,kzk

(1)

eval((1), n = 4);

z4+6z3+7z2+z=z4+6z3+7z2+z

(2)
• 

For illustration purposes consider the generic sequence of five variables zj

Z := z[1], z[2], z[3], z[4], z[5];

Zz1,z2,z3,z4,z5

(3)

IncompleteBellB(4, 2, Z);

4z1z3+3z22

(4)

IncompleteBellB(5, 3, Z);

10z12z3+15z1z22

(5)
• 

These are the first 5 elements of the convolution operation involved in the computation above, proportional to the 5th element of this following sequence (see IncompleteBellB)

IncompleteBellB:-DiamondConvolution(5, 3, [Z]);

0,0,6z13,36z12z2,60z12z3+90z1z22

(6)
• 

At zj=1 for all j, the following identity holds

IncompleteBellB(n, k, 1, 1, 1, 1, 1, 1, 1) = Stirling2(n, k);

IncompleteBellBn,k,1,1,1,1,1,1,1=Stirling2n,k

(7)

eval((7), {n=7, k=4});

350=350

(8)
• 

For zj=j! for all j=1..nk+1, the following identity, here expressed in terms of the inert form %IncompleteBellB and the inert sequence %seq, holds

%IncompleteBellB(n, k, %seq(j!, j=1..(n-k+1))) = binomial(n,k)*binomial(n-1,k-1)*(n-k)!;

?=nkn1k1nk!

(9)

eval((9), {n=8, k=3, %seq = seq});

?=141120

(10)

value((10));

141120=141120

(11)
• 

The value of CompleteBellB5,Z is obtained by adding the values of IncompleteBellB5,k,Z for k=1..5 as explained in the CompleteBellB

CompleteBellB(5, Z);

z15+10z13z2+10z12z3+15z1z22+5z1z4+10z2z3+z5

(12)

Magma

• 

The new Magma package was added to allow you to manipulate small magmas represented by their Cayley tables.  The package supports enumeration of small magmas, isomorphism testing, and a selection of predicates that permit you to determine properties of small magmas.

with( Magma ):

Enumerate( 4, 'quandle' ); # count quandles of order 4

7

(13)

L := Enumerate( 2, 'output' = 'list' ); # list all isomorphism class of 2-element magmas

L1111,1112,1121,1122,1211,1212,1221,2111,2121,2211

(14)

select( IsCommutative, L ); # find the commutative ones

1111,1112,1221,2111

(15)

CS := Enumerate( 5, 'associative', 'commutative', 'output' = 'list' ): # find all 5-element commutative semigroups

andmap( IsSemigroup and IsCommutative, CS ); # check

true

(16)

m1 := Array( 1 .. 3, 1 .. 3, [[1,2,3],[2,3,1],[3,1,2]], 'datatype' = 'integer'[4], 'order' = 'C_order' );

m1123231312

(17)

m2 := Array( 1 .. 3, 1 .. 3, [[2,3,1],[3,1,2],[1,2,3]], 'datatype' = 'integer'[4], 'order' = 'C_order' );

m2231312123

(18)

AreIsomorphic( m1, m2 );

true

(19)

unwith( Magma ):

DynamicSystems

• 

The EquilibriumPoint command in the DynamicSystems package has been updated. A new option, evaluationlimit, was added.

DEtools

• 

The DEtools package has two new commands, Closure and Desingularize.

PDEtools

  

For examples on the developments described in this section, see What's New in Differential Equations (PDEs).

• 

The following commands were significantly enhanced in their functionality: ConservedCurrents, D_Dx, DeterminingPDE, Eta_k, InfinitesimalGenerator, Infinitesimals, IntegratingFactors, InvariantEquation, and Solve.

• 

In Maple 15, the entire set of symmetry commands of PDEtools:

• 

automatically use textbook mathematical jet notation on input and output;

• 

handle list of infinitesimals or the corresponding symmetry generator operators in equal footing;

• 

understand different jet notations as representing the same mathematical objects;

• 

return list of infinitesimals with infinitesimal labels in mathematical notation, unless your input contains infinitesimals without labels;

• 

return results in the jet notation of the input you pass to them;

• 

optionally return in any jet notation you request.

• 

Nine new PDEtools:-Library commands were added to the library of tools to manipulate PDE systems and facilitate programming with them. These are: BuildFunctionFieldHint, ConstructTrivialSymmetry, GenerateInfinitesimalLabels, GetNew_Fn, GetNotation, GetProlongationValue, InfinitesimalGeneratorToList, and SortDerivatives.

• 

Three new commands were added to PDEtools.

– 

FunctionFieldSolutions is a new command that involves an innovative approach to computing exact solutions to DE systems involving mathematical functions, possibly inequations, ODEs, and also non-differential equations. In these cases, due to the presence of nonpolynomial objects, the original Maple approach by decoupling of the system using differential polynomial extensions, although powerful, sometimes fails in solving the problem. The new approach in FunctionFieldSolutions skips entirely that step and instead searches for solutions that can be written as a power series (with some upper bound degree n) in the mathematical functions and its derivatives (up to some upper bound differential order m), having for coefficients multivariable polynomials (with some upper bound degree r). In turn these polynomials have undetermined coefficients that get adjusted, resulting in the solution. To compute the key values of n,m,r to construct these function field solutions, the new command maps the problem into one that can be tackled with the existing PDEtools:-Library:-UpperBounds (see PDEtools[Library]).

– 

SymmetryCommutator is a new command to compute the commutator between two symmetries, given either as lists of infinitesimals or as infinitesimal generator procedures. This command is useful when studying the properties of a group of symmetries or when deriving the group constants or relations to make the group complete.

– 

SymmetryGauge is a new command to gauge PDE symmetries. It is well known that an ODE symmetry can be rewritten in different ways (see Xgauge). It is not so well known, but the same happens with PDE symmetries. The ability to rewrite a symmetry is relevant for a number of purposes. First, that permits identifying that two apparently different symmetries are actually the same by rewriting them in evolutionary form (gauge ξ=0). Second, symmetries that appear as dynamical ones can frequently be rewritten as pointlike, transforming the usability of the symmetry from perhaps very difficult into straightforward. Finally, depending on the form of the symmetry, by rewriting them it is frequently possible to simplify its form considerably so that invariants of canonical coordinates become computable and so the symmetry can be used to reduce the number of independent variables of PDE systems.

VectorCalculus

• 

The VectorCalculus[Wronskian] command now takes a determinant option, which requests that the determinant of the Wronskian matrix of the input function be returned, as well as the Wronskian matrix itself.

with(VectorCalculus):

W, det := Wronskian( [sin(t), cos(t)], t, determinant );

W,detsintcostcostsint,sint2cost2

(20)

numelems

• 

A new command, numelems, provides a single function to return the number of elements stored in any expression of type indexable.

numelems(<1,2;3,4>);

4

(21)

numelems([1,2,3,4]);

4

(22)

numelems(table({1=1,2=2,3=3}));

3

(23)

numelems("abc");

3

(24)

upperbound, lowerbound

• 

New commands, upperbound and lowerbound, have been added to provide a simple function to find the upper and lower bounds of an rtable's dimensions.

M := <1,2,3;4,5,6>:

(m,n) := upperbound(M);

m,n2,3

(25)

upperbound(M,1);

2

(26)

upperbound(M,2);

3

(27)

lowerbound(M,1);

1

(28)

lowerbound(M,2);

1

(29)

Array and Table Support in the member Command

• 

The member command can now determine if an expression is contained inside an Array, Matrix, or Vector.

member(y, <x,y,z>);

true

(30)
• 

The member command also can be used to test membership in a table.

member(y, table([x,y,z]));

true

(31)

indices and entries Commands

• 

A new pairs option has been added to both of the indices and entries commands. This allows extraction of index = value pairs from a table or rtable.

indices(<1,2;3,4>,'pairs');

1&comma;1=1,1&comma;2=2,2&comma;1=3,2&comma;2=4

(32)

Array Type Check

• 

Open-ended ranges are now allowed Array, Matrix, and Vector type checks.

type(<1,2;3,4>,'Matrix(1..,1..)');

true

(33)

EqualEntries command

• 

The EqualEntries command compares elements inside two separate container structure. When comparing two container structures, the EqualEntries command returns true if the two structures are the same kind of structure, have the same number of elements, and contain the same elements in the same order, with some exceptions.  

Packed Record Structure

• 

The Record constructor function can now be called with the indexed name Record[packed], to produce a packed record.

• 

Unlike a regular record, a packed record does not create a unique instance of each field name for each record instance. When working with thousands of similar records each with many fields, this can save a significant amount of memory.

• 

Fields of packed records do not exhibit last-name evaluation. That is, the expression r:-a always produces a value, even if that value is a procedure, table, Matrix, Vector, or another record.

• 

Similarly, it is not possible for a packed record field to not have a value. The assigned function will always return true, and unassigning a packed record field will set its value to NULL instead.

Testing Code

• 

The new command CodeTools[Test] has been provided as a front-end to the verify command to facilitate the creation of suites of tests for projects written in Maple.

restart;

CodeTools[Test](int(x^2,x), x^3/3, label="Test Pass");

Test Pass passed

CodeTools[Test](int(x,x^2), x^3/3, label="Test Fail");

Test Fail failed
 Received error: [int, "integration range or variable must be specified in the second argument, got %1", x^2]

Error, (in CodeTools:-Test) TEST FAILED: Test Fail

Easy Repetition of Debugger Commands

• 

The debugger commands cont, next, step, into, outfrom, and return can be followed by an optional positive integer specifying the number of times the command is to be repeated. For example, into 10 instructs to debugger to continue execution for the next 10 statements in the current procedure.

Updated Maple Programming Guide

• 

The Maple Introductory Programming Guide and Maple Advanced Programming Guide have been combined into a single guide. The new Maple Programming Guide provides updated information and examples, including:

– 

The latest Maple programming features

– 

An overview of Maple's data structures

– 

A new chapter on parallel programming

– 

Testing your code

• 

See the new Maple Programming Guide.

StringTools

• 

The new StringSplit command has been added to the StringTools package. You use it to split a string at a fixed string.  It is similar to the RegSplit command but, since the pattern is a simple string rather than a regular expression, it uses a faster algorithm.

with( StringTools ):

s := Random( 10^6, 'lower' ):

time( StringSplit( s, "abc" ) );

0.002

(34)

time( RegSplit( "abc", s ) );

0.016

(35)

unwith( StringTools ):

• 

The FormatMessage command supports automated pluralization. See StringTools[FormatMessage] for details.

See Also

Index of New Maple 15 Features