Maple 2021 Questions and Posts

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

Attached is a worksheet containing a simple assignment that gives an "illegal use of an object as a name" error. I created the superscripted name in the following way.

1)  type b.

2) click on the Insert|Typesetting|Superscript  item in the insert menu.

3) enter 1 at the cursor in the superscript position.

4)  the result is a name b with superscript 1, but this symbol does not constitute a valid name for an assignment.


 

Parse:-ConvertTo1D, "first argument to _Inert_ASSIGN must be assignable"

Error, illegal use of an object as a name

"b^1:=2+3;"

 

NULL


 

Download errorws.mw

I trying to display factorials in a matrix as e.g 6!4!/5! not 144.
 

restart

with(InertForm)

[ConvertToString, Display, FromMathContainer, MakeInert, NoSimpl, Parse, SameStructure, ToMathContainer, ToMathML, Typeset, Value]

(1)

M := Matrix(4, 4); for m from 0 to 4 do for n from 0 to 4 do M(m+1, n+1) := factorial(NoSimpl(2*m+3*n))/(factorial(NoSimpl(m+2*n+1))*factorial(NoSimpl(m))*factorial(NoSimpl(n))) end do end do; M

Matrix(%id = 36893490820101234804)

(2)

NULL


 

Download How_to_display_factorial_unevaluated.mw

n := 3;
Digits := 10;
R_const := 8.314;
currentdir();
const := [1, 1, 1];
b := 20;
W := readdata("data20.txt", 2);
W := [seq([W[i, 2], W[i, 1]], i = 1 .. nops(W))];
Tempset := seq(W[i, 1], i = 1 .. nops(W));
Rateset := seq(W[i, 2], i = 1 .. nops(W));
Temp := [seq(W[i, 1], i = 1 .. nops(W))];
pdata := plots[pointplot](W, color = red);
pdata;

h[5] := 1;
h[4] := 8.5733287401;
h[3] := 18.059016973;
h[2] := 8.6347608925;
h[1] := 0.2677737343;
p[5] := 1;
p[4] := 9.5733223454;
p[3] := 25.6329561486;
p[2] := 21.0996530827;
p[1] := 3.9584969228;
r := x -> local m; exp(-x)*add(h[m]*x^(m - 1), m = 1 .. 5)/(x*add(p[m]*x^(m - 1), m = 1 .. 5));

q := (i, x) -> -Temp[1]*exp(-E_sim[i]/(R_const*Temp[1])) + E_sim[i]*r(E_sim[i]/(R_const*Temp[1]))/R_const + x*exp(-E_sim[i]/(R_const*x)) - E_sim[i]*r(E_sim[i]/(R_const*x))/R_const;

for i to n do
    R[i] := [seq(1 - exp(-A_sim[i]*const[i]*q(i, Temp[j])/b), j = 2 .. nops(Temp))];
end do;
for i to n do
    Der[i] := [seq(c_sim[i]*A_sim[i]*const[i]*exp(-E_sim[i]/(R_const*Temp[j]))*(1 - R[i][j]), j = 1 .. nops(Temp) - 1)];
end do;
Deriv := add(Der[i], i = 1 .. n);
model := [seq([Temp[i], Deriv[i]], i = 1 .. nops(R[1]))];
objective := add((W[i, 2] - model[i, 2])^2, i = 1 .. nops(Temp) - 1);
with(GlobalOptimization);
infolevel[GlobalOptimization] := 3;
Results := GlobalOptimization[GlobalSolve](objective, {add(c_sim[i], i = 1 .. 3) <= 1}, c_sim[1] = 0.05 .. 0.06, c_sim[2] = 0.85 .. 0.88, c_sim[3] = 0.05 .. 0.6, E_sim[1] = 33880 .. 33890, E_sim[2] = 40220 .. 41230, E_sim[3] = 23230 .. 23235, A_sim[1] = 2453 .. 2455, A_sim[2] = 190 .. 192, A_sim[3] = 1830 .. 1832, timelimit = 7200);
          [GetLastSolution, GlobalSolve, Interactive]

Results := [Float(undefined), [A_sim[1] = 2454.85789978944, 

  A_sim[2] = 190.143107633747, A_sim[3] = 1831.19959951461, 

  E_sim[1] = 33883.8826959700, E_sim[2] = 40796.6139830241, 

  E_sim[3] = 23230.4022199775, c_sim[1] = 0.0558944062681716, 

  c_sim[2] = 0.851532317382881, c_sim[3] = 0.0845465106500359]]


DEV_perc := 100*sqrt(Results[1]/(nops(Temp) - 3*n))/max(Rateset);
       DEV_perc := Float(undefined) + Float(undefined) 

Unsolved for Maple?

Thanks for reading.

I am just evaluating Maple 2021 under Windows 10 and I have something strange happening when I press F1 for Help or I select Maple Help in Help Menu. The first time the help window will appear but if I close it then impossible to view it again by pressing F1 or by selecting it in the Help menu. Also the same for other choices in the help menu like

Maple Help F1
Maple Portal
Study Guides
What's New

But any choices inside On the web will always work.

I am using Windows 10 latest release in french and the keyboard layout in ENG I don't think it is related but just in case someone ask me.

Have you notice the same problem ?

I have used the open source maxima quite a bit, and variable replacement was easy. For example:

3x+2y,x=20,y=5

3x+2y,x=3m-4p,y=(a+b)^2

I could combine very easily, like:

a=3x+2y             (%1)

4a-2b,%1

%1,x=5,y=7

and so on...I use variable replacement in equations VERY regularly, and so far, all I have found is having to use a mouse and select "Evaluate at a point". I'm not even sure I could put other equations in there if I wanted to. Even if it does work, the more complicated scenarios that I did routinely in maxima would still be virtually impossible this way.

Thus, the question is, is there doc somewhere on how to make various variable replacements, and equation combining like this easy?

I'm trying to understand what I need to do to get Maple to solve the heat equation in spherical coordinates. I'm considering a test problem: a spherical shell with inner radius 1 and outer radius 2. Boundary conditions require the temperature of the inner and outer surfaces are to always equal zero. The initial condition requires the temperature inside the shell to be -sin(pi*r). 

The attached worksheet provides my attempt to solve this problem. Executing this worksheet will quickly give a general solution but this does not include the initial condition. If this is included then Maple fails to give a solution even after a 20 min wait. 

Could someone offer me guidance on how to proceed?

shell.mw

I want to sum a series by getting multiple values from a list.  Based on the list L I was trying

add(A, [m2, m3] in L)   This seem to have dissapeared from the document but the error message remains.

restart

``

NULL

NULL

A := factorial(2*m2+3*m3)*c0^(1+m2+2*m3)*c2^m2*c3^m3/(factorial(1+m2+2*m3)*factorial(m2)*factorial(m3)*c1^(2*m2+3*m3+1))

factorial(2*m2+3*m3)*c0^(1+m2+2*m3)*c2^m2*c3^m3/(factorial(1+m2+2*m3)*factorial(m2)*factorial(m3)*c1^(2*m2+3*m3+1))

(1)

"P:=3, N:=4"

4

(2)

``

I found this code by Kitonum 16740  https://www.mapleprimes.com/questions/138955-How-Do-I-Create-A-Variable-Number-Of-Nested-Loops-

S := {seq(0 .. N)}; l := P-1; f := proc (T) options operator, arrow; [seq(seq([op(T[j]), S[i]], i = 1 .. nops(S)), j = 1 .. nops(T))] end proc; L := (f@@l)([[]])

[[0, 0], [0, 1], [0, 2], [0, 3], [0, 4], [1, 0], [1, 1], [1, 2], [1, 3], [1, 4], [2, 0], [2, 1], [2, 2], [2, 3], [2, 4], [3, 0], [3, 1], [3, 2], [3, 3], [3, 4], [4, 0], [4, 1], [4, 2], [4, 3], [4, 4]]

(3)

nops(L)

25

(4)

NULLNULL

``

nops(L)

25

(5)

Instead of using add(add(A, m2 = 0 .. 4)*m3 = 0 .. 4)I would like to map m2 and m3 to the values in list L and sum them. This should give a method for having a variable number of loops

I tried variants off without success

 

add(A, `in`([m2, m3], L))

Error, illegal use of an object as a name

 

 

 

 

 

for the next higher order would need to map m2,m3, m4 to the generated list.

 

 

 

B := factorial(2*m2+3*m3+4*m4)*c0^(1+m2+2*m3+3*m4)*c2^m2*c3^m3*c4^m4/(factorial(1+m2+2*m3+3*m4)*factorial(m2)*factorial(m3)*factorial(m4)*c1^(2*m2+3*m3+4*m4+1))

factorial(2*m2+3*m3+4*m4)*c0^(1+m2+2*m3+3*m4)*c2^m2*c3^m3*c4^m4/(factorial(1+m2+2*m3+3*m4)*factorial(m2)*factorial(m3)*factorial(m4)*c1^(2*m2+3*m3+4*m4+1))

(6)

P := 4; S := {seq(0 .. N)}; l := P-1; f := proc (T) options operator, arrow; [seq(seq([op(T[j]), S[i]], i = 1 .. nops(S)), j = 1 .. nops(T))] end proc; L := (f@@l)([[]])

[[0, 0, 0], [0, 0, 1], [0, 0, 2], [0, 0, 3], [0, 0, 4], [0, 1, 0], [0, 1, 1], [0, 1, 2], [0, 1, 3], [0, 1, 4], [0, 2, 0], [0, 2, 1], [0, 2, 2], [0, 2, 3], [0, 2, 4], [0, 3, 0], [0, 3, 1], [0, 3, 2], [0, 3, 3], [0, 3, 4], [0, 4, 0], [0, 4, 1], [0, 4, 2], [0, 4, 3], [0, 4, 4], [1, 0, 0], [1, 0, 1], [1, 0, 2], [1, 0, 3], [1, 0, 4], [1, 1, 0], [1, 1, 1], [1, 1, 2], [1, 1, 3], [1, 1, 4], [1, 2, 0], [1, 2, 1], [1, 2, 2], [1, 2, 3], [1, 2, 4], [1, 3, 0], [1, 3, 1], [1, 3, 2], [1, 3, 3], [1, 3, 4], [1, 4, 0], [1, 4, 1], [1, 4, 2], [1, 4, 3], [1, 4, 4], [2, 0, 0], [2, 0, 1], [2, 0, 2], [2, 0, 3], [2, 0, 4], [2, 1, 0], [2, 1, 1], [2, 1, 2], [2, 1, 3], [2, 1, 4], [2, 2, 0], [2, 2, 1], [2, 2, 2], [2, 2, 3], [2, 2, 4], [2, 3, 0], [2, 3, 1], [2, 3, 2], [2, 3, 3], [2, 3, 4], [2, 4, 0], [2, 4, 1], [2, 4, 2], [2, 4, 3], [2, 4, 4], [3, 0, 0], [3, 0, 1], [3, 0, 2], [3, 0, 3], [3, 0, 4], [3, 1, 0], [3, 1, 1], [3, 1, 2], [3, 1, 3], [3, 1, 4], [3, 2, 0], [3, 2, 1], [3, 2, 2], [3, 2, 3], [3, 2, 4], [3, 3, 0], [3, 3, 1], [3, 3, 2], [3, 3, 3], [3, 3, 4], [3, 4, 0], [3, 4, 1], [3, 4, 2], [3, 4, 3], [3, 4, 4], [4, 0, 0], [4, 0, 1], [4, 0, 2], [4, 0, 3], [4, 0, 4], [4, 1, 0], [4, 1, 1], [4, 1, 2], [4, 1, 3], [4, 1, 4], [4, 2, 0], [4, 2, 1], [4, 2, 2], [4, 2, 3], [4, 2, 4], [4, 3, 0], [4, 3, 1], [4, 3, 2], [4, 3, 3], [4, 3, 4], [4, 4, 0], [4, 4, 1], [4, 4, 2], [4, 4, 3], [4, 4, 4]]

(7)

nops(L)

125

(8)

NULL


 

Download Sum_by_mapping_to_a_list_question.mw

I have two summations that Maple converts to hypergeometric outputs. Is there a way to stop that?

I dont know how to get Maple to expand the Hyper geometric output for a given walue of N

if the value of N is defined first the output is as I would expect.

The real problem, the sumations are nested and when I get to four nested sums Maple sits there for hours trying to evaluate the general case. 

I have only included the first 2 summations.

Any insights on this would be appreciated.
 

restart

NULL

NULL

NULL

``

``

a := -(sum(C2^(m-1)*C0^m*factorial(2*m)/(C1^(2*m-1)*factorial(m+1)*factorial(m)), m = 0 .. N))

-2*C1/(C2*(1+(-(4*C0*C2-C1^2)/C1^2)^(1/2)))+C2^N*C0^(N+1)*GAMMA(2*N+3)*(N+2)*hypergeom([1, 3/2+N], [N+3], 4*C0*C2/C1^2)/(C1^(2*N+1)*GAMMA(N+3)^2)

(1)

N := 4

4

(2)

a

-2*C1/(C2*(1+(-(4*C0*C2-C1^2)/C1^2)^(1/2)))+42*C2^4*C0^5*hypergeom([1, 11/2], [7], 4*C0*C2/C1^2)/C1^9

(3)

b := -(sum(C2^(m-1)*C0^m*factorial(2*m)/(C1^(2*m-1)*factorial(m+1)*factorial(m)), m = 0 .. N))

-C1/C2-C0/C1-2*C2*C0^2/C1^3-5*C2^2*C0^3/C1^5-14*C2^3*C0^4/C1^7

(4)

NULL

NULL``

unassign('N')

c := sum(sum((-1)^(m[3]+1)*factorial(2*m[2]+3*m[3])*C0^(1+m[2]+2*m[3])*C2^m[2]*C3^m[3]/(factorial(1+m[2]+2*m[3])*factorial(m[2])*factorial(m[3])*C1^(1+2*m[2]+3*m[3])), m[3] = 0 .. N), m[2] = 0 .. N)

sum(C2^m[2]*(-factorial(2*m[2])*C0^(1+m[2])*hypergeom([(2/3)*m[2]+1, (2/3)*m[2]+2/3, 1/3+(2/3)*m[2]], [1+(1/2)*m[2], 3/2+(1/2)*m[2]], -(27/4)*C0^2*C3/C1^3)/(factorial(1+m[2])*C1^(1+2*m[2]))-factorial(2*m[2]+3*N+3)*C0^(3+m[2]+2*N)*C3^(N+1)*hypergeom([1, (2/3)*m[2]+2+N, 5/3+(2/3)*m[2]+N, 4/3+(2/3)*m[2]+N], [N+2, 2+(1/2)*m[2]+N, 5/2+(1/2)*m[2]+N], -(27/4)*C0^2*C3/C1^3)*(-1)^N/(factorial(3+m[2]+2*N)*factorial(N+1)*C1^(4+2*m[2]+3*N)))/factorial(m[2]), m[2] = 0 .. N)

(5)

NULL

NULLN := 4

4

(6)

c

-C0*hypergeom([1/3, 2/3], [3/2], -(27/4)*C0^2*C3/C1^3)/C1-273*C0^11*C3^5*hypergeom([1, 16/3, 17/3], [6, 13/2], -(27/4)*C0^2*C3/C1^3)/C1^16+C2*(-C0^2*hypergeom([1, 4/3, 5/3], [3/2, 2], -(27/4)*C0^2*C3/C1^3)/C1^3-6188*C0^12*C3^5*hypergeom([1, 19/3, 20/3], [13/2, 7], -(27/4)*C0^2*C3/C1^3)/C1^18)+(1/2)*C2^2*(-4*C0^3*hypergeom([5/3, 7/3], [5/2], -(27/4)*C0^2*C3/C1^3)/C1^5-162792*C0^13*C3^5*hypergeom([1, 20/3, 22/3], [6, 15/2], -(27/4)*C0^2*C3/C1^3)/C1^20)+(1/6)*C2^3*(-30*C0^4*hypergeom([7/3, 8/3], [5/2], -(27/4)*C0^2*C3/C1^3)/C1^7-4883760*C0^14*C3^5*hypergeom([1, 22/3, 23/3], [6, 15/2], -(27/4)*C0^2*C3/C1^3)/C1^22)+(1/24)*C2^4*(-336*C0^5*hypergeom([10/3, 11/3], [7/2], -(27/4)*C0^2*C3/C1^3)/C1^9-164745504*C0^15*C3^5*hypergeom([1, 25/3, 26/3], [6, 17/2], -(27/4)*C0^2*C3/C1^3)/C1^24)

(7)

NULL

e := sum(sum((-1)^(m[3]+1)*factorial(2*m[2]+3*m[3])*C0^(1+m[2]+2*m[3])*C2^m[2]*C3^m[3]/(factorial(1+m[2]+2*m[3])*factorial(m[2])*factorial(m[3])*C1^(1+2*m[2]+3*m[3])), m[3] = 0 .. N), m[2] = 0 .. N)

-C0/C1-5*C2^3*C0^4/C1^7-C2*C0^2/C1^3-2*C2^2*C0^3/C1^5-3*C0^5*C3^2/C1^7+12*C0^7*C3^3/C1^10-55*C0^9*C3^4/C1^13-14*C0^5*C2^4/C1^9+C0^3*C3/C1^4+330*C0^7*C2^4*C3/C1^12-5005*C0^9*C2^4*C3^2/C1^15+61880*C0^11*C2^4*C3^3/C1^18-678300*C0^13*C2^4*C3^4/C1^21+5*C0^4*C2*C3/C1^6-28*C0^6*C2*C3^2/C1^9+165*C0^8*C2*C3^3/C1^12-1001*C0^10*C2*C3^4/C1^15+21*C0^5*C2^2*C3/C1^8-180*C0^7*C2^2*C3^2/C1^11+1430*C0^9*C2^2*C3^3/C1^14-10920*C0^11*C2^2*C3^4/C1^17+84*C0^6*C2^3*C3/C1^10-990*C0^8*C2^3*C3^2/C1^13+10010*C0^10*C2^3*C3^3/C1^16-92820*C0^12*C2^3*C3^4/C1^19

(8)

NULL


 

Download why_hypergeom.mw

What is the reason for the warning?

restart;
f := (x, y, z) -> 1 - x^4 + ln(x^4) + z^4 - y^4 - y^4*(ln(z^4) - ln(y^4));


with(Optimization);
Minimize(f(x, y, z), {x^2 + y^2 - z^2 - 1 = 0, 0 <= x - 1, 0 <= y - x, 0 <= z - y});
Warning, no iterations performed as initial point satisfies first-order conditions
                 [0., [x = 1., y = 1., z = 1.]]

I'm trying to lad a comma separated data set and I get an "Invalid minus error".  Neither the filename nor the data set has a minus anywhere in them.  See attached file:  SST Gm Stats.mw  

Download SST_Gm_Stats.mwDownload SST_Gm_Stats.mw

Since I can't upload a .csv file here are its contents:

5248.65,5178.95,5231.01,5161.78,5329.23,5258.52,5311.33,5241.1,5268.2,5198.26,5250.5,5181.03,5348.75,5277.8,5330.79,5260.32,5248.91,5179.21,5231.27,5162.03,5329.49,5258.77,5311.59,5241.35,5268.47,5198.53,5250.77,5181.29,5349.02,5278.06,5331.06,5260.58,5238.16,5168.61,5220.56,5151.47,5318.58,5248.01,5300.72,5230.63,5257.68,5187.88,5240.02,5170.68,5338.06,5267.25,5320.15,5249.81,5238.42,5168.86,5220.82,5151.72,5318.84,5248.27,5300.98,5230.88,5257.95,5188.14,5240.28,5170.94,5338.33,5267.52,5320.41,5250.07,5249.41

Where's the "minus" let alone an invalid one?

John

 

Let's say I have an mpl file and in this file there are several lines $include<~/~/~.mpl> and in some of those called mpl files, there are also some more include lines. And assume the paths of these files are given relative to a specific folder. Now I guess this specific folder has to be mentioned by modifying includepath. But looking at the help pages related to includepath (here and here) I get this sentence "it can be modified by calling kernelopts(includepath)", but I tired typing things like kernelopts(includepath):="C:\\Homes\\testFolder"; and still I see "" for kernelopts(includepath);. How can I tell Maple to look for the files relative to this location either by typing something at the Maple worksheet before typing read("C:\\Home\\testFolder\\main.mpl); or by adding a line at my main mpl file?

It is said that the LaTeX export of maple2021 has been improved , but unfortunately I still encounter the following problems.

When I execute the following related graph theory code,

restart;
with(GraphTheory):
s1:=[NonIsomorphicGraphs(4,restrictto = connected,output=graphs,outputform=graph)]:
DrawGraph(s1,width=4,stylesheet = [vertexcolor = "Blue",vertexpadding=20])

 

It is strange that all graphs(.eps) are not produced in  corresponding folder  when I exported it as latex file . So it leads to the lack of graphs in the running results of latex.

If it is a single graph, there seems to be no problem.

restart;
with(GraphTheory):
s1:=[NonIsomorphicGraphs(4,restrictto = connected,output=graphs,outputform=graph)]:
DrawGraph(
s1[1],width=4,stylesheet = [vertexcolor = "Blue",vertexpadding=20])

 

 

 

 

 

graph1.mw

 

 

 

 

Hi all, 

When I open up Maple the toolbar which says insert: 'Math, Text etc' has disappeared. However sometimes when I restart the program the tool bar re-appears again. I have attached a screenshot have a look. I want to know is anyone else experiencing this in Maple 2021? 

I have two equations (assignments, to be accurate) from which I know they are equal:

f__1 := sqrt(4*a^2 + lambda__g^2)*c/(2*lambda__g*a)

f__2 := c*sqrt(1/lambda__g^2 + 1/(4*a^2))

However:

testeq(f__1 = f__2) returns FAIL

verify(f__1, f__2, equal) returns  FAIL

and

simplify(f__1 - f__2, sqrt)

does not return 0 but

-c*(sqrt((4*a^2 + lambda__g^2)/(lambda__g^2*a^2))*lambda__g*a - sqrt(4*a^2 + lambda__g^2))/(2*lambda__g*a)

What is the best method for checking such equalities?

I am sorry for not using the Maple Math input option but fpr such reason it did not accept the expressions in this question. I am sure I made a mistake but I do not know what mistake.

I tested all methods mentioned above with the 1. Binominal equation sucessfully.

 

I was trying to get an aproximation of an expression, but it doesnt seem to provide the correct answer. for the following

((12*sqrt(13))/13 - 3/4)/(1 + ((12*sqrt(13))/13)(3/4))

 maple provides 0.59568 and the actual answer is 0.73744

I dont know what I am doing wrong

First 33 34 35 36 37 38 Page 35 of 38