## The Physics Examples and LaTeX

by: Maple

One of the most interesting help page about the use of the Physics package is Physics,Examples. This page received some additions recently. It is also an excellent example of the File -> Export -> LaTeX capabilities under development.

Below you see the sections and subsections of this page. At the bottom, you have links to the updated PhysicsExample.mw worksheet, together with PhysicsExamples.PDF.

The PDF file has 74 pages and is obtained by going File -> Export -> LaTeX (FEL) on this worksheet to get a .tex version of it using an experimental version of Maple under development. The .tex file that results from FEL (used to get the PDF using TexShop on a Mac) has no manual editing. This illustrates new automatic line-breakingequation labels, colours, plots, and the new LaTeX translation of sophisticated mathematical physics notation used in the Physics package (command Latex in the Maplesoft Physics Updates, to be renamed as latex in the upcoming Maple release).

In brief, this LaTeX project aims at writing entire course lessons or scientific papers directly in the Maple worksheet that combines what-you-see-is-what-you-get editing capabilities with the Maple computational engine to produce mathematical results. And from there get a LaTeX version of the work in two clicks, optionally hiding all the input (View -> Show/Hide -> Input).

PS: MANY THANKS to all of you who provided so-valuable feedback on the new Latex here in Mapleprimes.

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

## Serious bugs in solve command

by: Maple 2018

In the two examples below (in the second example, the range for the roots is simply expanded), we see bugs in both examples (Maple 2018.2). I wonder if these errors are fixed in Maple 2020?

 > restart;
 > solve({log[1/3](2*sin(x)^2-3*cos(2*x)+6)=-2,x>=-7*Pi/2,x<=-2*Pi}, explicit, allsolutions); # Example 1 - strange error message solve({log[1/3](2*sin(x)^2-3*cos(2*x)+6)=-2,x>=-4*Pi,x<=-2*Pi}, explicit, allsolutions);  # Example 2 - two roots missing
 (1)
 > plot(log[1/3](2*sin(x)^2-3*cos(2*x)+6)+2, x=-7*Pi/2..-2*Pi); plot(log[1/3](2*sin(x)^2-3*cos(2*x)+6)+2, x=-4*Pi..-2*Pi);
 > Student:-Calculus1:-Roots(log[1/3](2*sin(x)^2-3*cos(2*x)+6)=-2, x=-7*Pi/2..-2*Pi);  # OK Student:-Calculus1:-Roots(log[1/3](2*sin(x)^2-3*cos(2*x)+6)=-2, x=-4*Pi..-2*Pi);  # OK
 (2)
 >

I am glad that  Student:-Calculus1:-Roots  command successfully handles both examples.

## Something about one degree of freedom for testing...

by: Maple 17

One forum had a topic related to such a platform. You can download a video of the movement of this platform from the picture at this link. The manufacturer calls the three-degrees platform, that is, having three degrees of freedom. Three cranks rotate, and the platform is connected to them by connecting rods through ball joints. The movable beam (rocker arm) has torsion springs.  I counted 4 degrees of freedom, because when all three cranks are locked, the platform remains mobile, which is camouflaged by the springs of the rocker arm. Actually, the topic on the forum arose due to problems with the work of this platform. Neither the designers nor those who operate the platform take into account this additional fourth, so-called parasitic degree of freedom. Obviously, if we will to move the rocker with the locked  cranks , the platform will move.
Based on this parasitic movement and a similar platform design, a very simple device is proposed that has one degree of freedom and is, in fact, a spatial linkage mechanism. We remove 3 cranks, keep the connecting rods, convert the rocker arm into a crank and get such movements that will not be worse (will not yield) to the movements of the platform with 6 degrees of freedom. And by changing the length of the crank, the plane of its rotation, etc., we can create simple structures with the required design trajectories of movement and one degree of freedom.
Two examples (two pictures for each example). The crank rotates in the vertical plane (side view and top view)
PLAT_1.mw

and the crank rotates in the horizontal plane (side view and top view).

The program consists of three parts. 1 choice of starting position, 2 calculation of the trajectory, 3 design of the picture.  Similar to the programm  in this topic.

## A little about controlled platforms (parallel...

by: Maple 17

Controlled platform with 6 degrees of freedom. It has three rotary-inclined racks of variable length:

and an example of movement parallel to the base:

Perhaps the Stewart platform may not reproduce such trajectories, but that is not the point. There is a way to select a design for those specific functions that our platform will perform. That is, first we consider the required trajectories of the platform movement, and only then we select a driving device that can reproduce them. For example, we can fix the extreme positions of the actuators during the movement of the platform and compare them with the capabilities of existing designs, or simulate your own devices.
In this case, the program consists of three parts. (The text of the program directly for the first figure : PLATFORM_6.mw) In the first part, we select the starting point for the movement of a rigid body with six degrees of freedom. Here three equations f6, f7, f8 are responsible for the six degrees of freedom. The equations f1, f2, f3, f4, f5 define a trajectory of motion of a rigid body. The coordinates of the starting point are transmitted via disk E for the second part of the program. In the second part of the program, the trajectory of a rigid body is calculated using the Draghilev method. Then the trajectory data is transferred via the disk E for the third part of the program.
In the third part of the program, the visualization is executed and the platform motion drive device is modeled.
It is like a sketch of a possible way to create controlled platforms with six degrees of freedom. Any device that can provide the desired trajectory can be inserted into the third part. At the same time, it is obvious that the geometric parameters of the movement of this device with the control of possible emergency positions and the solution of the inverse kinematics problem can be obtained automatically if we add the appropriate code to the program text.
Equations can be of any kind and can be combined with each other, and they must be continuously differentiable. But first, the equations must be reduced to uniform variables in order to apply the Draghilev method.
(These examples use implicit equations for the coordinates of the vertices of the triangle.)

## What to take care of when entering a tetrad

by: Maple 2020

In the study of the Gödel spacetime model, a tetrad was suggested in the literature [1]. Alas, upon entering the tetrad in question, Maple's Tetrad's package complained that that matrix was not a tetrad! What went wrong? After an exchange with Edgardo S. Cheb-Terrab, Edgardo provided us with awfully useful comments regarding the use of the package and suggested that the problem together with its solution be presented in a post, as others may find it of some use for their work as well.

The Gödel spacetime solution to Einsten's equations is as follows.

 >
 (1)
 >
 (2)

Working with Cartesian coordinates,

 >
 (3)

the Gödel line element is

 >
 (4)

Setting the metric

 >
 (5)

The problem appeared upon entering the matrix M below supposedly representing the alleged tetrad.

 >
 >
 (6)

Each of the rows of this matrix is supposed to be one of the null vectors . Before setting this alleged tetrad, Maple was asked to settle the nature of it, and the answer was that M was not a tetrad! With the Physics Updates v.857, a more detailed message was issued:

 >
 (7)

So there were actually three problems:

 1 The entered entity was a null tetrad, while the default of the Physics package is an orthonormal tetrad. This can be seen in the form of the tetrad metric, or using the library commands:
 >
 (8)
 >
 (9)
 >
 (10)
 2 The matrix M would only be a tetrad if the spacetime index is contravariant. On the other hand, the command IsTetrad will return true only when M represents a tetrad with both indices covariant. For  instance, if the command IsTetrad  is issued about the tetrad automatically computed by Maple, but is passed the matrix corresponding to   with the spacetime index contravariant,  false is returned:
 >
 (11)
 >
 (12)
 3 The matrix M corresponds to a tetrad with different signature, (+---), instead of Maple's default (---+). Although these two signatures represent the same physics, they differ in the ordering of rows and columns: the timelike component is respectively in positions 1 and 4.

The issue, then, became how to correct the matrix M to be a valid tetrad: either change the setup, or change the matrix M. Below the two courses of action are provided.

First the simplest: change the settings. According to the message (7), setting the tetrad to be null, changing the signature to be (+---) and indicating that M represents a tetrad with its spacetime index contravariant would suffice:

 >
 (13)

The null tetrad metric is now as in the reference used.

 >
 (14)

Checking now with the spacetime index contravariant

 >
 (15)

At this point, the command IsTetrad  provided with the equation (15), where the left-hand side has the information that the spacetime index is contravariant

 >
 (16)

Great! one can now set the tetrad M exactly as entered, without changing anything else. In the next line it will only be necessary to indicate that the spacetime index, , is contravariant.

 >
 (17)

The tetrad is now the matrix M. In addition to checking this tetrad making use of the IsTetrad command, it is also possible to check the definitions of tetrads and null vectors using TensorArray.

 >
 (18)
 >
 (19)

For the null vectors:

 >
 (20)
 >
 (21)

From its Weyl scalars, this tetrad is already in the canonical form for a spacetime of Petrov type "D": only

 >
 (22)
 >
 (23)

Attempting to transform it into canonicalform returns the tetrad (17) itself

 >
 (24)

Let's now obtain the correct tetrad without changing the signature as done in (13).

Start by changing the signature back to

 >
 (25)

So again, M is not a tetrad, even if the spacetime index is specified as contravariant.

 >
 (26)

By construction, the tetrad M has its rows formed by the null vectors with the ordering . To understand what needs to be changed in M, define those vectors, independent of the null vectors  (with underscore) that come with the Tetrads package.

 >

and set their components using the matrix M taking into account that its spacetime index is contravariant, and equating the rows of M  using the ordering :

 >
 (27)
 >
 (28)

Check the covariant components of these vectors towards comparing them with the lines of the Maple's tetrad

 >
 (29)

This shows the  null vectors (with underscore) that come with Tetrads package

 >
 (30)

So (29) computed from M is the same as (30) computed from Maple's tetrad.

But, from (30) and the form of Maple's tetrad

 >
 (31)

for the current signature

 >
 (32)

we see the ordering of the null vectors is