Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

 

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?

When I use piecewise like this

W :=piecewise(beta>=-Pi/2 and beta<=-Pi/2+Pi/200,1+eps/sin(Pi/200)+eps*cos(Pi/200)/sin(Pi/200)*sin(beta),
     
beta>=-Pi/2+Pi/200 and beta<=Pi/2,1+eps/sin(Pi/200)-eps*cos(Pi/200)/sin(Pi/200)*sin(beta),
      1+eps*(1+cos(beta)));

 

and eval the beta as following,

G:= eval(R,beta=(arctan(diff(f(x,y),y), diff(f(x,y),x))));

the calculation does not run well...because of the undefined

[[-eps sin(t_atan2((&PartialD;)/(&PartialD;y) pho(x,y),(&PartialD;)/(&PartialD;x) pho(x,y))),t_atan2((&PartialD;)/(&PartialD;y) pho(x,y),(&PartialD;)/(&PartialD;x) pho(x,y))<-Pi/2],[undefined,t_atan2((&PartialD;)/(&PartialD;y) pho(x,y),(&PartialD;)/(&PartialD;x) pho(x,y))=-Pi/2],[(eps cos(Pi/200) cos(t_atan2((&PartialD;)/(&PartialD;y) pho(x,y),(&PartialD;)/(&PartialD;x) pho(x,y))))/(sin(Pi/200)),t_atan2((&PartialD;)/(&PartialD;y) pho(x,y),(&PartialD;)/(&PartialD;x) pho(x,y))<-(99 Pi)/200],[undefined,t_atan2((&PartialD;)/(&PartialD;y) pho(x,y),(&PartialD;)/(&PartialD;x) pho(x,y))=-(99 Pi)/200],[-(eps cos(Pi/200) cos(t_atan2((&PartialD;)/(&PartialD;y) pho(x,y),(&PartialD;)/(&PartialD;x) pho(x,y))))/(sin(Pi/200)),t_atan2((&PartialD;)/(&PartialD;y) pho(x,y),(&PartialD;)/(&PartialD;x) pho(x,y))<Pi/2],[undefined,t_atan2((&PartialD;)/(&PartialD;y) pho(x,y),(&PartialD;)/(&PartialD;x) pho(x,y))=Pi/2],[-eps sin(t_atan2((&PartialD;)/(&PartialD;y) pho(x,y),(&PartialD;)/(&PartialD;x) pho(x,y))),Pi/2<t_atan2((&PartialD;)/(&PartialD;y) pho(x,y),(&PartialD;)/(&PartialD;x) pho(x,y))]]

Finally, when W is brought into the following formula for calculation, 

R:=   
-M*ElementInt( test(x,y)*((1-co(x,y))*Ha+co(x,y)*Hb))
     +M*ElementInt( test(x,y)*noise)
+M*gamma*(-ElementInt( W^2*( nab(test(x,y))[i] &t nab(f(x,y))[i])))
              +ElementInt( diff(W^2,beta)/2 * ( diff(test(x,y),x)*diff(f(x,y),y)
              -diff(test(x,y),y)*diff(f(x,y),x))):

 

the following error message will appear.

Error: Division by zero at (1)

 

I mentioned a similar problem just recently, but after two days of continuous attempts, I couldn't find a solution.
Look forward to receiving a reply.......

I'm solving this equation:

eq3 := 2*lambda*(q[1]+p[1]*exp(t))*(q[2]+p[2])^2*p[1]*exp(t) = s[1]

eq4 := 2*lambda*(q[1]+p[1])^2*(q[2]+p[2]*exp(u))*p[2]*exp(u) = s[2]

solve({eq3, eq4}, {t, u})

This is what I get:

{t = ln(RootOf(-s[1]+(2*lambda*p[2]*q[1]+2*lambda*q[1]*q[2])*_Z+2*lambda*_Z^2)/((q[2]+p[2])*p[1])), u = ln(RootOf(-s[2]+(2*lambda*p[1]*q[2]+2*lambda*q[1]*q[2])*_Z+2*lambda*_Z^2)/((q[1]+p[1])*p[2]))}

I'm completely new at maple.

I can't find what _Z  and _Z^2 mean. Can anybody help? and how I can solve this _z and _Z^2

Thanks in advance

Hello, 

i would like to continue to work on a code which was done With CodeBuilder some years ago.

i often like to print my code to be able to read without any computer.

Problem : the print function on a worksheet with several coderegion doesn t work well.

1) Do you have some ideas to circumvet this issue ,

2) i m thinking about using a text éditor which can give a nice printing with maple. Emacs is far to much complex for me. Consequently, i havé seen that some of you have testéd Sublime text. I think that it may be a good alternative. Do you have ideas about simple text editor that i can use to edit maple code ?
 

thank you for your help 

hi, I wonder why this output is empty because I tried to get solution below partial equation:

restart;
with(PDEtools);
pe := diff(u(t, x, y), t) = u(t, x, y) - diff(u(t, x, y), x $ 2) - diff(u(t, x, y), y $ 2) + (1 + u(t, x, y)*I)*abs(u(t, x, y))*u(t,x,y)^2;                                  
inc := u(0, x, y) = cos(Pi*x/50) - cos(Pi*x/150)*I;
sys := [pe, inc];
   

pdsolve(sys);
 

end after this pdsolve(sys); Maple doesn't show anything

thanks in advance

When I want to generate matlab code of the following symbolic expression I got very strange result:

with(CodeGeneration);
Matlab(Sum(a(i), i = 1 .. N));
Warning, the function names {Sum, a} are not recognized in the target language
Warning, precedence for Range unspecified
Warning, cannot translate range
cg = Sum(a(i), i == (1..N));

 

Problem:Sum(a(i), i == (1..N));

 

Right matlab code should look like:

cg = sum(a);

Where can I found compete list of supported matlab built-in function? Is there any possibility how to get proper matlab code?

Is there any way how to convert more complex symbilic expressions to the Matlab???

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

Hello,

I have code which contains a data structure. This data structure was defined with Types and a Table.

I would like to know which is the best manner to do to build a data structure.

Is it better to use a Table or a MultiSet ?

May you precise me the pros and the cons of the 2 solutions?

Or indicate me if you have other ways to do.

Thanks a lot for your help.

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

sum2N := proc (N::integer) local summation, i, k; summation := 0; k := 0;

for i from 0 to N do if i = 1 then k := k+1

end if; summation := (i+k)^2 end do

end proc;
sum2N(10);

the result shows 121 but its not correct i think the right answer show be 2985
 

Bonjour,

Comment transformer cette liste de résultat: 

a := {x = -12, y = -23}, {x = -34, y = 87}, {x = 18, y = 98}, {x = 27, y = 93}, {x = 45, y = 68}

En une liste simple telle que L: = [-12,-23,-34,87,18,98,27,93,45,68 ]

Merci 


HELLO,

How to transform this result list : 

a := {x = -12, y = -23}, {x = -34, y = 87}, {x = 18, y = 98}, {x = 27, y = 93}, {x = 45, y = 68}

In a simple list such that :  L: = [-12,-23,-34,87,18,98,27,93,45,68 ]

Thank You

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

I am a student who is learning to use Maple to perform numerical analysis of phase field. There has been no solution to the problem of high anisotropy. The reference code is as follows

W :=piecewise(beta>=Pi/2+thetaM and beta<=Pi-thetaM, 1+eps*cos(4*beta), 
       beta>=Pi/2-thetaM and beta<=Pi/2+thetaM, (1+esp*cos(4*thetaM))/cos(thetaM)*cos(4*beta));

 

However, there is no problem at all when simply performing the following settings.

W := 1+ eps*cos(4*beta);

Please tell me how to write such a conditional maple statement. I have referenced many examples on the official website, but none of them succeeded. This includes writing the code in the following form.

W :=betta->piecewise(beta>=Pi/2+thetaM and beta<=Pi-thetaM, 1+eps*cos(4*beta), 
       beta>=Pi/2-thetaM and beta<=Pi/2+thetaM, (1+esp*cos(4*thetaM))/cos(thetaM)*cos(4*beta));

Remarks, beta is an angle, set as follows.

subs(beta=t_atan2(diff(pho(x,y),y), diff(pho(x,y),x))

 


 

1 2 3 4 5 6 7 Last Page 1 of 1810