Packages - Maple Help

Online Help

All Products    Maple    MapleSim


New and Enhanced Packages in Maple 14

Maple 14 contains the following new packages and enhancements to existing packages.

New Packages

  

CUDA package

  

DifferentialAlgebra package

Enhanced Packages

  

DEtools package

  

DynamicSystems package

  

Groebner package

  

IntegerRelations package

  

LinearAlgebra package

  

PDEtools package

  

RegularChains package

  

RootFinding package

  

StringTools package

  

Threads[Task] package

 

CUDA

DifferentialAlgebra

DEtools

DEtools

DynamicSystems

Groebner

IntegerRelations

LinearAlgebra

PDEtools

RegularChains

RootFinding

StringTools

Threads[Task]

CUDA

• 

We have added GPU support for accelerating LinearAlgebra Matrix multiplication using NVIDIA's CUDA technology.  The new CUDA package can be used to enable GPU acceleration. See Efficiency Improvements in Maple 14 for more details and an example.

DifferentialAlgebra

• 

The new DifferentialAlgebra package supersedes the previous Maple diffalg with an improved set of commands and interface easier to use, for simplifying and manipulating systems of polynomial differential equations (ODE, PDE, DAE, PDAE), also running all the core computations directly in C, faster.

• 

The main functionality of the package is provided by the RosenfeldGroebner command, which permits triangularizing a differential equation system so that it can be solved eliminating one variable at a time, simplifying the system with respect to its integrability conditions, or determining its singular cases.

• 

Commands are also provided to tackle related problems, like BelongsTo for deciding membership to a differential ideal, ReducedForm for reducing a system of partial differential equations with respect to another one and PowerSeriesSolution for computing formal power series solutions for differential equation systems. Other commands for analyzing mathematical properties of differential systems or do algebraic manipulation and related programming are listed in DifferentialAlgebra.

• 

The new features in DifferentialAlgebra allow for a faster and more thorough analysis of DE systems. Among the novelties:

– 

there is flexibility to tackle systems where the dependent variables (functions) have different dependency or no dependency at all;

– 

the systems can include variables and functions that are arbitrary;

– 

it is possible to optionally compute only the general case, or additionally only the essential singular cases, or all of them (default behavior);

– 

simplification of polynomial differential systems can now be performed over nontrivial differential fields (related to the new handling of arbitrary functions);

– 

the package includes a very recent algorithm for the fast recomputation of an equivalent differential equation system (represented by its ideal) after changing the ranking ordering for the dependent and/or independent variables;

• 

As for the redesigned interface, aiming at making computations easier, faster and more flexible

– 

different mathematical notations can be used making easier to enter a problem as well as to read the solution returned in compact notation. It is not necessary to indicate what is the notation being used in the input and you can optionally specify the notation desired in the output;

– 

it is not required anymore to specify the basefield of a computation. Instead, the basefield is consistently derived from the input automatically, on the fly;

– 

you can change or add to the dependent, independent and arbitrary variables and functions specified in the differentia ring, as well as changing their ranking, without having to redefine the differential ring;

– 

you can specify algebraic relations between the arbitrary variables and functions of a PDE system by passing them directly to RosenfeldGroebner in a natural way, as in relations = {..equations..}.

Parametric differential systems

with(DifferentialAlgebra);

BelongsTo,DifferentialRing,Equations,Get,Inequations,Is,NormalForm,PowerSeriesSolution,ReducedForm,RosenfeldGroebner,Tools

(1)

Consider this nonlinear ODE in ux that also depends on a parameter p

ODE := (p-1)*diff(u(x),x)-u(x)^2;

ODEp1ⅆⅆxuxux2

(2)

The following differential ring permits to manipulate ODE" as if p' is also a dependent variable (with no dependency, all its derivatives are zero), thus realizing the concept of a parameterized ODE.

ring := DifferentialRing(derivations = [x], blocks = [u,p]);

ringdifferential_ring

(3)

Analyze the problem now and determine its singular case, finding it is related to the critical value p=1

ideal := RosenfeldGroebner(ODE, ring);

idealregular_differential_chain,regular_differential_chain

(4)

Here are the two cases:

Equations(ideal, solved);

ⅆⅆxux=ux2p1,ux=0,p=1

(5)

Regard now p as arbitrary, so do not discuss cases in terms of its values

ideal := RosenfeldGroebner(ODE, ring, arbitrary = p);

idealregular_differential_chain

(6)

Equations(ideal, solved);

ⅆⅆxux=ux2p1

(7)

Power series solutions

Consider the heat equation, here entered directly in (simpler) jet notation, where subscripts indicate derivations

PDE := [u[t, t]-u[x]];

PDEut,tux

(8)

This is a problem in one dependent variable u(t, x); set the differential ring

ring := DifferentialRing(derivations = [t, x], blocks = [u]);

ringdifferential_ring

(9)

Compute the ideal for PDE

ideal := RosenfeldGroebner(PDE, ring);

idealregular_differential_chain

(10)

The series solution for initial values depending on two arbitrary functions, u(0, x) = f(x) and D[1](u)(0, x) = g(x) also entered in jet notation.

PowerSeriesSolution(ideal, 2, [u = f(x), u[t] = g(x)]);

ut,x=f0+Df0x+g0t+D2f0x22+Dg0tx+Df0t22

(11)

Normal Forms

Consider the following PDE system

sys := [diff(g(x,y),x) = 2*g(x,y)^2+2, diff(g(x,y),y)^2 = -1/4*(-g(x,y)^4-2*g(x,y)^2-1)/y];

sysxgx,y=2gx,y2+2,ygx,y2=gx,y42gx,y214y

(12)

So this is a problem with one unknown gx,y, set the differential ring

ring := DifferentialAlgebra[DifferentialRing](derivations = [x,y], blocks = [g]):

Compute now the ideal but only the general case, disregarding singular cases

ideal := RosenfeldGroebner(sys, ring, singsol = none);

idealregular_differential_chain

(13)

Check the equations representing this general case in the ideal computed

eqs := Equations(ideal[1], solved);

eqsxgx,y=2gx,y2+2,ygx,y2=gx,y42gx,y214y

(14)

Here is one of its solutions (see pdetest)

sol := tan(2*x-y^(1/2));

soltan2xy

(15)

pdetest(g(x,y) = sol, eqs);

0,0

(16)

Thus, these two following expressions expr1 and expr2 

expr1 := 4*diff(g(x,y), x,y)*y/(g(x,y)^4+2*g(x,y)^2+1) - 4*diff(g(x,y), y)*y*(4*g(x,y)^3*diff(g(x,y), x) + 4*g(x,y)*diff(g(x,y),x))/(g(x,y)^4+2*g(x,y)^2+1)^2;

expr142xygx,yygx,y4+2gx,y2+14ygx,yy4gx,y3xgx,y+4gx,yxgx,ygx,y4+2gx,y2+12

(17)

expr2 := - diff(g(x, y), x, y)/diff(g(x, y), y)^2;

expr22xygx,yygx,y2

(18)

are actually equivalent, modulo the differential ideal presented by ideal. That is, these two expressions are equal when evaluated at g(x, y) = sol, and, more generally, when evaluated at any solution of the differential ideal:

simplify(subs(g(x,y) = sol, expr1 - expr2));

0

(19)

The equivalence between expr1 and expr2 fact can be derived by computing their normal forms and checking that they are syntactically equal

NF[1] := NormalForm(expr1, ideal);

NF116ygx,ygx,yygx,y4+2gx,y2+1

(20)

NF[2] := NormalForm(expr2, ideal);

NF216ygx,ygx,yygx,y4+2gx,y2+1

(21)

NF[1] - NF[2];

0

(22)

DEtools

DEtools[particularsol] using integrating factors

particularsol can now compute particular solutions for an nth order ODE from any incomplete set (less than n) integrating factors admitted by ODE. This is of use when the ODE cannot be solved in general but a particular solution may be sufficient. For example, the general solution of this second order nonlinear ODE

ode := diff(y(x), x,x) = (-p*y(x)^p*(p- 1)*diff(y(x), x)^2 + x*diff(y(x), x)*y(x)^2 + y(x)^3)/(y(x)^(p+1))/p;

odeⅆ2ⅆx2yx=pyxpp1ⅆⅆxyx2+xⅆⅆxyxyx2+yx3yxp+1p

(23)

is not known. In Maple 13, two particular solutions depending on no arbitrary constants can be computed for it exploring its symmetries. One integrating factor for this ode can however also be computed, and from it in Maple 14 a new particular solution depending on 1 arbitrary constant _C1 is computable, the third one in this sequence of solutions;

particular_sol := DEtools[particularsol](ode);

particular_solyx=0,yx=ⅇlnx2p12pp1,yx=px2+2_C1px2p1p121p1

(24)

To illustrate the use of this new particular solution, consider the initial value problem that consists on solving this ode subject to the initial values

iv := y(0) = 1, D(y)(0) = 0;

ivy0=1,Dy0=0

(25)

The standard approach of computing first the general solution of ode is here of no use because that solution is not known. Having computed the one parameter (_C1) solution with particularsol, you can try to adjust it to match these initial conditions in different ways. For instance, using DEtools[IVPsol], introduced in Maple 13 for these purposes, you can pass directly the particular solution you want to be used and the initial values, in this example solving the ODE and initial value problem entirely, as in

DEtools[IVPsol]([iv], particular_sol[3]);

yx=px2x2+2pp1p121p1

(26)

Alternatively you can pass this particular solution to dsolve so that it tackles the problem departing from this given solution 

dsolve([ode, iv], solution = particular_sol[3]);

yx=px2x2+2pp1p121p1

(27)

Note that this approach is also automatically explored by dsolve in Maple 14 even if you do not request it (though in that case the computation will take significantly longer because a general solution is first attempted with no success)

sol := dsolve([ode, iv]);

solyx=px2x2+2pp1p121p1

(28)

DEtools[firint] and complete sets of first integrals for linear ODEs

The DEtools[firint] command can now compute a complete set of first integrals for linear ODEs, that is as many as the differential order and all independent from each other. A textbook example:

PDEtools[declare](g(x), y(x), prime = x);

gxwill now be displayed asg

yxwill now be displayed asy

derivatives with respect toxof functions of one variable will now be displayed with '

(29)

ode := diff(y(x), x,x) = ((diff(g[1](x), x,x))*g[2](x)-g[1](x)*(diff(g[2](x), x,x)))*(diff(y(x), x))/(g[2](x)*(diff(g[1](x), x))-g[1](x)*(diff(g[2](x), x)))+((diff(g[1](x), x))*(diff(g[2](x), x,x))-(diff(g[1](x), x,x))*(diff(g[2](x), x)))*y(x)/(g[2](x)*(diff(g[1](x), x))-g[1](x)*(diff(g[2](x), x)))+((diff(g[0](x), x,x))*(-g[2](x)*(diff(g[1](x), x))+g[1](x)*(diff(g[2](x), x)))+((diff(g[1](x), x))*g[0](x)-g[1](x)*(diff(g[0](x), x)))*(diff(g[2](x), x,x))-((diff(g[2](x), x))*g[0](x)-g[2](x)*(diff(g[0](x), x)))*(diff(g[1](x), x,x)))/(-g[2](x)*(diff(g[1](x), x))+g[1](x)*(diff(g[2](x), x)));

odey''=g1''g2g1g2''y'g2g1`'`g1g2`'`+g1`'`g2''g1''g2`'`yg2g1`'`g1g2`'`+g0''g2g1`'`+g1g2`'`+g1`'`g0g1g0`'`g2''g2`'`g0g2g0`'`g1''g2g1`'`+g1g2`'`

(30)
  

This ode is the most general 2nd order non-homogeneous linear ODE having for solution basis g1x and g2x, for the homogeneous part, and g0x as particular solution of the whole non-homogeneous equation, so the basis of solutions is represented in Maple by

basis_sol := [[g[1](x), g[2](x)], g[0](x)];

basis_solg1,g2,g0

(31)
  

To verify that basis_sol is a complete basis for the solutions of ode, construct with it the general solution then test it using odetest

sol := y(x) = _C1*g[1](x) + _C1*g[2](x) + g[0](x);

soly=_C1g1+_C1g2+g0

(32)

odetest(sol, ode);

0

(33)
  

Compute now a complete set of first integrals for ode

first_integrals := DEtools[firint](ode, y(x), basis = basis_sol);

first_integralsyg0g2`'`g2y'g0`'`g2g1`'`+g1g2`'`,y+g0g1`'`+g1y'g0`'`g2g1`'`+g1g2`'`

(34)
  

Verify this result

map(DEtools[firtest], [first_integrals], ode, y(x));

0,0

(35)

DEtools

DynamicSystems

• 

A new command, NyquistPlot, was added to the DynamicSystems package. It plots the Nyquist plot of a linear system.

• 

A new command, StepProperties, was added to this package. It calculates the properties of a step response.

• 

Two new commands, EquilibriumPoint and Linearize, were added to this package.  EquilibriumPoint finds a local equilibrium point for a nonlinear system of DAEs.  Linearize allows a set of nonlinear differential equations to be linearized and converted to a state-space form. These commands are useful in control system design, as you can analyze trim conditions, linearize at a trim (equilibrium) point, and then work with the resulting state-space representation of the linear model.

• 

A new command, SystemConnect, was added to this package. This allows different DynamicSystems objects to be interconnected.

• 

A new option adaptive was added to the following commands: BodePlot, FrequencyResponse, MagnitudePlot, NyquistPlot, and PhasePlot. This option allows the specification of the frequency points to be spaced adaptively, which results in a better looking plots.

Groebner

• 

Use the Groebner[Support] command to inspect the monomials in the polynomial in the Groebner basis.

Groebner[Support]([x^2+23*2+12, y-x/2-1/3]);

x2,1,1,x,y

(36)

IntegerRelations

• 

The IntegerRelations[PSLQ] command has been extended to work over the complex numbers. For example, this can be used to find the minimal polynomial of a complex algebraic number:

alpha := sqrt(2)+(-1)^(1/3);

α2+−113

(37)

powers := map(evalf, [seq(expand(alpha^i), i=0..4)]);

powers1.,1.914213562+0.8660254037I,2.914213562+3.315515146I,2.707106782+8.870387035I,−2.500000000+19.32423841I

(38)

u := IntegerRelations[PSLQ](powers);

u7,2,−1,−2,1

(39)

minpoly := PolynomialTools[FromCoefficientList](u,x);

minpolyx42x3x2+2x+7

(40)

radnormal(eval(minpoly, x=alpha));

0

(41)

unassign('u');

LinearAlgebra

• 

Improved method for providing output options to LinearAlgebra commands. Most commands in the LinearAlgebra package return one or more Matrices or Vectors.  Until now, the mechanism for passing options to the corresponding Matrix or Vector constructor has been through the inclusion of an outputoptions=[...] option.  This was safe and effective, but somewhat unwieldy. As of this release, these constructor options can be included directly in the LinearAlgebra command itself.  For example,

LinearAlgebra[RandomMatrix](5, datatype=float);

77.68.−74.−15.−53.−66.−35.−55.−36.−63.−35.7.95.2.−3.73.44.0.25.37.22.−60.26.7.18.

(42)
• 

The older form, using the outputoptions=[...] option, continues to be valid, and, in particular, continues to be necessary in the case of LinearAlgebra commands which return more than one object. For example,

LinearAlgebra[LUDecomposition]( <1,2,3;4,5,6;7,8,9>, output=['P','L','U'], outputoptions['L']=[datatype=float] );

100010001,1.0.0.4.1.0.7.2.1.,1230−3−6000

(43)
• 

If a constructor option appears both in the command calling sequence directly and as an outputoptions suboption, the latter takes precedence, regardless of the order in which the options appear.  This allows you to specify options which are to apply to all output objects and then override specific constructor options for selected output objects.

LinearAlgebra[LUDecomposition]( <1,2,3;4,5,6;7,8,9>, output=['P','L','U'], datatype=float, outputoptions['L']=[datatype=integer] );

1.0.0.0.1.0.0.0.1.,100410721,1.2.3.0.−3.−6.0.0.0.

(44)
• 

New commands CARE and DARE have been added to the LinearAlgebra package. These provide functionality to numerically solve real-valued, implicit linear systems known respectively as Continuous and Discrete Algebraic Riccati Equations. These equations feature prominently in the area of Optimal Control, such as in computational implementations of Linear-Quadratic Regulators.

PDEtools

• 

Two new commands were added to PDEtools.

– 

Solve is an unified command to compute exact, series or numerical solutions, possibly independent of indicated variables, for systems of algebraic or differential equations, possibly including inequations, initial values or boundary conditions. In this sense Solve provides the functionality of solve, fsolve, dsolve, pdsolve and more, through a single command that understands which command is to be called according to your input. Second, Solve has the ability to compute these solutions independent of specified variables, generalizing the functionality provided by solve[identity] to exact, series or numerical solutions, to systems of non-polynomial algebraic and/or differential equations, and allowing for an arbitrary number of identity variables. This unification together with its new solving capability make concretely simpler the interactive study of the solutions of an algebraic or differential equation system.

– 

InvariantEquation to compute the invariant equation that admits a given symmetry group

• 

Four new PDEtools:-Library commands were added to the library of tools to manipulate PDE systems and facilitate programming with them. These are: JetNumbersToJetVariables, JetVariablesToJetNumbers, NormalizeBoundaryConditions and ToSameVariables.

  

Examples

with(PDEtools):

  

A non-differential equation

eq[1] := a*x^2 + b*x + c;

eq1ax2+bx+c

(45)

Solve(eq[1], x);

x=b+4ac+b22a,x=b+4ac+b22a

(46)
  

An ODE problem and its series solution

eq[2] := diff(y(x),x) = y(x);

eq2y'=y

(47)

Solve(eq[2], series);

y=y0+y0x+12y0x2+16y0x3+124y0x4+1120y0x5+Ox6

(48)
  

A PDE problem with boundary conditions

eq[3] := [diff(u(x, t), t)+c*(diff(u(x, t), x)) = -lambda*u(x, t), u(x, 0) = phi(x)];

eq3cux+ut=λux&comma;t&comma;ux&comma;0=φx

(49)

Solve(eq[3]);

ux&comma;t=φtc+x&ExponentialE;λt

(50)
  

Numerical solution for a PDE with boundary conditions

eq[4] := [diff(u(x,t),t) = -diff(u(x,t),x), u(x,0) = sin(2*Pi*x), u(0,t) = -sin(2*Pi*t)];

eq4ut=ux&comma;ux&comma;0=sin2πx&comma;u0&comma;t=sin2πt

(51)

sol[4] := PDEtools:-Solve(eq[4], numeric, time=t, range=0..1);

sol4:=moduleexportplot&comma;plot3d&comma;animate&comma;value&comma;settings&semi;...end module

(52)

sol[4]:-plot(t=0, numpoints=50);

  

In the examples above the advantage with regards to calling solve, dsolve or pdsolve is in using a single command and having a unified format for the input and output. Solve however also provides additional functionality: it can compute solutions independent of indicated variables. The system being solved using independentof can also contain inequations

eq[5] := [k*a*c*(a+b)*exp(k*d*t)-2*a*exp(k*t)*k+Q*(-c+a)*x, a <> 0];

eq5kaca+b&ExponentialE;kdt2a&ExponentialE;ktk+Qc+ax&comma;a0

(53)

Solve(eq[5], {a, b, c, d}, independentof = {t, x});

a=a&comma;b=a22a&comma;c=a&comma;d=1

(54)
  

Solutions that are independent of the specified variables can be computed as well for differential equations or systems of them;

eq[6] := diff(f(x,y),x)*diff(g(x,y),x) + diff(f(x,y),y)*diff(g(x,y),y) + g(x,y)*(diff(f(x,y), x,x) + diff(f(x,y), y,y)) = -1;

eq6fxgx+fygy+gx&comma;yfx,x+fy,y=−1

(55)
  

Here are solutions for this PDE that are independent of x and independent of y

Solve(eq[6], independentof = x);

fx&comma;y=_F1y&comma;gx&comma;y=y+_C1_F1y

(56)

Solve(eq[6], independentof = y);

fx&comma;y=_F1x&comma;gx&comma;y=x+_C1_F1'

(57)
• 

The new InvariantEquations command computes equations that are invariant under given symmetries. Consider the list of infinitesimals of this 1-dimensional symmetry group

S := [x, 1, u];

Sx&comma;1&comma;u

(58)
  

The 1st order partial differential equation invariant under the symmetry transformation underlying these infinitesimals is

PDE := InvariantEquation(S, u(x, t), name = Lambda);

* Partial match of 'name' against keyword 'arbitraryfunctionname'

PDEΛlnx+t&comma;ux&comma;tx&comma;ux&comma;utx

(59)
  

The third order PDE invariant under S is

PDE := InvariantEquation(S, u(x, t), order = 3);

PDE_F1lnx+t&comma;ux&comma;tx&comma;ux&comma;utx&comma;ut,x&comma;ux,xx&comma;ut,tx&comma;ut,t,x&comma;ux,x,xx2&comma;ut,x,xx&comma;ut,t,tx

(60)
  

When the arbitraryfunctionname is not indicated, as in this input above, the name used is of the form _Fn with n integer. The invariance of this PDE can be verified in various ways, the simplest of which is perhaps to use SymmetryTest, that verifies that S is a symmetry of PDE

SymmetryTest(S, PDE);

0

(61)
  

With InvariantEquations you can also compute the equation invariant under n-dimensional symmetry groups; consider for instance the following list of 5 symmetries of a problem that involves two dependent variables ux&comma;t,vx&comma;t

G := [[_xi[x] = 0, _xi[t] = 1, _eta[u] = 0, _eta[v] = 0], [_xi[x] = 0, _xi[t] = 0, _eta[u] = 1, _eta[v] = 0], [_xi[x] = 1, _xi[t] = 0, _eta[u] = 2*t, _eta[v] = 0], [_xi[x] = t, _xi[t] = 0, _eta[u] = t^2+x, _eta[v] = 0], [_xi[x] = 1/2*x+3/2*t^2, _xi[t] = t, _eta[u] = t^3+3*t*x, _eta[v] = -v]];

G_&xi;x=0&comma;_&xi;t=1&comma;_&eta;u=0&comma;_&eta;v=0&comma;_&xi;x=0&comma;_&xi;t=0&comma;_&eta;u=1&comma;_&eta;v=0&comma;_&xi;x=1&comma;_&xi;t=0&comma;_&eta;u=2t&comma;_&eta;v=0&comma;_&xi;x=t&comma;_&xi;t=0&comma;_&eta;u=t2+x&comma;_&eta;v=0&comma;_&xi;x=x2&plu