## To export a worksheet as pdf on a Mac, select...

by: Maple

'Export as pdf' is not one of the  'Export as' options on  a Mac. Instead, you should follow these instructions, from

?pdf:

1. Open the worksheet that you want to export.
2. From the File menu, select Print.
3. Specify options for export to PDF as described in Section Options for Export to PDF below.
4. From the PDF drop-down list, select Save as PDF...
5. In the Save As dialog, enter a filename.
Click Save.

## small note about the new Maple 2020.2 and Latex...

by: Maple 2020

I am testing Maple 2020.2 with new Latex with Physics version latest 879.

The latex generated now issues \! between the symbol and the () next to it to improve the spacing. This post is just to let anyone using the package mleftright in Latex, that this will cause a problem. So it is better to remove this package if you are allready using it.

Here is an example

eq:=y(x)=exp(x/2);
Latex(eq)

y \! \left(x \right) = {\mathrm e}^{\frac{x}{2}}

In earlier version of Physics:-Latex (now it is just Latex), the above generated this

             y  \left(x \right) = {\mathrm e}^{\frac{x}{2}}

Notice, no \! in earlier version.

If you happen to be using \usepackage{mleftright} to improve the spacing for \left and \right, which I was using, you'll get negative side effect. A solution is to remove this package. Here is an example showing the above Latex compiled with this package added, and without it, so you can see the differerence.

\documentclass[12pt]{book}
\usepackage{amsmath}
\usepackage{mleftright}
\mleftright
\begin{document}

which gives using latest Latex V 879. Maple 2020.2
$y \! \left(x \right) = {\mathrm e}^{\frac{x}{2}}$

And which gives using earlier Physics Latex. Using Maple 2020.1
$y \left(x \right) = {\mathrm e}^{\frac{x}{2}}$
\end{document}

This is the output without using this package. by removing the inlcude command in the above Latex code and not calling mlfright. Now the problem is gone:

I like the effect added from \! , which is a manual way to improve the space, which this package was doing.

just be careful not to use mleftright package now, which is a somewhat popular package in latex and It was recommended to use sometime ago to improve the spacing, as it will over correct the spacing, and looks like not needed any more with latest Maple Latex.

Maple 2020.2 includes corrections and improvements to printing and export to PDF, support for macOS 11.0, more MATLAB connectivity, resolves issues with the installation of the Maplesoft Physics Updates, and more.  We recommend that all Maple 2020 users install these updates.

This update is available through Tools>Check for Updates in Maple, and is also available from our website on the Maple 2020.2 download page, where you can also find more details.

## 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.

## Research domains

by: MaplePrimes

It would be useful if there was a category (or subcategory) of scientific domain (e.g. physics, methematics, economics...)  in which Maple is applied. Thus it would become very convinient for someone who have a question on a specific topic to find a possible answer.

I like how the Julia community has been organised in https://discourse.julialang.org, so I would suggest to implement something similar in Maple Primes

## What to see new in Maple 2021?

by: Maple

When this question was asked here earlier, I neglected to suggest or to emphasize two further items.  Now, on revising Mathematics for Chemistry with [Maple], I recognise that I should have included these two objectives for inclusion in Maple 2021.

- an extended and improved spreadsheet with symbolic capability; I suspect that Maple was the only software for symbolic computation to include such a facility, which sadly has become deprecated, for no obvious reason.

- a much extended capability to solve integral equations; publications dating from 1976 -- i.e. before Maple! -- have shown what is possible; Maple's capabilities for differential equations might still be superior, although the competition is becoming close, so further efforts in the development of both differential and integral equations are timely and appropriate.  Related to differential equations is naturally the extension of capabilities of special functions, both to extend present functions and to produce new functions, such as those of Lame.

## Autosizing TextArea

by: Maple

I created a little procedure to automatically size text areas based on content. It sizes the text area based on wraparound and tab characters, something that the autosize for the code edit region does not do. (Hint to Maple developers)

Enjoy.

    AutosizeTextArea:=proc(TextAreaName, {intMinRows::nonnegint:=5, intMinChars::nonnegint:=50, intMaxChars::nonnegint:=140})
description "Autosizes the TextArea based on content",
"Parameters",
"1) TextAreaName__The name of the textarea",
"Optional Parameters",
"intMinRows________Minimum number of visible rows",
"intMinChars_______Minimum character width",
"intMaxChars_______Maximum character width";
uses DocumentTools, StringTools;
local strLines, intLongestLine, nLines;
strLines := Split(GetProperty(TextAreaName,'value'),"\n");
intLongestLine := max('numelems'~(strLines));
# Count the characters in each line (add 7 extra characters for each tab). Determine the number of lines to display each line due to wraparound, then add all these together
#   to determine the number of rows to display.
nLines := add(ceil~(('numelems'~(strLines) + StringTools:-CountCharacterOccurrences~(strLines, "\t")*~7)/~intMaxChars));
SetProperty(TextAreaName, 'visibleRows', max(nLines, intMinRows), 'refresh' = true);
SetProperty(TextAreaName, 'visibleCharacterWidth', min(max(intLongestLine, intMinChars),intMaxChars), 'refresh' = true);

end proc:

## A digression about the US electoral college tie

by: Maple 2015

A fascinating race is presently running (even if the latest results seem  to have put an end to it).
I'm talking of course about the US presidential elections.

My purpose is not to do politics but to discuss of a point of detail that really left me puzzled: the possibility of an electoral college tie.
I guess that this possibility seems as an aberration for a lot of people living in democratic countries. Just because almost everywhere at World electoral colleges contain an odd number of members to avoid such a situation!

So strange a situation that I did a few things to pass the time (of course with the earphones on the head so I don't miss a thing).
This is done with Maple 2015 and I believe that the amazing Iterator package (that I can't use thanks to the teleworking :-( ) could be used to do much more interesting things.

 > restart:
 > with(Statistics):
 > ElectoralCollege := Matrix(51, 2, [
 > Alabama,        9,        Kentucky,        8,        North_Dakota,        3,
 > Alaska,        3,        Louisiana,        8,        Ohio,        18,
 > Arizona,        11,        Maine,        4,        Oklahoma,        7,
 > Arkansas,        6,        Maryland,        10,        Oregon,        7,
 > California,        55,        Massachusetts,        11,        Pennsylvania,        20,
 > Colorado,        9,        Michigan,        16,        Rhode_Island,        4,
 > Connecticut,        7,        Minnesota,        10,        South_Carolina,        9,
 > Delaware,        3,        Mississippi,        6,        South_Dakota,        3,
 > District_of_Columbia,        3,        Missouri,        10,        Tennessee,        11,
 > Florida,        29,        Montana,        3,        Texas,        38,
 > Georgia,        16,        Nebraska,        5,        Utah,        6,
 > Hawaii,        4,        Nevada,        6,        Vermont,        3,
 > Idaho,        4,        New_Hampshire,        4,        Virginia,        13,
 > Illinois,        20,        New_Jersey,        14,        Washington,        12,
 > Indiana,        11,        New_Mexico,        5,        West_Virginia,        5,
 > Iowa,        6,        New_York,        29,        Wisconsin,        10,
 > Kansas,        6,        North_Carolina,        15,        Wyoming,        3 ]):
 (1)
 (2)
 > ec := convert(ElectoralCollege, listlist):
 > # Sets of states that form an electoral college tie R      := 10^5: nbties := 0: states := NULL: for r from 1 to R do   poll  := combinat:-randperm(ec):   cpoll := CumulativeSum(op~(2, poll)):   if tie in cpoll then     nbties := nbties+1;     place  := ListTools:-Search(tie, cpoll);     states := states, op~(1, poll)[1..place]:   # see below   end if: end do:
 > # electoral college tie is not so rare an event # (prob of occurrence about 9.4 %). # # Why the hell the US constitution did not decide to have an odd # number or electors to avoid ths kind of situation instead of # introducing a complex mechanism when tie appears???? nbties; evalf(nbties/R); states := [states]:
 (3)
 > # What states participate to the tie? names := sort(ElectoralCollege[..,1]): all_states_in_ties := [op(op~(states))]: howoften := Vector(                     51,                     i -> ListTools:-Occurrences(names[i], all_states_in_ties)             ): ScatterPlot(Vector(51, i->i), howoften);
 > # All the states seem to appear equally likely in an electoral college tie. # Why? Does someone have a guess? # # The reason is obvious, as each state must appear in the basket of a candidate, # then in case of a tie each state is either in op~(1, poll)[1..place] (candidate 1) # or either in op~(1, poll)[place+1..51] (candidate 2); # So, as we obtained 9397 ties, each states appears exactly 9397 times (with # different occurences in the baskets of candidate 1 and 2).
 > # Lengths of the configurations that lead to a tie. # # Pleas refer to the answer above to understand why Histogram(lengths) should be # symmetric. lengths := map(i -> numelems(states[i]), [$1..nbties]): sort(Tally(lengths))  (4)  > Histogram(lengths, range=min(lengths)..max(lengths), discrete=true)  > ShortestConfigurations := map(i -> if lengths[i]=min(lengths) then states[i] end if, [$1..nbties]): print~(ShortestConfigurations):
 (5)
 > LargestConfigurations := map(i -> if lengths[i]=max(lengths) then states[i] end if, [\$1..nbties]): print~(LargestConfigurations):
 (6)
 > # What could be the largest composition of a basket in case of a tie? # (shortest composition is the complementary of the largest one) ecs   := sort(ec, key=(x-> x[2])); csecs := CumulativeSum(op~(2, ecs)): # Where would the break locate? tieloc := ListTools:-BinaryPlace(csecs, tie); csecs[tieloc..tieloc+1]
 (7)
 > # This 40  states coniguration is not a tie. # # But list all the states in basket of candidate 1 and look to the 41th state (which is # in the basket of candidate 2) ecs[1..tieloc]; print(): ecs[tieloc+1]
 (8)
 > # It appears that exchanging Virginia and New_Jersey increases by 1 unit the college of candidate 1 # and produces a tie. LargestBasketEver := [ ecs[1..tieloc-1][], ecs[tieloc+1] ]; add(op~(2, LargestBasketEver))
 (9)
 > # The largest electoral college tie contains 40 states (the shortest 11)

## 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 , not  used in [1] with the signature (+ - - -). So the adjustment required in  M, resulting in , consists of reordering M's rows to be