Education

Teaching and learning about math, Maple and MapleSim

This is a 5-days mini-course I gave in Brazil last week, at the CBPF (Brazilian Center for Physics Research). The material will still receive polishment and improvements, towards evolving into a sort of manual, but it is also interesting to see it exactly as it was presented to people during the course. This material uses the update of Physics available at the Maplesoft Physics R&D webpage.

Mini-Course: Computer Algebra for Physicists

 

Edgardo S. Cheb-Terrab

Maplesoft

 

 

This course is organized as a guided experience, 2 hours per day during five days, on learning the basics of the Maple language, and on using it to formulate algebraic computations we do in physics with paper and pencil. It is oriented to people not familiar with computer algebra (sections 1-5), as well as to people who are familiar but want to learn more about how to use it in Physics.

 

Motivation

 

 

Among other things, with computer algebra:

 

• 

You can concentrate more on the ideas (the model and its formulation) instead of on the algebraic manipulations

• 

You can extend your results with ease

• 

You can explore the mathematics surrounding your problem

• 

You can share your results in a reproducible way - and with that exchange about a problem in more productive ways

• 

After you learn the basics, the speed at which algebraic results are obtained with the computer compensates with dramatic advantage the extra time invested to formulate the problem in the computer.

 

All this doesn't mean that we need computer algebra, at all, but does mean computer algebra can enrich our working experience in significant ways.

What is computer algebra - how do you learn to use it?

   

What is this mini-course about?

   

What can you expect from this mini-course?

   

 

Explore. Having success doesn't matter, using your curiosity as a compass does - things can be done in so many different ways. Have full permission to fail. Share your insights. All questions are valid even if to the side. Computer algebra can transform the algebraic computation part of physics into interesting discoveries and fun.

1. Arithmetic operations and elementary functions

   

2. Algebraic Expressions, Equations and Functions

   

3. Limits, Derivatives, Sums, Products, Integrals, Differential Equations

   

4. Algebraic manipulation: simplify, factor, expand, combine, collect and convert

   

5. Matrices (Linear Algebra)

   

6. Vector Analysis

   

7. Tensors and Special Relativity

   

8. Quantum Mechanics

   

9. General Relativity

   

10. Field Theory

   

BrasilComputacaoAlgebrica.mw.zip

BrasilComputacaoAlgebrica.pdf 

Edgardo S. Cheb-Terrab
Physics, Maplesoft

We regularly host live webinars on a variety of topics for our customers, and we wanted to make this information available to the MaplePrimes community as well. We will be posting information about new webinars we think will be of interest approximately once per month.

Partnering with the MAA to Revolutionize Placement Testing

In this webinar, we will demonstrate how the Maple T.A. MAA Placement Test Suite can be used to ease the problem of placement testing and how it can benefit your campus in general.

Other topics include:

• How placement testing contributes to student success

• How the MAA placement tests are created, and rigorously validated

• How valid and reliable the MAA placement tests are for entry level mathematics courses

• How you can use the Maple T.A. Placement Test Suite for easy administration, flexible delivery, and fast results

To join us for the live presentation, please click here to register.

We regularly host live webinars on a variety of topics for our customers, and we wanted to make this information available to the MaplePrimes community as well. We will be posting information about new webinars we think will be of interest approximately once per month.

Partnering with the MAA to Revolutionize Placement Testing

In this webinar, we will demonstrate how the Maple T.A. MAA Placement Test Suite can be used to ease the problem of placement testing and how it can benefit your campus in general.

Other topics include:

• How placement testing contributes to student success

• How the MAA placement tests are created, and rigorously validated

• How valid and reliable the MAA placement tests are for entry level mathematics courses

• How you can use the Maple T.A. Placement Test Suite for easy administration, flexible delivery, and fast results

To join us for the live presentation, please click here to register.

In this post we present the solution with Maple to the logical problem of "Gardens Puzzle"

http://www.mathsisfun.com/puzzles/gardens-solution.html

The Puzzle:

Five friends have their gardens next to one another, where they grow three kinds of crops: fruits (apple, pear, nut, cherry), vegetables (carrot, parsley, gourd, onion) and flowers (aster, rose, tulip, lily).

1. They grow 12 different varieties.
2. Everybody grows exactly 4 different varieties
3. Each variety is at least in one garden.
4. Only one variety is in 4 gardens.
5. Only in one garden are all 3 kinds of crops.
6. Only in one garden are all 4 varieties of one kind of crops.
7. Pear is only in the two border gardens.
8. Paul's garden is in the middle with no lily.
9. Aster grower doesn't grow vegetables.
10. Rose growers don't grow parsley.
11. Nuts grower has also gourd and parsley.
12. In the first garden are apples and cherries.
13. Only in two gardens are cherries.
14. Sam has onions and cherries.
15. Luke grows exactly two kinds of fruit.
16. Tulip is only in two gardens.
17. Apple is in a single garden.
18. Only in one garden next to Zick's is parsley.
19. Sam's garden is not on the border.
20. Hank grows neither vegetables nor asters.
21. Paul has exactly three kinds of vegetable.

Who has which garden and what is grown where?

 

About methods of solution. At first I just wanted to generate all variations and using conditions 1 .. 21 to find all solutions. But even if we use the condition that everybody grows exactly 4 different varieties then the total number variants equals  5!^2*binomial(12,4)^5=427945522455000000

So from the very beginning using some of the conditions 1 .. 21 we maximally reduce the number of possible variants. For example from the conditions 11, 18 and 6 implies that only in one garden are all 4 varieties of flowers. Next we pass through these variants and using conditions 1 .. 21 and finally come to a unique solution:

restart;

Fruits:={apple, pear, nut, cherry}:

Vegetables:={carrot, parsley, gourd, onion}:

Flowers:={aster, rose, tulip, lily}:

 

Set1:=Flowers:

Garden1:={Set1}:

Set2:=Fruits union Vegetables union Flowers minus {nut,gourd,parsley} minus {apple,cherry,rose}:

Garden2:={seq({nut,gourd,parsley} union {Set2[i]}, i=1..nops(Set2))}:

Set3:=Vegetables union Flowers minus {parsley}:

Garden3:={seq({apple,cherry,pear} union {Set3[i]}, i=1..nops(Set3))}:

Set4:=combinat[choose](Fruits union Vegetables union Flowers minus {onion,cherry} minus {apple,parsley,pear,nut}, 2):

Garden4:={seq({onion,cherry} union Set4[i], i=1..nops(Set4))}:

Set5:=Fruits union Vegetables union Flowers minus {apple, cherry,nut,parsley}:

Garden5:=combinat[choose](Set5, 4):

 

S:=[]:

for s1 in Garden1 do

for s2 in Garden2 do

for s3 in Garden3 do

for s4 in Garden4 do

for s5 in Garden5 do

s:=[s1,s2,s3,s4,s5]: s_4:=combinat[choose](s,4): m:=0: n:=0: k:=0: p:=0: q:=0:

for i in s do

if `intersect`(i,Fruits)<>{} and `intersect`(i,Vegetables)<>{} and `intersect`(i,Flowers)<>{} then m:=m+1: fi:

if pear in i then n:=n+1: fi:

if tulip in i then k:=k+1: fi:

if aster in i and `intersect`(i,Vegetables)<>{} then p:=p+1: fi:

if i=Fruits or i=Vegetables or i=Flowers then q:=q+1: fi:

od:

if nops(`union`(op(s)))=12 and nops(`union`(seq(`intersect`(op(s_4[j])), j=1..nops(s_4))))=1 and m=1 and n=2 and k=2 and p=0 and q=1 then S:=[op(S),[s1,s2,s3,s4,s5]]: fi:

od: od: od: od: od:

 

L1:=[seq([[3,Paul],[2,Sam],seq([combinat[permute]([1,4,5])[i,j],[Luke,Zick,Hank][j]],j=1..3)],i=1..6)]:

L2:=[seq([[3,Paul],[4,Sam],seq([combinat[permute]([1,2,5])[i,j],[Luke,Zick,Hank][j]],j=1..3)],i=1..6)]:

L0:=[op(L1),op(L2)]:

L:=[seq(op(combinat[permute](L0[i])),i=1..nops(L0))]:

Sol:=[]:

for l in L do

for s in S do

sol:=[seq([op(l[i]),s[i]], i=1..5)]:

gad1:=op(select(has,sol,parsley)): gad2:=op(select(has,sol,Zick)):

if abs(gad1[1]-gad2[1])=1 and convert([seq(((pear in sol[i][3] implies (sol[i][1]=1 or sol[i][1]=5)) and (sol[i][2]=Paul implies (not lily in sol[i][3])) and (sol[i][1]=1 implies (apple in sol[i][3] and cherry in sol[i][3])) and (sol[i][2]=Sam implies (onion in sol[i][3] and cherry in sol[i][3])) and (sol[i][2]=Luke implies nops(`intersect`(sol[i][3],Fruits))=2) and (sol[i][2]=Hank implies (`intersect`(sol[i][3],Vegetables)={} and not aster in sol[i][3])) and (sol[i][2]=Paul implies nops(`intersect`(sol[i][3],Vegetables))=3)), i=1..5)], `and`) then Sol:=[op(Sol), sol]: fi:

 

od: od:

for i in Sol do

Matrix(sort(i,(x,y)->x[1]<y[1]));

od;

 

 

In this post we present another compact proof of this remarkable theorem without using  geometry package.
The proof uses a procedure called  Cc , which for three points returns a list of the coordinates of the center and the radius of the circumscribed circle.

restart;

Cc:=proc(A,B,C)

local x1, y1, x2, y2, x3, y3, x, y;

x1,y1:=op(A);  x2,y2:=op(B);  x3,y3:=op(C);

solve({(x2-x1)*(x-(x1+x2)/2)+(y2-y1)*(y-(y1+y2)/2)=0, (x2-x3)*(x-(x2+x3)/2)+(y2-y3)*(y-(y2+y3)/2)=0},{x,y});

assign(%);

[simplify([x,y]), simplify(sqrt((x-x1)^2+(y-y1)^2))];

end proc:

Proof for arbitrary triangle:

A, B, C:=[x1,y1], [x2,y2], [x3,y3]:

A1, B1, C1, M:=(B+C)/2, (A+C)/2, (A+B)/2, (A+B+C)/3:

P1:=Cc(A,M,B1)[1]: P2:=Cc(B1,M,C)[1]: P3:=Cc(C,M,A1)[1]:

P4:=Cc(A1,M,B)[1]: P5:=Cc(B,M,C1)[1]: P6:=Cc(C1,M,A)[1]:

Cc1:=Cc(P1,P2,P3):  Cc2:=Cc(P4,P5,P6):

is(Cc1=Cc2);

                                                  true

Let  us consider the general case of symbolic values C(xC,yC). I make use of the idea suggested by edgar in http://www.mapleprimes.com/questions/97743-How-To-Prove-Morleys-Trisector-Theorem : no assumptions.

restart; with(geometry); point(A, 0, 0);
point(B, 1, 0);
point(C, xC, yC);
point(MA, (xC+1)*(1/2), (1/2)*yC);
point(MC, 1/2, 0);
point(MB, (1/2)*xC, (1/2)*yC);
point(E, (0+1+xC)*(1/3), (0+0+yC)*(1/3));# the center of mass
line(l1, x = 1/4, [x, y]);
The coordinates of the center of the first described circle are found as the solutions of the system of the equations of midperpendiculars.

midpoint(ae, A, E); coordinates(ae);


S1 := solve({x = 1/4, ((xC+1)*(1/3))*(x-(xC+1)*(1/6))+(1/3)*yC*(y-(1/6)*yC) = 0}, {x, y});

BTW, Maple can't create the midperpendiculars in this case.

point(O1, op(map(rhs, S1)));
                               O1

Simple details are omitted in the above. The coordinates of the centers of the two next described circles are found similarly.
coordinates(midpoint(mce, MC, E));

S2 := solve({x = 3/4, ((-1/2+xC)*(1/3))*(x-5/12-(1/6)*xC)+(1/3)*yC*(y-(1/6)*yC) = 0}, {x, y});

point(O2, op(map(rhs, S2)));

                               O2
coordinates(midpoint(bma, B, MA)); coordinates(midpoint(be, B, E));
  

                

S3 := solve({(xC-1)*(x-(xC+3)*(1/4))+yC*(y-(1/4)*yC) = 0, ((-2+xC)*(1/3))*(x-(4+xC)*(1/6))+(1/3)*yC*(y-(1/6)*yC) = 0}, {x, y});

point(O3, op(map(rhs, S3)));

                               O3

Now we find the equation of the circumference which passes through O1, O2, and O3.

eq := a*x+b*y+x^2+y^2+c = 0:
sol := solve({eval(eq, S1), eval(eq, S2), eval(eq, S3)}, {a, b, c});

A long output can be seen in the attached .mw file.

eq1 := eval(eq, sol);

  Now we find (in suspense)  the coordinates of the next center and verify whether it belongs to the sircumference O1O2O3.

coordinates(midpoint(mac, C, MA)); coordinates(midpoint(ec, E, C)); S4 := solve({(xC-1)*(x-(3*xC+1)*(1/4))+yC*(y-3*yC*(1/4)) = 0, ((2*xC-1)*(1/3))*(x-(4*xC+1)*(1/6))+(2*yC*(1/3))*(y-4*yC*(1/6)) = 0}, {x, y});

 point(O4, op(map(rhs, S4)));

                               O4
simplify(eval(eq1, S4));

                             0 = 0

Hope the reader will have a real pleasure to find the two residuary centers and to verify these on his/her own.

geom2.mw

 

 

 

 

It is well known that the medians of a triangle divide it into 6 triangles.
It is less known that the centers of their circumscribed circles belong to one circumference as drawn below

This remarkable theorem  was proved in the 21st century! Unfortunately, I lost its source.
I can't prove this difficult  theorem by hand. However, I can prove it with Maple.
The aim of this post is to expose these proofs. Everybody knows that it is scarcely possible
to construct a general triangle with help of the geometry package of Maple.
Without loss of generality one may assume that the vertex A is placed at the origin,
the vertex B is placed at (1,0), and the vertex C(xC,yC). We firstly consider the theorem
in the case of concrete values of xC and yC.

restart; with(geometry):with(plots):
point(A, 0, 0);
point(B, 1, 0);
xC := 15*(1/10); yC := sqrt(3); point(C, xC, yC);
triangle(T, [A, B, C]);
median(mA, A, T, MA);
median(mB, B, T, MB);
median(mC, C, T, MC);
line(m1, [A, MA]);
line(m2, [B, MB]);
intersection(E, m1, m2);
triangle(AEMB, [A, E, MB]);
circumcircle(c1, AEMB, 'centername' = C1);
circumcircle(c2, triangle(CEMB, [C, E, MB]), 'centername' = C2);
circumcircle(c3, triangle(CEMA, [C, E, MA]), 'centername' = C3);
circumcircle(c4, triangle(BEMA, [B, E, MA]), 'centername' = C4);
circumcircle(c5, triangle(BEMC, [B, E, MC]), 'centername' = C5);
circumcircle(c6, triangle(AEMC, [A, E, MC]), 'centername' = C6);
circle(CC, [C1, C2, C3]);
IsOnCircle(C4, CC);
                              true

IsOnCircle(C5, CC);
                              true
IsOnCircle(C6, CC);
                              true
display([draw([T(color = black), mA(color = black), mB(color = black), mC(color = black), C1(color = blue), C2(color = blue), C3(color = blue), C4(color = blue), C5(color = blue), C6(color = blue), CC(color = red)], symbol = solidcircle, symbolsize = 15, thickness = 2, scaling = constrained), textplot({[-0.5e-1, 0.5e-1, "A"], [.95, 0.5e-1, "B"], [xC-0.5e-1, yC+0.5e-1, "C"]})], axes = frame, view = [-.1 .. max(1, xC)+.1, 0 .. yC+.1]);

This can be done as a procedure in such a way.

restart; SixPoints := proc (xC, yC) geometry:-point(A, 0, 0); geometry:-point(B, 1, 0); geometry:-point(C, xC, yC); geometry:-triangle(T, [A, B, C]); geometry:-median(mA, A, T, MA); geometry:-median(mB, B, T, MB); geometry:-median(mC, C, T, MC); geometry:-line(m1, [A, MA]); geometry:-line(m2, [B, MB]); geometry:-intersection(E, m1, m2); geometry:-triangle(AEMB, [A, E, MB]); geometry:-circumcircle(c1, AEMB, 'centername' = C1); geometry:-circumcircle(c2, geometry:-triangle(CEMB, [C, E, MB]), 'centername' = C2); geometry:-circumcircle(c3, geometry:-triangle(CEMA, [C, E, MA]), 'centername' = C3); geometry:-circumcircle(c4, geometry:-triangle(BEMA, [B, E, MA]), 'centername' = C4); geometry:-circumcircle(c5, geometry:-triangle(BEMC, [B, E, MC]), 'centername' = C5); geometry:-circumcircle(c6, geometry:-triangle(AEMC, [A, E, MC]), 'centername' = C6); geometry:-circle(CC, [C1, C2, C3]); return geometry:-IsOnCircle(C4, CC), geometry:-IsOnCircle(C5, CC), geometry:-IsOnCircle(C6, CC), geometry:-draw([CC(color = blue), C1(color = red), C2(color = red), C3(color = red), C4(color = red), C5(color = red), C6(color = red), T(color = black), mA(color = black), mB(color = black), mC(color = black), c1(color = green), c4(color = green), c2(color = green), c3(color = green), c5(color = green), c6(color = green)], symbol = solidcircle, symbolsize = 15, thickness = 2) end proc;
SixPoints(1.5, 1.2);

true, true, true, PLOT(...)
 SixPoints(1.5, 1.2)[4];

See geom1.mw

To be continued (The general case will be considered in  part 2http://www.mapleprimes.com/posts/200210-Six-Points-On-Circumference-2 .).

 

 





 

On Thursday, Feb. 27, we are hosting our first-ever Virtual User Summit.   This day provides Maplesoft’s academic community a chance to learn more about the different ways Maplesoft technology is being used in education and research, a chance to interact with Maplesoft employees as well as each other, and a chance to get a glimpse into the future of education.

The virtual nature of this conference is a very tangible example of how much technology has changed our lives.  No less dramatic is the effect of technology on education.  In the keynote presentations at this conference, you will learn about Maplesoft’s vision for the future of education. You’ll also get to see tangible examples of technology that is building towards that vision, including sneak peeks of some things we are working on.

Visit Maplesoft Virtual User Summit for the full agenda and to register.  “Doors open” at 8:30 Eastern Time and the keynote presentations start at 9:00.

We are looking forward to this chance to come together and share our passion for technology and technical education.  Hope to see you there!

Vector using package Physics, LinearAlgebra.

Vectores.mw     (in spanish)

I was recently asked about performing some General Relativity computations from a paper by Plamen Fiziev, posted in the arXiv in 2013. It crossed my mind that this question is also instrumental to illustrate how these General Relativity algebraic computations can be performed using the Physics package. The pdf and mw links at the end show the same contents but with the Sections expanded.

 

General Relativity using Computer Algebra

 

Problem: for 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)+`&Dscr;`[alpha]`&Dscr;`[]^(beta) Phi+T[alpha]^(beta)"

 

where `&equiv;`(Phi, Phi(r)) is some function of the radial coordinate, R[alpha, `~beta`] is the Ricci tensor, `&Dscr;`[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)"" &equiv;"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: The equations of items a) and b) appear in a paper from February/2013, "Withholding Potentials, Absence of Ghosts and Relationship between Minimal Dilatonic Gravity and f(R) Theories", by Plamen Fiziev, a Maple user.  These equations model a problem in the context of a Branse-Dicke theory with vanishing parameter "omega." The Brans–Dicke theory is in many respects similar to Einstein's theory, but the gravitational "constant" is not actually presumed to be constant - it can vary from place to place and with time - and the gravitational interaction is mediated by a scalar field. Both Brans–Dicke's and Einstein's theory of general relativity are generally held to be in agreement with observation.

 

The computations below aim at illustrating how this type of computation can be performed using computer algebra, and so they focus only on the algebraic aspects, not the physical interpretation of the results.

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

   

b) The components of "W[alpha]^(beta)"" &equiv;"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)"

   

 

GeneralRelativit.pdf    GeneralRelativity.mw

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

 

Code of the animation:

restart;

N := 192:

A := seq(plot([[.85*sin(t)^3-2+1.25*i/N, .85*(13*cos(t)*(1/15)-(1/3)*cos(2*t)-2*cos(3*t)*(1/15)-(1/15)*cos(4*t)), t = 0 .. Pi*i/N], [-.85*sin(t)^3-2+1.25*i/N, .85*(13*cos(t)*(1/15)-(1/3)*cos(2*t)-2*cos(3*t)*(1/15)-(1/15)*cos(4*t)), t = 0 .. Pi*i/N], [sin(t)^3+2-1.25*i/N, 13*cos(t)*(1/15)-(1/3)*cos(2*t)-2*cos(3*t)*(1/15)-(1/15)*cos(4*t), t = 0 .. Pi*i/N], [-sin(t)^3+2-1.25*i/N, 13*cos(t)*(1/15)-(1/3)*cos(2*t)-2*cos(3*t)*(1/15)-(1/15)*cos(4*t), t = 0 .. Pi*i/N]], color = red, thickness = 5, view = [-3 .. 3, -1.2 .. .9]), i = 1 .. N):

plots[display](A, insequence = true, scaling = constrained, axes = none);


This post is an index page for reading the Parallel Programming blog posts.

I thought it would be interesting to review what happened with Physics in Maple during 2013. The proposed theme for the Physics project was the consolidation and integration of the package with the rest of the Maple library. There were more than 500 changes, enhancements in most of the Physics commands, plus 17 new Physics:-Library commands. The impact of these changes is across the board, from Vector Analysis to Quantum Mechanics, Relativity and Field Theory.

Consolidation of the Physics package is about making it robust and versatile in real case scenarios. With the launch of the Physics: Research and Development updates webpage, Maplesoft has pioneered feedback, adjustments in the package and new developments provided around the clock for all of its users. The result of this accelerated exchange with people around the world is what you find in Maple's updated Physics today.

In addition to changes improving the functionality in mathematical-physics, changes were introduced towards making the computational experience as natural as possible, now including textbook-like typesetting of inert forms for the whole mathematical language and vectorial differential operators.

Physics doubled in size in Maple 16, almost doubled again in Maple 17, and during 2013 Physics received the largest number of changes ever in the package in one year. We are aiming for real to provide a state-of-the-art environment for algebraic computations in Physics. The links at the end show the same but with the Examples sections expanded.

Simplify

 

Simplification is perhaps the most common operation performed in a computer algebra system. In Physics, this typically entails simplifying tensorial expressions, or expressions involving noncommutative operators that satisfy certain commutator/anticommutator rules, or sums and integrals involving quantum operators and Dirac delta functions in the summands and integrands. Relevant enhancements were introduced for all these cases.

Examples

   

4-Vectors, Substituting Tensors

 

In Maple 17, it is possible to define a tensor with a tensorial equation, where the tensor being defined is on the left-hand side. Then, on the right-hand side, you write either a tensorial expression with free and repeated indices, or a Matrix or Array with the components themselves. With the updated Physics, you can also define a 4-Vector with a tensorial equation, where you indicate the vector's components on the right-hand side as a list.

One new Library routine specialized for tensor substitutions was added to the Maple library: SubstituteTensor, which substitutes the equation(s) Eqs into an expression, taking care of the free and repeated indices, such that: 1) equations in Eqs are interpreted as mappings having the free indices as parameters, and 2) repeated indices in Eqs do not clash with repeated indices in the expression. This new routine can also substitute algebraic sub-expressions of type product or sum within the expression, generalizing and unifying the functionality of the subs and algsubs  commands for algebraic tensor expressions.

Examples

   

Functional Differentiation

 

The Physics:-Fundiff command for functional differentiation has been extended to handle all the complex components ( abs , argument , conjugate , Im , Re , signum ) and vectorial differential operators in order to compute field equations using variational principles when the field function enters the Lagrangian together with its conjugate. For an example illustrating the use of the new capabilities in the context of a more general problem, see the MaplePrimes post Quantum Mechanics using Computer Algebra.

Examples

   

More Metrics in the Database of Solutions to Einstein's Equations

 

A database of solutions to Einstein's equations  was added to the Maple library in Maple 15 with a selection of metrics from "Stephani, H.; Kramer, D.; MacCallum, M.; Hoenselaers, C.; and Herlt, E.,  Exact Solutions to Einstein's Field Equations" and "Hawking, Stephen; and Ellis, G. F. R., The Large Scale Structure of Space-Time". More metrics from these two books were added for Maple 16 and Maple 17. These metrics can be searched using the command DifferentialGeometry:-Library:-MetricSearch, or directly using g_ (the Physics command representing the spacetime metric that also sets the metric to your choice).

• 

With the updated Physics, fifty more metrics are available in the database from Chapter 28 of the aformentioned book entitled "Exact Solutions to Einstein's Field Equations".

• 

It is now possible to list all the metrics of a chapter by indexing the metric command with the chapter's number, for example, entering g_["28"].

Examples

   

Commutators, AntiCommutators

 

When computing with products of noncommutative operators, the results depend on the algebra of commutators and anticommutators that you previously set. Besides that, in Physics, various mathematical objects themselves satisfy specific commutation rules. You can query about these rules using the Library commands Commute and Anticommute. Previously existing functionality and enhancements in this area were refined and implemented during 2013. Among them:

• 

Both Commutator and AntiCommutator now accept matrices as arguments.

• 

The AntiCommutator of products of fermionic operators - for instance annihilation and creation operators - is now derived automatically from the intrinsic anticommutation rules they satisfy.

• 

Commutators and Anticommutators of vectorial quantum operators `#mover(mi("A",mathcolor = "olive"),mo("&rarr;"))`, `#mover(mi("B",mathcolor = "olive"),mo("&rarr;"))`, are now implemented and expressed using the dot (scalar) product, as in Physics:-Commutator(`#mover(mi("A",mathcolor = "olive"),mo("&rarr;"))`, `#mover(mi("B",mathcolor = "olive"),mo("&rarr;"))`) = `#mover(mi("A",mathcolor = "olive"),mo("&rarr;"))`.`#mover(mi("B",mathcolor = "olive"),mo("&rarr;"))`-`#mover(mi("B",mathcolor = "olive"),mo("&rarr;"))`.`#mover(mi("A",mathcolor = "olive"),mo("&rarr;"))`

• 

If two noncommutative operators a and S  satisfy "[a^(&dagger;),S][-]=0" , then the commutator  "[a,S^(&dagger;)][-]" is automatically taken equal to 0; if in addition S is Hermitian, then  "[a,S][-]"is also automatically taken equal to zero.

Examples

   

Expand and Combine

 

In the context of Physics, the expansion and recombination of algebraic expressions requires additional care: products may involve non-commutative operators and then some of the standard expansion and combination rules do not apply, or apply differently. Similarly, the expansion of vectorial operators also follows special rules. During 2013, many of these algebraic operations were reviewed and related special formulas (such as Glauber's and Haussdorf's) were implemented.

Examples

   

New Enhanced Modes in Physics Setup

 

Four enhanced modes were added to the Physics setup. With these modes, you can:

1. 

Indicate the real objects of a computation.

2. 

Automatically combine powers of the same base.

3. 

Set Maple to take z and its conjugate, "z," as independent variables and in equal footing; this is Wirtinger calculus.

4. 

Redefine the sum command in order to perform multi-index summation.

These options combined provide flexibility, subsequently making the Physics environment more expressive.

Real Objects

   

Combining Powers of the Same Base

   

Complex variables: z and conjugate(z) in equal footing

   

Redefine Sum for Multi-Index Summation

   

Dagger

 

Physics:-Dagger now has the same shortcut notation of Hermitian transpose , which acts on Vectors, vector products, equations, and automatically maps over the arguments of derivatives when the differentiation variables are real.

Examples

   

Vectors Package

 

A number of changes were performed in the Vectors subpackage to make the computations more natural and versatile:

• 

You can now use geometrical coordinates indexed, as in r[j], to represent mathematical objects unrelated to the coordinates themselves (in this case the spherical coordinate r).  This is a more appropriate mimicry of the way we compute with paper and pencil.

• 

Integrate the Vectors package commands with assuming and accept a tensor with 1 index (of type Library:-PhysicsType:-Tensor, defined using Define) as a possible abstract representation of the kth component of a vector.

• 

When V is a vector of the Physics:-Vectors package, make its absolute value abs(V), compute automatically using Physics:-Vectors:-Norm

• 

For an arbitrary vector  `#mover(mi("A"),mo("&rarr;"))`, make its Norm LinearAlgebra[Norm](`#mover(mi("A"),mo("&rarr;"))`) = "A*(A)," and introduce a new option conjugate to Norm, to specify whether to use `#mover(mi("A"),mo("&rarr;"))`.conjugate(`#mover(mi("A"),mo("&rarr;"))`) or `#mover(mi("A"),mo("&rarr;"))`.`#mover(mi("A"),mo("&rarr;"))` when computing LinearAlgebra[Norm](`#mover(mi("A"),mo("&rarr;"))`).

• 

When `#mover(mi("A",mathcolor = "olive"),mo("&rarr;"))` is a quantum operator, Norm returns using Dagger instead of conjugate.

• 

Commutators and Anticommutators of vectorial quantum operators `#mover(mi("A",mathcolor = "olive"),mo("&rarr;"))`, `#mover(mi("B",mathcolor = "olive"),mo("&rarr;"))`, are now implemented and expressed using the dot (scalar) product, as in "[A,B][-]=A*B-B*A . "

• 

New PhysicsVectors type in the Library of types Library:-PhysicsTypes, in order to programmatically identify vectors of the Physics:-Vectors package.

 

Two examples illustrating the use of the new capabilities in the context of a more general problem are found in the MaplePrimes posts Quantum Mechanics using Computer Algebra and Quantum Mechanics (II).

Examples

   

Library

 

Seventeen new commands, useful for programming and interactive computation, were added to the Physics:-Library package. These are:

• 

Add unifies the standard add and sum commands using a more modern handling of arguments, free of premature evaluation problems, and brings new multi-index functionality.

• 

ApplyCommandUsingImplicitAssumptions applies any command to expressions containing sums, integrals or products such that the command is applied to the summand (integrand or 1st argument of the product) taking into account the assumptions implicit in the summation (integration or product) range.

• 

CombinePowersOfSameBase combines powers of the same base in products correctly handling the case of noncommutative products and powers, using Glauber's formula.

• 

FromTensorFunctionalForm is a generalization of the former FromGeneralRelativityTensorFunctionalForm command, that also handles user defined tensor functions.

• 

GetFAndDifferentiationVariables receives a derivative and returns a sequence with derivand and all the differentiation variables.

• 

GetReplacementIndices receives a list of indices of different kinds (spacetime, space, spinor, etc) and any other arguments and returns a list with new indices of the same kinds - useful for replacements - not present in the rest of the arguments.

• 

GetSymbolsWithSameType receives an expression x, of type commutative, anticommutative or noncommutative, and any other arguments, and returns symbols of the same type as x, and not present in the rest of arguments.

• 

GetTensorDependency gets the dependency of a given tensor; this dependency typically depends of the spacetime metric or on the way you defined the tensor using Define.

• 

GetTensorFunctionalForm is a generalization of the former GetGeneralRelativityTensorFunctionalForm command, that also handles user defined tensor functions.

• 

IsLiteralSubscript returns true or false according to whether a symbol s is of the form x__y, that is, it has the substring __ after the first or next characters and before the last one.

• 

IsRealObject returns true or false according to whether a mathematical expression, function or variable passed is known to be real, either because it was assumed to be real, or because it was set to be real using Setup and its realobjects keyword.

• 

RealObjects sets and unsets mathematical variables and functions as real, and answers queries about them.

• 

SortProducts sorts the operands of noncommutative products into any particular desired ordering while taking into account commutator and anticommutator algebra rules, such that the returned product is mathematically equivalent to the one received.

• 

SubstituteTensor substitutes equations into an expression, taking care of the free and repeated indices such that: 1) the substitution equations are interpreted as mappings having the free indices as parameters, and 2) repeated indices in the substitution equations do not clash with existing repeated indices in the target expression.

• 

ToContravariant and ToCovariant rewrite a given expression multiplying by the spacetime metric so that all of its free indices become respectively contravariant or covariant.

• 

ToTensorFunctionalForm reverses the operation performed by the new FromTensorFunctionalForm described above.

Examples

   

Miscellaneous

 
• 

Implement formulas for abstract k, n both nonnegint entering "`a+`^k*| A[n] >" and "a(-)^k*| A[n] >", where `a+` and "a-" are Creation and Annihilation operators, respectively, acting on the 1st quantum number of the space of quantum states labeled A.

• 

Implement new PDEtools:-dchange rules for changing variables in Bras Kets and Brackets of the Physics package

• 

Library:-Degree can now compute the degree for noncommutative products Enhance PDEtools:-Library:-Degree and PDEtools:-Coefficients, to work with Physics:-`.` the same way it does with Physics:-`*`

• 

Changes in design:

a. 

When the spacetime is Euclidean, there is no difference in value between the covariant and contravariant components of a tensor. Therefore, represent both with covariant indices making simplification and all manipulations simpler. This change affects the display of indices on the screen as well as the output of SumOverRepeatedIndices.

b. 

The dot product A . B of quantum operators A and B now returns as a (noncommutative) product  A * B when neither A nor B involve Bras or Kets.

c. 

When A is a quantum operator (generic, Hermitian or unitary), the literal subscript object A__x is now considered an operator of the same kind.

d. 

Normal normalizes powers of the same base (including exponentials) by combining them. For example, A^n*A^m "->A^(n+m)."

e. 

Normal normalizes noncommutative products by sorting objects that commute between themselves putting those that involve Dagger and conjugate to the left, more aligned with normal ordering in quantum field theories.

f. 

FeynmanDiagrams does not return any crossed propagators unless explicitly requested using the new option includecrossedpropagators. The former option, normalproducts, was renamed as externallegs.

Examples

   

See Also

 

The Physics project, Physics, what is new in Physics in Maple 17, what is new in Physics in Maple 16

 

Physics2013.pdf    Physics2013.mw

Edgardo S. Cheb-Terrab
Physics, Maplesoft

Do you want to use both Simulink® and MapleSim in your tool chain? If so, we have a free upcoming webinar today at 2 pm EST that might be helpful to you!

In this webinar, Application Engineer Bonnie Yue will demonstrate:

- How to quickly develop and optimize engineering system models in MapleSim, then use the MapleSim Connector to automatically convert them into S-Function blocks for seamless inclusion in Simulink® diagrams.
- How to export MapleSim models to Simulink®, including models with custom components.

To join us for this live webinar, please visit: http://www.maplesoft.com/webinars/live/register.aspx?id=627&p=TC-3916

We hope to see you there!


Simulink® is a registered trademark of The MathWorks, Inc..

Maplesoft is holding its first ever Virtual User Summit on Feb. 27.  You’ll be able to watch presentations by both Maplesoft and Maplesoft customers, ask questions, have discussions in the lounge with other attendees, and even enter a draw, all from the comfort of your own home or office.

Here’s the agenda.  We’ll release more detailed information on speakers and session times in the next couple of weeks.

For more information and to register:  Maplesoft Virtual User Conference

We're looking forward to seeing you there. (Well, "seeing you" :-))

eithne

First 34 35 36 37 38 39 40 Last Page 36 of 55