Maple 2021 Questions and Posts

These are Posts and Questions associated with the product, Maple 2021

We can write a list, set, MutableSet and array type together with their entries types. For example list(polynom) or array(array(integer)). But what about a table? For example how can I emphasize a type table with indices of the type integer and entries a list of integers? I was guessing table(integer,list(integer)) which is not working, so my guess is not correct. I tried some other combinations which they didn't work too. I can't see anything in the programming guide and the help of Maple or a post here that is addressing this question.

Example:

test:=table([1=[1,2,3],2=[6,5,4]]):
type(test,table(integer,list(integer))): # which of course is not working.

 

Consider 1-dimensional arrays in Maple. To add one element at the end of an array, there is a pre-defined command ArrayTools:-Append (or using ArrayTools:-Insert if one wants to add an element at another location of the array) and to remove one entry from an array there is another pre-defined command ArrayTools:-Remove. Now let's say I want to add several elements and remove several elements. If I want to add all of the new elements at the end of the array, there is a predefined command ArrayTools:-Extend. If I want to remove several entries that are sequal, then I can give the second argument of ArrayTools:-Remove as a range n1..n2. But now let's say I want to remove several entries that are not sequal, for examples entries with indices in [5,8,14]. Is there any special efficient way to do it or just defining a loop to do the removals one by one? Removing by a loop is not very nice since the number of indices will change after each removal. Then another idea is to redefine the whole array using a select or a seq. But I'm guessing that none of these are the best way to do so. If I was dealing with MutableSet, I would use &minus, but I can't use MutableSets in every situation, because MutableSets change the order of elements and have more special properties like no repeated elements etc.

Hi there.

I noticed some little bug:

example.mw

As you can see the second term in serie C looks like -M/sqrt(-M^2 + E) - k, but not like M*k/sqrt(-M^2 + E).

Hi there.

It looks strange but simplify/symbolic cannot handle expression in file:

example.mw

Only after expanding numerator and denominator by hand.

I think simplify/symbolic should be smarter.

Hi folks

I'm trying to integrate products of Bessel functions and reproduce known results in the literature. For example, the integral

Int(BesselJ(0,k*r)*BesselJ(1,q*r),r=0..infinity);

should evaluate to 1/q if q>k and 0 if q<k, but maple only gives the first solution, even when 'assuming q<k' is specified. It should give 1/2q when k=q -- which it does but only when I put k=q in the integral. For some reason, it always assumes q>k whatever I do. 

There's a lot of examples like this. Am I missing something? Is there a way to return an answer with all the (correct!) solutions?

Thanks in advance.

Using latest TeXLive distribution, and current Maple 2021 maple.sty file, Maple generated Latex uses command called 

             \pdfstringdefDisableCommands

which is unknown. I found this when I was trying to compile latex generated from Student:-Calculus1:-ShowSolution command.

The above latex command is called/used in maple.sty file, but it is not defined anywhere outside. It might have been defined many years ago?  I only see one reference to it in an old posting at tex stackexchange from few years ago.

This is how to reproduce this error (one needs to have latex installed on your PC to compile the file). On windows MikTeX can be used. On Linux, TeXLive.

restart;
the_output:=Student:-Calculus1:-ShowSolution(Int(x^3,x=0..1));
latex(the_output)

Then copied the latex, and pasted it in my latex file

\documentclass{article}
\usepackage{amsmath}
\usepackage{array}
\usepackage{maple}% set the path to reach this in Maple etc/ folder in its installation
\begin{document}

\[
\begin{array}{ccc}
 & {} & \textrm{Integration Steps} 
\\
 {} & {} & \int_{0}^{1}x^{3}d x  
\\
 \textrm{▫} & {} & \textrm{1. Apply the}\textrm{power}\textrm{rule to the term}\int x^{3}d x  
\\
 {} & \textrm{◦} & \textrm{Recall the definition of the}\textrm{power}\textrm{rule, for n}\textrm{≠}\textrm{-1} 
\\
 {} & {} & \int x^{n}d x =\frac{x^{n +1}}{n +1} 
\\
 {} & \textrm{◦} & \textrm{This means:} 
\\
 {} & {} & \int x^{3}d x =\frac{x^{3+1}}{3+1} 
\\
 {} & \textrm{◦} & \textrm{So,} 
\\
 {} & {} & \int x^{3}d x =\frac{x^{4}}{4} 
\\
 {} & \textrm{◦} & \textrm{Apply limits of definite integral} 
\\
 {} & {} & \frac{x^{4}}{4}{\raisebox{-0.36em}{$\Big |$}}{\mstack{}{_{x \hiderel{=}1}}}-\left(\frac{x^{4}}{4}{\raisebox{-0.36em}{$\Big |$}}{\mstack{}{_{x \hiderel{=}0}}}\right) 
\\
  & {} & \textrm{We can rewrite the integral as:} 
\\
 {} & {} & \frac{1}{4} 
\end{array}
\]

\end{document}

And now when compiling the above using the latex compiler, it gives this error

(base) >pdflatex foo5.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.21 (TeX Live 2020) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(./foo5.tex
LaTeX2e <2020-10-01> patch level 2
L3 programming layer <2020-12-07> xparse <2020-03-03> (/usr/local/texlive/2020/texmf-dist/tex/latex/base/article.cls
Document Class: article 2020/04/10 v1.4m Standard LaTeX document class
(/usr/local/texlive/2020/texmf-dist/tex/latex/base/size10.clo)) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/local/texlive/2020/texmf-dist/tex/latex/tools/array.sty) (/mnt/g/public_html/styles/maple.sty
Package: maple 2005/03/17 v1.16
Defining Maple Utility Macros
Defining Maple Plot Environemnts
 ...Defaults to "dvips" Driver
(/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/epsfig.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/keyval.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/graphics.sty (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics/trig.sty) (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-cfg/graphics.cfg) (/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-def/dvips.def))))
Defining Automatic Style Generation Macros
Defining Maple Spreadsheet Environments
Maple Spreadsheet and Table Support
! Undefined control sequence.
l.3248 \pdfstringdefDisableCommands
                                   {\let\(\fakemath}    % 2.
?

The above command is on line 3248 in maple.sty file

 

I tried to workaround it, but do far could not find a way.

Is there a way to fix this problem in Maple 2021 latex?

Is there any predefined command in Maple that you can run it on a Maple code file such as an mpl file, or just on a piece of code written in the worksheet file and it edits the code by the easy usual styling preferences such as what pylint does in Python? Adding spaces arround ":=" or adding indentation etc.

Hi.

I experience "broken links" in Maple. That is when I've used the the search field Alt+S or visited the help pages, very often thereafter I have to restart Maple in order to use e.g. the Help again, a task or whatever is essentially a link. Is this a known problem in Maple and if what do I do remedy it.
Thanks in advance.


 

Instead of the nice output from the help, I get the following message:

Hello, dear All

I have Maple2021 installed and I'll use the newest Physics Version. But
it does not work.

How can I activate the Physic Version 935?

When I start the file: "Wirtinger_Derivatives.mw"  I get

With kind regards

Wolfgang Gellien
 

I have found few PDE's so far  that timeout in Maple 2021 which did not do that in Maple 2020.2. Using same amount of time out, on same PC.

After some debugging, I found that that cause is calling latex:-Settings(....) before calling  timelimit(pdsolve(...))  causes the timeout.

At first, I thought this must be coincidence. Why would calling latex make pdsolve timeout?

So I tried again and again and again. Each time, removing the call to latex makes pdsolve not time out. Putting latex call back in, now pdsolve times out. Each time restart is always called (in new cell) before.

The timeout is 10 minutes.  Without latex called before, pdsolve took about about 5 minutes on my PC to solve the PDE.  

Any one could see if they can reproduce this?

Why would calling latex:-Settings(....)  causes pdsolve now use all 10 minutes and then timeout? This is very strange.

Maple 2021. Latex Physics package. Windows 10.

attached is worksheet showing this with many tries.

restart;
latex:-Settings(UseImaginaryUnit=i,
      UseColor = false,
      powersoftrigonometricfunctions= mixed, ## computernotation,
      leavespaceafterfunctionname = true,
      cacheresults = false,
      spaceaftersqrt = true  
);

pde :=  a*ln(lambda*x)^n*diff(w(x,y),x)+ b*ln(mu*x)^m*diff(w(x,y),y) = c*ln(nu*x)^k*w(x,y)+p*ln(beta*y)^s+q;
timelimit(60*10,pdsolve(pde,w(x,y)));

#Error, (in expand) time expired
#OR 
#Error, (in evala/Divide/heuristic) time expired


restart;
pde :=  a*ln(lambda*x)^n*diff(w(x,y),x)+ b*ln(mu*x)^m*diff(w(x,y),y) = c*ln(nu*x)^k*w(x,y)+p*ln(beta*y)^s+q;
timelimit(60*10,pdsolve(pde,w(x,y)));

#no problem solution found.

 

why_time_out_with_latex_march_23_2021.mw

When inside a section, why typing a command or any Maple expression, makes the cursor jump to outside the section after that?

Is it possible to create a new cell (i.e. >) and jump to that, so to remain inside the section?

Currently, I have to do CTRL-J to make new exection group, i.e. >, below the current one and remain inside the section, which is too much work. 

This is using worksheet mode. I see an option in tools->options->display to do that automatically. Which is great. But it does not work inside a SECTION. 

This is how to reproduce

1. set  tools->options->display->always insert new execution group after executing

2. In worksheet, click on insert->section to make new section.

3. in the first cell inside the section, type any Maple command or statement. Now you will see the cursor jumps outside the section, and makes new exection group (i.e. >).  But my cursor is now outside the section. So I have to move it back to inside the section.

I want to remain inside the section and have ">" be created inside the section.

Is this possible?

Maple 2021, windows. Worksheet mode.

I will make small movie to illustrate.

 

sometimes when I see such things, I get the feeling that the folks who develop the interface at Maplesoft, do not use it too much themselves. Else they would have noticed this annoyance in using sections. 

When inside a section, one would expect that a new exection cell to be created inside the section itself and not outside. 

 

Comparing the following 2 outputs, all done using worksheet mode. They are same expression. But one is generated using assignment and one using function definition (with arrow).

restart;
expr:=sinh(Pi)/Pi*(1+  Sum( (-1)^n/(1+n^2)*(cos(n*x)+n*sin(n*x)),n=1..m)):
f1:=expr;
f2:=unapply(expr,x);

Why Maple 2D display shows small dot for multiplication in the second case, but not in the first? Is there a way to remove this dot? I do not like it and find it distracting.  I looked at options->display and see nothing there to affect this.

 

Maple 2021 on windows 10

 

When I installed Maple 2021 student version (did an upgrade from Maple 2020 to get discount price). I noticed that Maple 2021 only has "shared server" icon to click on to start Maple GUI.

I do not know what the difference between "shared server" and the icon without it.

In Maple 2020, it shows both "maple 2020" and "shared server maple 2020". And when using 2020, I always clicked on "maple 2020", not the "shared server maple 2020".  This is standalone personal PC used only by me.

But in Maple 2021, only "shared server Maple 2021" shows up. And so this is the one I now use, and Maple comes up OK.

But why Maple 2021 do not have an icon without "shared server" on it like 2020?  Is this something I should worry about?

Here is screen shot from my START menu on windows 10 showing the difference. 

 

 

Im using geom3d trying to find a way to paramterise the equation of a circle in three dimensions how ever there is no function in that ive found that can do this. Geom3d is great at drawing and giving the equations of the sphere that i require and can even plot easily using the 'intersection' command but this never gives the actual parameterisation of the circle itself.

 

The equations of the spheres are easy to find and using them ive been attempting to code a way to give a paramterisation of the circle from code ive found online, but this only gives me the paramterisation of the positive/negative semicircle of what I want. I can obtain both halves of the circle and plot them together but I need the paramterisation of the full circle as I intend to use this. Does anyone know a better way of achiving this? 

(also Im not sure how to extract the equation of the plane from the geom3d[intersection] comand, its there under detail but im not sure how to have it assigned to its own object.

 

 

restart;
with(geom3d);
with(plots);
geom3d[point](A_1, -8.5, 0, 0);
point(A_2, 8.5, 0, 0);
point(B_1, 0., -5.5, sqrt(166/4));
point(B_2, 0., 5.5, sqrt(166/4));
sphere(Sb1_10, [B_1, 10]);
sphere(Sb2_10, [B_2, 10]);
sphere(Sa2_10, [A_2, 10]);
sphere(Sa1_12, [A_1, 12]);
sphere(Sa2_12, [A_2, 12]);
intersection(circ, Sb1_10, Sb2_10);
detail(circ);
draw([B_1, B_2, A_1, A_2, Sb1_10, Sb2_10, circ], axes = boxed);
plane(plane1, Sb1_10, Sb2_10);
M1 := Plane(circ);
detail(M1);
detail(plane1);
M := plane(K, Plane(circ), [x, y, z]);
form(M);
Equation(M);

 


S1 := Equation(Sb1_10, [x, y, z]);
S2 := Equation(Sb2_10, [x, y, z]);
s := eliminate({S1, S2}, y);
S_1 := solve(s[1, 2], {x(t), z(t)});
                   

 

 


assign(s[1, 1]);
assign(S_1[1]);
Eq1 := [normal(x), normal(y), normal(z)];
space1 := spacecurve(Eq1, t = -500 .. 500, color = red, scaling = constrained, axes = boxed, numpoints = 20000);
   

 

unassign('x');
unassign('z');
unassign('y');
assign(s[1, 1]);
assign(S_1[2]);
Eq2 := [normal(x), normal(y), normal(z)];
space2 := spacecurve(Eq2, t = -500 .. 500, color = green, scaling = constrained, axes = boxed, numpoints = 20000, title = "2");
 

 

unassign('x');
unassign('z');
unassign('y');
assign(s[2, 1]);
assign(S_1[1]);
Eq3 := [normal(x), normal(y), normal(z)];
space3 := spacecurve(Eq3, t = -500 .. 500, color = pink, scaling = constrained, axes = boxed, numpoints = 20000, title = "3");
 

unassign('x');
unassign('z');
unassign('y');
assign(s[2, 1]);
assign(S_1[2]);
Eq4 := [normal(x), normal(y), normal(z)];
space4 := spacecurve(Eq4, t = -500 .. 500, color = orange, scaling = constrained, axes = boxed, numpoints = 20000, title = "4");
 

Eq := Eq1 + Eq2 + Eq3 + Eq4;
spaceC := spacecurve({Eq}, t = -500 .. 500, color = blue, scaling = constrained, axes = boxed, numpoints = 20000);
display({space1, space2, space3, space4, spaceC});
 

restart;
with(geometry);
circle(c1, [point(A, 0, 0), point(B, 2, 0), point(C, 1, 2)], 'centername' = O1);
f1 := (x - 8.5)^2 + (y + 0)^2 + (z + 0)^2 = 12^2;
f2 := (x + 8.5)^2 + (y + 0)^2 + (z + 0)^2 = 12^2;
                                      2    2    2      
                f1 := (x - 8.5)  + y  + z  = 144

                                       2    2    2      
                f2 := (x + 8.5)  + y  + z  = 144


restart;
with(plottools);
with(plots);
f1 := x^2 + y^2 + z^2 = 1;
f2 := x + y + z = 1;
Circle := intersectplot(f1, f2, x = -10 .. 10, y = -2 .. 2, z = -5 .. 15, color = red, thickness = 3, numpoints = 10000);
S1 := implicitplot3d(f1, x = -20 .. 20, y = -20 .. 20, z = -10 .. 20, style = patchnogrid, color = blue);
S2 := implicitplot3d(f2, x = -20 .. 20, y = -20 .. 10, z = -10 .. 20, style = patchnogrid, color = gold, transparency = 0.5);
display(S1, S2, Circle, scaling = constrained, axes = boxed);
whattype(Circle);
detail(Circle);
   


sol := eliminate({f1, f2}, z);
Sol := solve(sol[2, 1], {x(t), y(t)});
assign(sol[1, 1]);
assign(Sol);
Eq := [normal(x), normal(y), normal(z)];
spacecurve(Eq, t = -500 .. 500, color = red, scaling = constrained, axes = boxed, numpoints = 20000);
 

 


restart;
with(geom3d);
with(plots);
f1 := -28.25000000 + x^2 + y^2 + z^2 + 11.0*y - z*sqrt(166) = 0;
plane1 := y = 0;
Circle := intersectplot(f1, plane1, x = -10 .. 10, y = -2 .. 2, z = -5 .. 15, color = red, thickness = 3, numpoints = 10000);
sol := eliminate({f1, plane1}, y);
Sol := solve(sol[2], {x(t), z(t)});
 


assign(sol[1]);
assign(Sol[2]);
Eq1 := [normal(x), normal(y), normal(z)];
C2 := spacecurve(Eq1, t = -500 .. 500, color = red, scaling = constrained, axes = boxed, numpoints = 20000);
unassign('x');
unassign('z');
unassign('y');
assign(sol[1]);
assign(Sol[1]);
Eq2 := [normal(x), normal(y), normal(z)];
C1 := spacecurve(Eq2, t = -500 .. 500, color = green, scaling = constrained, axes = boxed, numpoints = 20000);
 


Eq3 := Eq1 + Eq2;
C3 := spacecurve(Eq3, t = -500 .. 500, color = green, scaling = constrained, axes = boxed, numpoints = 20000);
display(C1, C2, C3);

First 36 37 38 39 40 Page 38 of 40