Maple 2018 Questions and Posts

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

Dear All,

Gretting from me. I have faced a problem in Maple program due to some errors. Could you please help me about the solution of that problem?

@Preben Alsholm
Sourse File:

Duo:=proc(a)  #a nombre congruent connu
local u,v,n,m,k,t:
for m to t do
  for n to m do
    if (igcd(m,n)=1 and m>n) then
      k:=op(2,sqrt(v-u))^2: # k nombre congruent réduit
        if k=a then return (m,n): break 
        elif n=t then break fi:

                              3, 2
                             26, 23
                              2, 1
u, v, w sont des carrés en progression arithmétique dont la raison est un nombre congruent
Procédure permettant de trouver un triplet pythagoricien primitif correspondant au nombre congruent a connu
TriPy:=proc(m,n)# triangles pythagoriciens
local a,a1,b1,c1,d,k,q,u,v,w:
 if (igcd(m,n)=1 and m>n) then
 a:=(op(2,sqrt(v-u)))^2:#nombre congruent réduit
 q:=sqrt((v-u)/a)/2:#rapport de réduction
                              17  145
                          24, --, ---
                              6    6 

                          156  5  313
                          ---, -, ---
                           5   2  10 

                         444  35  1513
                         ---, --, ----
                         35   2    70 
                         1196      1205
                         ----, 21, ----
                          7         7  
TriPy(Duo(23));don't work, "part dans les choux"

How  I can use from equations 1-6 and repleacing them into equation 7 to remove qx,qy,qz?

Thank you

A := q__x(x, y, z, t)+`τ__q`*(diff(q__x(x, y, z, t), t))+(1/2)*`τ__q`^2*(diff(q__x(x, y, z, t), t, t)) = -k*(diff(T(x, y, z, t), x))-k*`τ__T`*(diff(T(x, y, z, t), x, t))-(1/2)*k*`τ__T`^2*(diff(T(x, y, z, t), x, t, t))

q__x(x, y, z, t)+tau__q*(diff(q__x(x, y, z, t), t))+(1/2)*tau__q^2*(diff(diff(q__x(x, y, z, t), t), t)) = -k*(diff(T(x, y, z, t), x))-k*tau__T*(diff(diff(T(x, y, z, t), t), x))-(1/2)*k*tau__T^2*(diff(diff(diff(T(x, y, z, t), t), t), x))


A__x := diff(A, x)

diff(q__x(x, y, z, t), x)+tau__q*(diff(diff(q__x(x, y, z, t), t), x))+(1/2)*tau__q^2*(diff(diff(diff(q__x(x, y, z, t), t), t), x)) = -k*(diff(diff(T(x, y, z, t), x), x))-k*tau__T*(diff(diff(diff(T(x, y, z, t), t), x), x))-(1/2)*k*tau__T^2*(diff(diff(diff(diff(T(x, y, z, t), t), t), x), x))



B := q__y(x, y, z, t)+`τ__q`*(diff(q__y(x, y, z, t), t))+(1/2)*`τ__q`^2*(diff(q__y(x, y, z, t), t, t)) = -k*(diff(T(x, y, z, t), y))-k*`τ__T`*(diff(T(x, y, z, t), y, t))-(1/2)*k*`τ__T`^2*(diff(T(x, y, z, t), y, t, t))

q__y(x, y, z, t)+tau__q*(diff(q__y(x, y, z, t), t))+(1/2)*tau__q^2*(diff(diff(q__y(x, y, z, t), t), t)) = -k*(diff(T(x, y, z, t), y))-k*tau__T*(diff(diff(T(x, y, z, t), t), y))-(1/2)*k*tau__T^2*(diff(diff(diff(T(x, y, z, t), t), t), y))


B__y := diff(B, y)

diff(q__y(x, y, z, t), y)+tau__q*(diff(diff(q__y(x, y, z, t), t), y))+(1/2)*tau__q^2*(diff(diff(diff(q__y(x, y, z, t), t), t), y)) = -k*(diff(diff(T(x, y, z, t), y), y))-k*tau__T*(diff(diff(diff(T(x, y, z, t), t), y), y))-(1/2)*k*tau__T^2*(diff(diff(diff(diff(T(x, y, z, t), t), t), y), y))



C := q__z(x, y, z, t)+`τ__q`*(diff(q__z(x, y, z, t), t))+(1/2)*`τ__q`^2*(diff(q__z(x, y, z, t), t, t)) = -k*(diff(T(x, y, z, t), z))-k*`τ__T`*(diff(T(x, y, z, t), z, t))-(1/2)*k*`τ__T`^2*(diff(T(x, y, z, t), z, t, t))

q__z(x, y, z, t)+tau__q*(diff(q__z(x, y, z, t), t))+(1/2)*tau__q^2*(diff(diff(q__z(x, y, z, t), t), t)) = -k*(diff(T(x, y, z, t), z))-k*tau__T*(diff(diff(T(x, y, z, t), t), z))-(1/2)*k*tau__T^2*(diff(diff(diff(T(x, y, z, t), t), t), z))


C__z := diff(C, z)

diff(q__z(x, y, z, t), z)+tau__q*(diff(diff(q__z(x, y, z, t), t), z))+(1/2)*tau__q^2*(diff(diff(diff(q__z(x, y, z, t), t), t), z)) = -k*(diff(diff(T(x, y, z, t), z), z))-k*tau__T*(diff(diff(diff(T(x, y, z, t), t), z), z))-(1/2)*k*tau__T^2*(diff(diff(diff(diff(T(x, y, z, t), t), t), z), z))



expand(simplify(-A__x-B__y-C__z+Q = rho*c__p*(diff(T(x, y, z, t), t))))

(-(diff(q__x(x, y, z, t), x))-tau__q*(diff(diff(q__x(x, y, z, t), t), x))-(1/2)*tau__q^2*(diff(diff(diff(q__x(x, y, z, t), t), t), x))-(diff(q__y(x, y, z, t), y))-tau__q*(diff(diff(q__y(x, y, z, t), t), y))-(1/2)*tau__q^2*(diff(diff(diff(q__y(x, y, z, t), t), t), y))-(diff(q__z(x, y, z, t), z))-tau__q*(diff(diff(q__z(x, y, z, t), t), z))-(1/2)*tau__q^2*(diff(diff(diff(q__z(x, y, z, t), t), t), z))+Q = k*(diff(diff(T(x, y, z, t), x), x))+k*tau__T*(diff(diff(diff(T(x, y, z, t), t), x), x))+(1/2)*k*tau__T^2*(diff(diff(diff(diff(T(x, y, z, t), t), t), x), x))+k*(diff(diff(T(x, y, z, t), y), y))+k*tau__T*(diff(diff(diff(T(x, y, z, t), t), y), y))+(1/2)*k*tau__T^2*(diff(diff(diff(diff(T(x, y, z, t), t), t), y), y))+k*(diff(diff(T(x, y, z, t), z), z))+k*tau__T*(diff(diff(diff(T(x, y, z, t), t), z), z))+(1/2)*k*tau__T^2*(diff(diff(diff(diff(T(x, y, z, t), t), t), z), z))+Q) = rho*c__p*(diff(T(x, y, z, t), t))







Dear Community,

I would like to have a 3D matrix, where each of the matrix elements is a collection of different kind of data, e.g. integers, real (float) numbers, logical variable, 1D vector of integers or reals, 1D vector of logical variables, etc. In other words I would like to store a collection of different data on a 3D grid. This collection is of course identical for all grid points, i.e. matrix elements. I experimented with DataFrames, but it did not allow me to use vectors. How could I realize such a structure in Maple? It is done quite easily in MATLAB e.g. with the "struct" command, or in FORTRAN with the "Type" command.

Many tx in advance,

best regards



Suppose that (x1, x2, . . . , xn) is a sequence of real numbers. The mean μ and the standard deviation σ are defined as
μ= n(x1 +x2 +...+xn);

σ=√[(1/2)n[(x1 −μ) +(x2 −μ) +...+(xn −μ) ]]

1. Suppose that n = 20 and xk = k for all k. Write for loops to determine the mean and the standard deviation of the sequence.

2. Suppose that n = 30 and xk = k3 for all k. Write for loops to determine the mean and the standard deviation of the sequence.

I've been trying to learn how to do Grid-based parallelization in Maple, but I've been running into a weird error.

Suppose I run the following simple Grid code, which just runs on a single node:

X := [1, 2, 3, 4]; babyGrid := proc (X) [Grid:-MyNode(), X] end proc; Grid:-Launch(babyGrid, X);

 I get this error:

Error, (in Grid:-Launch) invalid input: Launch expects its 7th argument, exports, to be of type ({list, set})({name, string}), but received [1, 2, 3, 4]

So for some reason it assumes that X is the exports variable. This error goes away if I instead make X an array X:=Array([1,2,3,4])

In this case the code runs fine and produces the expected output.

What's the difference here? Is there a reason that Grid can't take list arguments? Is there a reason this is so obvious that it isn't documented?



I am not sure what happened, but now after starting Maple, these PDE's no longer hang. Even though I tried them before number of times before posting to make sure.  This is strange. I do not know what happened.

Any way, there is no issue any more. These do not hang in version 319.

original post

Hello Maple experts.

FYI, I noticed some pde's are no longer solved (hang) after downloading latest physics package cloud version 319, when before when using version 301 these were solved.

 User Interface: 1362973
         Kernel: 1362973
        Library: 1362973
 "C:\Maple_updates\Physics_Updates_319.maple", 2019, March 3, 
    17:7 hours, version in the MapleCloud: 319, version installed in this 
    computer: the "Physics Updates" is not  installed.

Any idea why this happened? It is possible this is due to bug fix of course, but thought to point this out.

These PDE's were solved with Maple 2018.2.1 with Physics ver. 301 but not in ver. 319

#now not solved or hangs, before it was solved in 7 seconds
pde := diff(u(x, t), t) = (1/20)*(diff(u(x, t), x$2))+t;
bc := u(0, t) = 5, (u(1, t)+ eval( diff(u(x,t),x),x=1)) = 10;
ic:= u(x, 0) = -40*x^2/3+45*x/2+5;
pdsolve([pde, bc,ic], u(x, t));

#now it hangs, before it was solved in 0.2 seconds
pde :=  (A*y^2+B*x^2-a^2*B)*diff(w(x,y),x)+(C*y^2+2*B*x*y)*diff(w(x,y),y) = 0;

#now hangs when it was solved before in 5 seconds
pde := 2*diff(w(x,y),x)+((lambda+a-a*sin(lambda*x))*y^2 +lambda -a -a*sin(lambda*x))*diff(w(x,y),y) = 0;

#now hangs when it was solved before in 1.8 seconds
pde := diff(w(x,y),x)+((lambda+a*sin(lambda*x)^2)*y^2 + lambda -a +a*sin(lambda*x)^2)*diff(w(x,y),y) = 0;

Using windows 10.


How do I remove Array B from Array A? e.g.

B:=Array([3,6,9,12,15....])   assuming A contains all the elements of B.

to get [1,2,4,5,7,8,11....]

Also is it possible to do it in place?

.I am testing out the MutableSet command, There seems to be a problem with the number of emements that can be operated on. When N =100000 things are ok. When N=1000000 (or there abouts) the process doesn't terminate last line. Uorks ok for sets. Using Maple 2018.2 on Win10 64bit.



N := 900000



A := {seq(i^2, i = 1 .. N)}

B := {seq(A[i+1]-A[i], i = 1 .. nops(A)-1)}



C := MutableSet(seq(i^2, i = 1 .. N))

module MutableSet () local storage; global MutableSet; option object; end module





MutableSet(seq(C[i+1]-C[i], i = 1 .. N-1))




Hello every one,

My slideshow now contains a lot of animation sequences and take
a very long time to load and a large amount of physical memory (>20GB).

To reduce this size I have decided to convert these animations to GIF format.
Unfortunatly Maple/MaplePayer do not play GIF animations.

I decide to put URLs (image icons pointing to GIF files) in the document.
Now the GIF are play by a WEB browser (program to operate in fullscreen 
mode to minimize any disturbance in the audience with IE11).

Now the issue:
Using F11 to start the Slideshow, cliking the URL start the browser with the requested
animated GIF, that is fine, but now Maple/MaplePayer both auto-exit fullscreen
mode just after that click. The speaker (me) now need to manage the return to
fullscreen (F11) at the current slide while
thinking about what i have to
say next.

Is there any trick to prevent auto-exit from fulls-screen mode in this situation?

Thank you for your help



Des suggestions de solutions? Merci.

A) a) Écrire une procédure qui produit une itération du calcul babylonien de la racine carrée d'un nombre positif k à partir     d'une première approximation x0 .

    Entrée: k , x0 .

    Sortie:  x1 = (x0+ k/x0)/2 .

b) En utilisant la procédure trouvée en a), en écrire une autre, qui prend en entrée un entier positif n en plus des entiers k   et x0 vus en a) et qui retourne en sortie n itérations du calcul babylonien de la racine carée de k.


Écrire une procédure récursive Maple qui prend en entrée deux nombres n et k et qui utilise l'identité (n k) = (n -1k)+(n-1 k-1) pour retourner en sortie le coefficient binomial (n k) , cette procédure ne doit pas utiliser la commande Maple binomial.


Suggestions for solutions? Thank you.

A) a) Write a procedure that produces an iteration of the Babylonian calculus of the square root of a positive number k from a     first approximation x0.

    Input: k, x0.

   Output: x1 = (x0 + k / x0) / 2.

b) Using the procedure found in a), write another one, which takes as input a positive integer n in addition to the integers k and   x0 seen in a) and which returns in exit n iterations of the Babylonian calculation of the square root of k.

B) Write a Maple recursive procedure that takes as input two numbers n and k and uses the identity (n k) = (n-1 k)+ (n-1 k-1) to   return the binomial coefficient (n k), this procedure should not use the binomial Maple command.

Hi , how we can read the fractional differential equations in maple with out solving . I means just read and determine which is the order of fractional differential equations.


Hello everyone!

In previous versions of Maple (e.g. Maple 2016) it used to be possible to use scaletorange and colorscheme options together as in:

densityplot(sin(x+y), x = -1 .. 1, y = -1 .. 1, colorscheme = [black, red, yellow, white], scaletorange = -.5 .. .5);

But Maple 2018 returns an error:

Error, (in plots/densityplot) the scaletorange option cannot be used with the colorscheme option

Why is that and can one work around this error in any simple way?

  Y'a t-il des suggestion de résolution de ce qui suit? merci.

a) On pose F(-1,0) et F`(1,0) les foyers de l'ellipse E, on veut déterminer son équation implicite f(x,y)=0, 
    des points A(x,y) sur l’ellipse en utilisant la description bifocale et sans utiliser Maple.
  b) Utilisez la commande implicitplot de Maple et le résultat de a) pour tracer plusieurs ellipses sur
    le même graphe en variant la valeur de la constante C,(la somme des distances aux foyers F, F’ est
une constante qui est C).


  a) We put F (-1,0) and F` (1,0) the foci of the ellipse E, we want to determine its implicit equation f (x, y) = 0,
     A (x, y) points on the ellipse using the bifocal description and without using Maple.
  b) Use the command implicitplot of Maple and the result of a) to draw several ellipses on
     the same graph by varying the value of the constant C, ( FA +F'A = C ). 

     Give at the end a Maple procedure that generates this ellipse.

with(plottools):F := proc (N) local a, b, L; L := NULL; L := sort([op({seq(seq(a/b, a = 0 .. b), b = 1 .. N)})]); return L end proc; F(6);
            [   1  1  1  1  2  1  3  2  3  4  5   ]
            [0, -, -, -, -, -, -, -, -, -, -, -, 1]
            [   6  5  4  3  5  2  5  3  4  5  6   ]
Ford6 := proc (i) local d, k, n, r; k := i; n := numer(F(6)[k]); d := denom(F(6)[k]); r := (1/2)/d^2; return [n/d, r], r end proc; nops(F(6));
for i to 13 do C || i := Ford6(i) end do;

display(circle(C1), circle(C2), circle(C3), circle(C4), circle(C5), circle(C6), circle(C7), circle(C8), circle(C9), circle(C10), circle(C11), circle(C12), circle(C13), axes = normal, scaling = constrained, color = blue, size = [800, 800]);

3 4 5 6 7 8 9 Last Page 5 of 35