MaplePrimes Announcement

With the 2014 Maple T.A. User Summit completed and conference goers have returned to their home cities, it’s time to recap what happened on day 2. We started things off in the morning with an energized presentation by Prof. Jack Weiner of the University of Guelph. Jack pointed out that the University of Guelph has revolutionized their teaching and online homework solutions by using Maple and Maple T.A. He also gave an example of one of this famous Friday Specials – an example of math being used in the real world and discussed other teaching suggestions from his 40+ years of experience in the field.

Featured Posts

Last week the Physics package was presented in a talk at the Perimeter Institute for Theoretical Physics and in a combined Applied Mathematics and Physics Seminar at the University of Waterloo. The presentation at the Perimeter Institute got recorded. It was a nice opportunity to surprise people with the recent advances in the package. It follows the presentation with sections closed, and at the end there is a link to a pdf with the sections open and to the related worksheet, used to run the computations in real time during the presentation.




Generally speaking, physicists still experience that computing with paper and pencil is in most cases simpler than computing on a Computer Algebra worksheet. On the other hand, recent developments in the Maple system implemented most of the mathematical objects and mathematics used in theoretical physics computations, and dramatically approximated the notation used in the computer to the one used in paper and pencil, diminishing the learning gap and computer-syntax distraction to a strict minimum. In connection, in this talk the Physics project at Maplesoft is presented and the resulting Physics package illustrated tackling problems in classical and quantum mechanics, general relativity and field theory. In addition to the 10 a.m lecture, there will be a hands-on workshop at 1pm in the Alice Room.


... Why computers?



We can concentrate more on the ideas instead of on the algebraic manipulations


We can extend results with ease


We can explore the mathematics surrounding a problem


We can share results in a reproducible way


Representation issues that were preventing the use of computer algebra in Physics



Notation and related mathematical methods that were missing:

coordinate free representations for vectors and vectorial differential operators,

covariant tensors distinguished from contravariant tensors,

functional differentiation, relativity differential operators and sum rule for tensor contracted (repeated) indices

Bras, Kets, projectors and all related to Dirac's notation in Quantum Mechanics


Inert representations of operations, mathematical functions, and related typesetting were missing:


inert versus active representations for mathematical operations

ability to move from inert to active representations of computations and viceversa as necessary

hand-like style for entering computations and texbook-like notation for displaying results


Key elements of the computational domain of theoretical physics were missing:


ability to handle products and derivatives involving commutative, anticommutative and noncommutative variables and functions

ability to perform computations taking into account custom-defined algebra rules of different kinds

(problem related commutator, anticommutator, bracket, etc. rules)

Vector and tensor notation in mechanics, electrodynamics and relativity


Dirac's notation in quantum mechanics




Computer algebra systems were not originally designed to work with this compact notation, having attached so dense mathematical contents, active and inert representations of operations, not commutative and customizable algebraic computational domain, and the related mathematical methods, all this typically present in computations in theoretical physics.


This situation has changed. The notation and related mathematical methods are now implemented.


Tackling examples with the Physics package


Classical Mechanics


Inertia tensor for a triatomic molecule



Problem: Determine the Inertia tensor of a triatomic molecule that has the form of an isosceles triangle with two masses m[1] in the extremes of the base and mass m[2] in the third vertex. The distance between the two masses m[1] is equal to a, and the height of the triangle is equal to h.



Quantum mechanics


Quantization of the energy of a particle in a magnetic field


Show that the energy of a particle in a constant magnetic field oriented along the z axis can be written as

H = `ℏ`*`ω__c`*(`#msup(mi("a",mathcolor = "olive"),mo("†"))`*a+1/2)

where `#msup(mi("a",mathcolor = "olive"),mo("†"))`and a are creation and anihilation operators.



The quantum operator components of `#mover(mi("L",mathcolor = "olive"),mo("→",fontstyle = "italic"))` satisfy "[L[j],L[k]][-]=i `ε`[j,k,m] L[m]"


Unitary Operators in Quantum Mechanics


(with Pascal Szriftgiser, from Laboratoire PhLAM, Université Lille 1, France)

A linear operator U is unitary if 1/U = `#msup(mi("U"),mo("†"))`, in which case, U*`#msup(mi("U"),mo("†"))` = U*`#msup(mi("U"),mo("†"))` and U*`#msup(mi("U"),mo("†"))` = 1.Unitary operators are used to change the basis inside an Hilbert space, which physically means changing the point of view of the considered problem, but not the underlying physics. Examples: translations, rotations and the parity operator.

1) Eigenvalues of an unitary operator and exponential of Hermitian operators


2) Properties of unitary operators


3) Schrödinger equation and unitary transform


4) Translation operators


Classical Field Theory


The field equations for a quantum system of identical particles



Problem: derive the field equation describing the ground state of a quantum system of identical particles (bosons), that is, the Gross-Pitaevskii equation (GPE). This equation is particularly useful to describe Bose-Einstein condensates (BEC).



The field equations for the lambda*Phi^4 model


Maxwell equations departing from the 4-dimensional Action for Electrodynamics


General Relativity


Given the spacetime metric,

g[mu, nu] = (Matrix(4, 4, {(1, 1) = -exp(lambda(r)), (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = -r^2, (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = -r^2*sin(theta)^2, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = exp(nu(r))}))

a) Compute the trace of

"Z[alpha]^(beta)=Phi R[alpha]^(beta)+`𝒟`[alpha]`𝒟`[]^(beta) Phi+T[alpha]^(beta)"

where `≡`(Phi, Phi(r)) is some function of the radial coordinate, R[alpha, `~beta`] is the Ricci tensor, `𝒟`[alpha] is the covariant derivative operator and T[alpha, `~beta`] is the stress-energy tensor

T[alpha, beta] = (Matrix(4, 4, {(1, 1) = 8*exp(lambda(r))*Pi, (1, 2) = 0, (1, 3) = 0, (1, 4) = 0, (2, 1) = 0, (2, 2) = 8*r^2*Pi, (2, 3) = 0, (2, 4) = 0, (3, 1) = 0, (3, 2) = 0, (3, 3) = 8*r^2*sin(theta)^2*Pi, (3, 4) = 0, (4, 1) = 0, (4, 2) = 0, (4, 3) = 0, (4, 4) = 8*exp(nu(r))*Pi*epsilon}))

b) Compute the components of "W[alpha]^(beta)"" ≡"the traceless part of  "Z[alpha]^(beta)" of item a)

c) Compute an exact solution to the nonlinear system of differential equations conformed by the components of  "W[alpha]^(beta)" obtained in b)

Background: paper from February/2013, "Withholding Potentials, Absence of Ghosts and Relationship between Minimal Dilatonic Gravity and f(R) Theories", by P. Fiziev.

a) The trace of "  Z[alpha]^(beta)=Phi R[alpha]^(beta)+`𝒟`[alpha]`𝒟`[]^(beta) Phi+T[alpha]^(beta)"


b) The components of "W[alpha]^(beta)"" ≡"the traceless part of " Z[alpha]^(beta)"


c) An exact solution for the nonlinear system of differential equations conformed by the components of  "W[alpha]^(beta)"


The Physics Project



"Physics" is a software project at Maplesoft that started in 2006. The idea is to develop a computational symbolic/numeric environment specifically for Physics, targeting educational and research needs in equal footing, and resembling as much as possible the flexible style of computations used with paper and pencil. The main reference for the project is the Landau and Lifshitz Course of Theoretical Physics.


A first version of "Physics" with basic functionality appeared in 2007. Since then the package has been growing every year, including now, among other things, a searcheable database of solutions to Einstein equations and a new dedicated programming language for Physics.


Since August/2013, weekly updates of the Physics package are distributed on the web, including the new developments related to our plan as well as related to people's feedback.





Edgardo S. Cheb-Terrab
Physics, Differential Equations and Mathematical Functions, Maplesoft

Someone asked on about plotting x*y*z=1 and, while it's easy enough to handle it with implicitplot3d it raised the question of how to get nice constained axes in the case that the x- or y-range is much less than the z-range.

Here's what WolframAlpha gives. (Mathematica handles it straight an an plot of the explict z=1/(x*y), which is interesting although I'm more interested here in axes scaling than in discontinuous 3D plots)

Here is the result of a call to implicitplot3d with default scaling=unconstrained. The axes appear like in a cube, each of equal "length".


Here is the same plot, with scaling=constrained. This is not pretty, because the x- and y-range are much smalled than the z-range.


How can we control the axes scaling? Resizing the inlined plot window with the mouse just affects the window. The plot itself remains  rendered in a cube. Using right-click menus to rescale just makes all axes grow or shrink together.

One unattractive approach it to force a small z-view on a plot of a much larger z-range, for a piecewise or procedure that is undefined outisde a specific range.

                        if abs(z)>200 then undefined;
                        else x*y*z-1; end if;
                      end proc,
                      -1..1, -1..1, -200..200, view=[-1..1,-1..1,-400..400],
                      style=surfacecontour, grid=[30,30,30]);

Another approach is to scale the x and y variables, scale their ranges, and then force scaled tickmark values. Here is a rough procedure to automate such a thing. The basic idea is for it to accept the same kinds of arguments are implicitplot3d does, with two extra options for scaling the axis x-relative-to-z, and axis y-relative-to-z.

implplot3d:=proc( expr,
                  {scalex::numeric:=1, scaley::numeric:=1} )
   local d1, d2, dz, n1, n2, r1, r2, rngs, scx, scy;
   uses plotfn=plots:-implicitplot3d;
   (n1,n2) := lhs(rng1), lhs(rng2);
   dz := rhs(rhs(rng3))-lhs(rhs(rng3));
   (scx,scy) := scalex*dz/(rhs(rhs(rng1))-lhs(rhs(rng1))),
   (r1,r2) := map(`*`,rhs(rng1),scx), map(`*`,rhs(rng2),scy);
   (d1,d2) := rhs(r1)-lhs(r1), rhs(r1)-lhs(r1);
   plotfn( subs([n1=n1/scx, n2=n2/scy], expr),
           n1=r1, n2=r2, rng3, _rest[],
end proc:

The above could be better. It could also detect user-supplied custom x- or y-tickmarks and then scale those instead of forming new ones.

Here is an example of using it,

implplot3d( x*y*z=1, x=-1..1, y=-1..1, z=-200..200, grid=[30,30,30],
            style=surfacecontour, shading=xy, orientation=[-60,60,0],
            scalex=1.618, scaley=1.618 );

Here is another example

implplot3d( x*y*z=1, x=-5..13, y=-11..5, z=-200..200, grid=[30,30,30],
            style=surfacecontour, orientation=[-50,55,0],
            scaley=0.5 );

Ideally I would like to see the GUI handle all this, with say (two or three) additional (scalar) axis scaling properties in a PLOT3D structure. Barring that, one might ask whether a post-processing routine could use plots:-transform (or friend) and also force the tickmarks. For that I believe that picking off the effective x-, y-, and z-ranges is needed. That's not too hard for the result of a single call to the plot3d command. Where it could get difficult is in handling the result of plots:-display when fed a mix of several spacecurves, 3D implicit plots, and surfaces.

Have I overlooked something much easier?


MaplePrimes Questions Recent Unanswered Maple MapleSim Maple T.A.