Maple Questions and Posts

These are Posts and Questions associated with the product, Maple

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))

 


 

We give a line (D) and a point A located at a distance AH=h from D. A constant angle of magnitude alpha pivots to its apex A and we call B and C the points where its sides cut the line D. Let O be the center of the circle circumscribed to the triangle ABC.
Demonstrate that the B and C tangents to the O circle keep a fixed direction. 
Here is my code which don't work for slopes are not equal.

restart; with(plots): with(geometry):unprotect(D):
_EnvHorizontalName := 'x':_EnvVerticalName := 'y':
line(D, y = (1/2)*x-1); point(A, 5, 5); PerpendicularLine(lp, A, D); h := distance(A, D); intersection(H, D, lp);
alpha := (1/16)*Pi;
rotation(lp1, lp, (1/6)*Pi, 'clockwise', A); rotation(lp2, lp1, (1/6)*Pi-alpha, 'clockwise', A); FindAngle(lp1, lp2); evalf(%);
intersection(B, D, lp1); intersection(C, D, lp2);
triangle(T, [A, B, C]);
circumcircle(Elc, T, 'centername' = OO);
TangentLine(tgB, B, Elc); TangentLine(tgC, C, Elc);
evalf(slope(tgB)); evalf(slope(tgC));
dr := draw([D(color = blue), lp(color = red), Elc(color = green), A, B, C, T(color = black), H, tgB, tgC], printtext = true);

display([dr], axes = none, scaling = constrained);
Fig := proc (k) local dr, Elc, B, C, lp1, lp2; global D, A, lp, H, alpha; geometry:-rotation(lp1, lp, (1/6)*Pi+k, 'clockwise', A); geometry:-rotation(lp2, lp1, (1/6)*Pi-alpha+k, 'clockwise', A); geometry:-intersection(B, D, lp1); geometry:-intersection(C, D, lp2); geometry:-triangle(T, [A, B, C]); geometry:-circumcircle(Elc, T, 'centername' = OO); geometry:-TangentLine(tgB, B, Elc); geometry:-TangentLine(tgC, C, Elc); dr := geometry:-draw([D(color = blue), lp(color = red), Elc(color = green), A, B, C, T(color = black), H, tgB, tgC], printtext = true); plots:-display([dr], axes = none, scaling = constrained) end proc;
iframes := 10;

display([seq(Fig((1/12)*Pi+i/(10*iframes)), i = 1 .. iframes)], insequence, scaling = constrained);
How to improve this code ? Thank you.

Hi,

Could anybody help me with how to solve the linear time-varying differential equation set in Maple?

A good example will works well.

I've finally decided to see what I could to do with DocumentTools.
I started with these simple lines from ?DocumentTools:-Do 

restart:
with(DocumentTools):
Do(int(%expression, x=%from::integer..%to::integer));
Error, (in DocumentTools:-GetProperty) Attempted to retrieve property of unknown component expression.

These next ones return the expected plot but an alert window 

restart:
with(DocumentTools):
Do(%Plot1=plot(x^2, x=0..1));


However the Click and Drag icon is disabled in the plot toolbar and invisible in the plot menu.

The behaviour of these commands do not depend on whether they are written in a worksheet, a section or a code edit region.

Could you detail me the very first steps do use DocumentTools features?

TIA

DT-Do.mw

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