Maple 2018 Questions and Posts

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

Dear sir, I hereby request you to suggest an appropriate method to plot phase portrait sketches for the above cited subject

in 2D and 3D for the problem  

 

 

With thanks and regards.

 

Mr M ANAND

Associate Profesoor in Mathematics.

This question is related to an answer I gave here:
So, please look at a simple worksheet containing only a few lines; the resuts are in the # comments.

restart;
evalf(frac(Pi^20));

#                              23.
restart;
printlevel:=40:
evalf(frac(Pi^20));

  ###  prinlevel stuff
#                              0.


And now the questions.
1. Why the first evalf(frac(Pi^20))  does not  call  `evalf/frac`?
     (the second does, trace(`evalf/frac`)  shows this  if inserted).
     Note that  `evalf/frac`(Pi^20)    returns  0.
2. Why evalf(frac(Pi^20))    depends on printlevel?
    Note that  if  printlevel is changed to 20 (say)  the result is again 23.
3. Why if we set interface(typesetting=standard)  in a fresh session
     the results are both 23?

 

I can't get a While do loop to work as expected.

For i from 2 while M[i,1]<>M[1,1] and i<25 do..   It doesn't catch row 15 where M[15,1] =M[1,1] but it does stop at i = 24 ok.
 

restart

``

M := Matrix(60, 3, {(1, 1) = Vector(2, {(1) = -3, (2) = 5}), (1, 2) = Vector(2, {(1) = -2, (2) = -2}), (1, 3) = Vector(2, {(1) = 0, (2) = 0}), (2, 1) = Vector(2, {(1) = -5, (2) = 3}), (2, 2) = Vector(2, {(1) = -1, (2) = -3}), (2, 3) = Vector(2, {(1) = 1, (2) = -1}), (3, 1) = Vector(2, {(1) = -6, (2) = 0}), (3, 2) = Vector(2, {(1) = 0, (2) = -3}), (3, 3) = Vector(2, {(1) = 1, (2) = 0}), (4, 1) = Vector(2, {(1) = -6, (2) = -3}), (4, 2) = Vector(2, {(1) = 1, (2) = -2}), (4, 3) = Vector(2, {(1) = 1, (2) = 1}), (5, 1) = Vector(2, {(1) = -5, (2) = -5}), (5, 2) = Vector(2, {(1) = 2, (2) = -1}), (5, 3) = Vector(2, {(1) = 1, (2) = 1}), (6, 1) = Vector(2, {(1) = -3, (2) = -6}), (6, 2) = Vector(2, {(1) = 3, (2) = 0}), (6, 3) = Vector(2, {(1) = 1, (2) = 1}), (7, 1) = Vector(2, {(1) = 0, (2) = -6}), (7, 2) = Vector(2, {(1) = 3, (2) = 1}), (7, 3) = Vector(2, {(1) = 0, (2) = 1}), (8, 1) = Vector(2, {(1) = 3, (2) = -5}), (8, 2) = Vector(2, {(1) = 2, (2) = 2}), (8, 3) = Vector(2, {(1) = -1, (2) = 1}), (9, 1) = Vector(2, {(1) = 5, (2) = -3}), (9, 2) = Vector(2, {(1) = 1, (2) = 3}), (9, 3) = Vector(2, {(1) = -1, (2) = 1}), (10, 1) = Vector(2, {(1) = 6, (2) = 0}), (10, 2) = Vector(2, {(1) = 0, (2) = 3}), (10, 3) = Vector(2, {(1) = -1, (2) = 0}), (11, 1) = Vector(2, {(1) = 6, (2) = 3}), (11, 2) = Vector(2, {(1) = -1, (2) = 2}), (11, 3) = Vector(2, {(1) = -1, (2) = -1}), (12, 1) = Vector(2, {(1) = 5, (2) = 5}), (12, 2) = Vector(2, {(1) = -2, (2) = 1}), (12, 3) = Vector(2, {(1) = -1, (2) = -1}), (13, 1) = Vector(2, {(1) = 3, (2) = 6}), (13, 2) = Vector(2, {(1) = -3, (2) = 0}), (13, 3) = Vector(2, {(1) = -1, (2) = -1}), (14, 1) = Vector(2, {(1) = 0, (2) = 6}), (14, 2) = Vector(2, {(1) = -3, (2) = -1}), (14, 3) = Vector(2, {(1) = 0, (2) = -1}), (15, 1) = Vector(2, {(1) = -3, (2) = 5}), (15, 2) = Vector(2, {(1) = -2, (2) = -2}), (15, 3) = Vector(2, {(1) = 1, (2) = -1}), (16, 1) = Vector(2, {(1) = -5, (2) = 3}), (16, 2) = Vector(2, {(1) = -1, (2) = -3}), (16, 3) = Vector(2, {(1) = 1, (2) = -1}), (17, 1) = Vector(2, {(1) = -6, (2) = 0}), (17, 2) = Vector(2, {(1) = 0, (2) = -3}), (17, 3) = Vector(2, {(1) = 1, (2) = 0}), (18, 1) = Vector(2, {(1) = -6, (2) = -3}), (18, 2) = Vector(2, {(1) = 1, (2) = -2}), (18, 3) = Vector(2, {(1) = 1, (2) = 1}), (19, 1) = Vector(2, {(1) = -5, (2) = -5}), (19, 2) = Vector(2, {(1) = 2, (2) = -1}), (19, 3) = Vector(2, {(1) = 1, (2) = 1}), (20, 1) = Vector(2, {(1) = -3, (2) = -6}), (20, 2) = Vector(2, {(1) = 3, (2) = 0}), (20, 3) = Vector(2, {(1) = 1, (2) = 1}), (21, 1) = Vector(2, {(1) = 0, (2) = -6}), (21, 2) = Vector(2, {(1) = 3, (2) = 1}), (21, 3) = Vector(2, {(1) = 0, (2) = 1}), (22, 1) = Vector(2, {(1) = 3, (2) = -5}), (22, 2) = Vector(2, {(1) = 2, (2) = 2}), (22, 3) = Vector(2, {(1) = -1, (2) = 1}), (23, 1) = Vector(2, {(1) = 5, (2) = -3}), (23, 2) = Vector(2, {(1) = 1, (2) = 3}), (23, 3) = Vector(2, {(1) = -1, (2) = 1}), (24, 1) = Vector(2, {(1) = 6, (2) = 0}), (24, 2) = Vector(2, {(1) = 0, (2) = 3}), (24, 3) = Vector(2, {(1) = -1, (2) = 0}), (25, 1) = Vector(2, {(1) = 6, (2) = 3}), (25, 2) = Vector(2, {(1) = -1, (2) = 2}), (25, 3) = Vector(2, {(1) = -1, (2) = -1}), (26, 1) = Vector(2, {(1) = 5, (2) = 5}), (26, 2) = Vector(2, {(1) = -2, (2) = 1}), (26, 3) = Vector(2, {(1) = -1, (2) = -1}), (27, 1) = Vector(2, {(1) = 3, (2) = 6}), (27, 2) = Vector(2, {(1) = -3, (2) = 0}), (27, 3) = Vector(2, {(1) = -1, (2) = -1}), (28, 1) = Vector(2, {(1) = 0, (2) = 6}), (28, 2) = Vector(2, {(1) = -3, (2) = -1}), (28, 3) = Vector(2, {(1) = 0, (2) = -1}), (29, 1) = Vector(2, {(1) = -3, (2) = 5}), (29, 2) = Vector(2, {(1) = -2, (2) = -2}), (29, 3) = Vector(2, {(1) = 1, (2) = -1}), (30, 1) = Vector(2, {(1) = -5, (2) = 3}), (30, 2) = Vector(2, {(1) = -1, (2) = -3}), (30, 3) = Vector(2, {(1) = 1, (2) = -1}), (31, 1) = Vector(2, {(1) = -6, (2) = 0}), (31, 2) = Vector(2, {(1) = 0, (2) = -3}), (31, 3) = Vector(2, {(1) = 1, (2) = 0}), (32, 1) = Vector(2, {(1) = -6, (2) = -3}), (32, 2) = Vector(2, {(1) = 1, (2) = -2}), (32, 3) = Vector(2, {(1) = 1, (2) = 1}), (33, 1) = Vector(2, {(1) = -5, (2) = -5}), (33, 2) = Vector(2, {(1) = 2, (2) = -1}), (33, 3) = Vector(2, {(1) = 1, (2) = 1}), (34, 1) = Vector(2, {(1) = -3, (2) = -6}), (34, 2) = Vector(2, {(1) = 3, (2) = 0}), (34, 3) = Vector(2, {(1) = 1, (2) = 1}), (35, 1) = Vector(2, {(1) = 0, (2) = -6}), (35, 2) = Vector(2, {(1) = 3, (2) = 1}), (35, 3) = Vector(2, {(1) = 0, (2) = 1}), (36, 1) = Vector(2, {(1) = 3, (2) = -5}), (36, 2) = Vector(2, {(1) = 2, (2) = 2}), (36, 3) = Vector(2, {(1) = -1, (2) = 1}), (37, 1) = Vector(2, {(1) = 5, (2) = -3}), (37, 2) = Vector(2, {(1) = 1, (2) = 3}), (37, 3) = Vector(2, {(1) = -1, (2) = 1}), (38, 1) = Vector(2, {(1) = 6, (2) = 0}), (38, 2) = Vector(2, {(1) = 0, (2) = 3}), (38, 3) = Vector(2, {(1) = -1, (2) = 0}), (39, 1) = Vector(2, {(1) = 6, (2) = 3}), (39, 2) = Vector(2, {(1) = -1, (2) = 2}), (39, 3) = Vector(2, {(1) = -1, (2) = -1}), (40, 1) = Vector(2, {(1) = 5, (2) = 5}), (40, 2) = Vector(2, {(1) = -2, (2) = 1}), (40, 3) = Vector(2, {(1) = -1, (2) = -1}), (41, 1) = Vector(2, {(1) = 3, (2) = 6}), (41, 2) = Vector(2, {(1) = -3, (2) = 0}), (41, 3) = Vector(2, {(1) = -1, (2) = -1}), (42, 1) = Vector(2, {(1) = 0, (2) = 6}), (42, 2) = Vector(2, {(1) = -3, (2) = -1}), (42, 3) = Vector(2, {(1) = 0, (2) = -1}), (43, 1) = Vector(2, {(1) = -3, (2) = 5}), (43, 2) = Vector(2, {(1) = -2, (2) = -2}), (43, 3) = Vector(2, {(1) = 1, (2) = -1}), (44, 1) = Vector(2, {(1) = -5, (2) = 3}), (44, 2) = Vector(2, {(1) = -1, (2) = -3}), (44, 3) = Vector(2, {(1) = 1, (2) = -1}), (45, 1) = Vector(2, {(1) = -6, (2) = 0}), (45, 2) = Vector(2, {(1) = 0, (2) = -3}), (45, 3) = Vector(2, {(1) = 1, (2) = 0}), (46, 1) = Vector(2, {(1) = -6, (2) = -3}), (46, 2) = Vector(2, {(1) = 1, (2) = -2}), (46, 3) = Vector(2, {(1) = 1, (2) = 1}), (47, 1) = Vector(2, {(1) = -5, (2) = -5}), (47, 2) = Vector(2, {(1) = 2, (2) = -1}), (47, 3) = Vector(2, {(1) = 1, (2) = 1}), (48, 1) = Vector(2, {(1) = -3, (2) = -6}), (48, 2) = Vector(2, {(1) = 3, (2) = 0}), (48, 3) = Vector(2, {(1) = 1, (2) = 1}), (49, 1) = Vector(2, {(1) = 0, (2) = -6}), (49, 2) = Vector(2, {(1) = 3, (2) = 1}), (49, 3) = Vector(2, {(1) = 0, (2) = 1}), (50, 1) = Vector(2, {(1) = 3, (2) = -5}), (50, 2) = Vector(2, {(1) = 2, (2) = 2}), (50, 3) = Vector(2, {(1) = -1, (2) = 1}), (51, 1) = Vector(2, {(1) = 5, (2) = -3}), (51, 2) = Vector(2, {(1) = 1, (2) = 3}), (51, 3) = Vector(2, {(1) = -1, (2) = 1}), (52, 1) = Vector(2, {(1) = 6, (2) = 0}), (52, 2) = Vector(2, {(1) = 0, (2) = 3}), (52, 3) = Vector(2, {(1) = -1, (2) = 0}), (53, 1) = Vector(2, {(1) = 6, (2) = 3}), (53, 2) = Vector(2, {(1) = -1, (2) = 2}), (53, 3) = Vector(2, {(1) = -1, (2) = -1}), (54, 1) = Vector(2, {(1) = 5, (2) = 5}), (54, 2) = Vector(2, {(1) = -2, (2) = 1}), (54, 3) = Vector(2, {(1) = -1, (2) = -1}), (55, 1) = Vector(2, {(1) = 3, (2) = 6}), (55, 2) = Vector(2, {(1) = -3, (2) = 0}), (55, 3) = Vector(2, {(1) = -1, (2) = -1}), (56, 1) = Vector(2, {(1) = 0, (2) = 6}), (56, 2) = Vector(2, {(1) = -3, (2) = -1}), (56, 3) = Vector(2, {(1) = 0, (2) = -1}), (57, 1) = Vector(2, {(1) = -3, (2) = 5}), (57, 2) = Vector(2, {(1) = -2, (2) = -2}), (57, 3) = Vector(2, {(1) = 1, (2) = -1}), (58, 1) = Vector(2, {(1) = -5, (2) = 3}), (58, 2) = Vector(2, {(1) = -1, (2) = -3}), (58, 3) = Vector(2, {(1) = 1, (2) = -1}), (59, 1) = Vector(2, {(1) = -6, (2) = 0}), (59, 2) = Vector(2, {(1) = 0, (2) = -3}), (59, 3) = Vector(2, {(1) = 1, (2) = 0}), (60, 1) = Vector(2, {(1) = -6, (2) = -3}), (60, 2) = Vector(2, {(1) = 1, (2) = -2}), (60, 3) = Vector(2, {(1) = 1, (2) = 1})})

M := Matrix(60, 3, {(1, 1) = Vector(2, {(1) = -3, (2) = 5}), (1, 2) = Vector(2, {(1) = -2, (2) = -2}), (1, 3) = Vector(2, {(1) = 0, (2) = 0}), (2, 1) = Vector(2, {(1) = -5, (2) = 3}), (2, 2) = Vector(2, {(1) = -1, (2) = -3}), (2, 3) = Vector(2, {(1) = 1, (2) = -1}), (3, 1) = Vector(2, {(1) = -6, (2) = 0}), (3, 2) = Vector(2, {(1) = 0, (2) = -3}), (3, 3) = Vector(2, {(1) = 1, (2) = 0}), (4, 1) = Vector(2, {(1) = -6, (2) = -3}), (4, 2) = Vector(2, {(1) = 1, (2) = -2}), (4, 3) = Vector(2, {(1) = 1, (2) = 1}), (5, 1) = Vector(2, {(1) = -5, (2) = -5}), (5, 2) = Vector(2, {(1) = 2, (2) = -1}), (5, 3) = Vector(2, {(1) = 1, (2) = 1}), (6, 1) = Vector(2, {(1) = -3, (2) = -6}), (6, 2) = Vector(2, {(1) = 3, (2) = 0}), (6, 3) = Vector(2, {(1) = 1, (2) = 1}), (7, 1) = Vector(2, {(1) = 0, (2) = -6}), (7, 2) = Vector(2, {(1) = 3, (2) = 1}), (7, 3) = Vector(2, {(1) = 0, (2) = 1}), (8, 1) = Vector(2, {(1) = 3, (2) = -5}), (8, 2) = Vector(2, {(1) = 2, (2) = 2}), (8, 3) = Vector(2, {(1) = -1, (2) = 1}), (9, 1) = Vector(2, {(1) = 5, (2) = -3}), (9, 2) = Vector(2, {(1) = 1, (2) = 3}), (9, 3) = Vector(2, {(1) = -1, (2) = 1}), (10, 1) = Vector(2, {(1) = 6, (2) = 0}), (10, 2) = Vector(2, {(1) = 0, (2) = 3}), (10, 3) = Vector(2, {(1) = -1, (2) = 0}), (11, 1) = Vector(2, {(1) = 6, (2) = 3}), (11, 2) = Vector(2, {(1) = -1, (2) = 2}), (11, 3) = Vector(2, {(1) = -1, (2) = -1}), (12, 1) = Vector(2, {(1) = 5, (2) = 5}), (12, 2) = Vector(2, {(1) = -2, (2) = 1}), (12, 3) = Vector(2, {(1) = -1, (2) = -1}), (13, 1) = Vector(2, {(1) = 3, (2) = 6}), (13, 2) = Vector(2, {(1) = -3, (2) = 0}), (13, 3) = Vector(2, {(1) = -1, (2) = -1}), (14, 1) = Vector(2, {(1) = 0, (2) = 6}), (14, 2) = Vector(2, {(1) = -3, (2) = -1}), (14, 3) = Vector(2, {(1) = 0, (2) = -1}), (15, 1) = Vector(2, {(1) = -3, (2) = 5}), (15, 2) = Vector(2, {(1) = -2, (2) = -2}), (15, 3) = Vector(2, {(1) = 1, (2) = -1}), (16, 1) = Vector(2, {(1) = -5, (2) = 3}), (16, 2) = Vector(2, {(1) = -1, (2) = -3}), (16, 3) = Vector(2, {(1) = 1, (2) = -1}), (17, 1) = Vector(2, {(1) = -6, (2) = 0}), (17, 2) = Vector(2, {(1) = 0, (2) = -3}), (17, 3) = Vector(2, {(1) = 1, (2) = 0}), (18, 1) = Vector(2, {(1) = -6, (2) = -3}), (18, 2) = Vector(2, {(1) = 1, (2) = -2}), (18, 3) = Vector(2, {(1) = 1, (2) = 1}), (19, 1) = Vector(2, {(1) = -5, (2) = -5}), (19, 2) = Vector(2, {(1) = 2, (2) = -1}), (19, 3) = Vector(2, {(1) = 1, (2) = 1}), (20, 1) = Vector(2, {(1) = -3, (2) = -6}), (20, 2) = Vector(2, {(1) = 3, (2) = 0}), (20, 3) = Vector(2, {(1) = 1, (2) = 1}), (21, 1) = Vector(2, {(1) = 0, (2) = -6}), (21, 2) = Vector(2, {(1) = 3, (2) = 1}), (21, 3) = Vector(2, {(1) = 0, (2) = 1}), (22, 1) = Vector(2, {(1) = 3, (2) = -5}), (22, 2) = Vector(2, {(1) = 2, (2) = 2}), (22, 3) = Vector(2, {(1) = -1, (2) = 1}), (23, 1) = Vector(2, {(1) = 5, (2) = -3}), (23, 2) = Vector(2, {(1) = 1, (2) = 3}), (23, 3) = Vector(2, {(1) = -1, (2) = 1}), (24, 1) = Vector(2, {(1) = 6, (2) = 0}), (24, 2) = Vector(2, {(1) = 0, (2) = 3}), (24, 3) = Vector(2, {(1) = -1, (2) = 0}), (25, 1) = Vector(2, {(1) = 6, (2) = 3}), (25, 2) = Vector(2, {(1) = -1, (2) = 2}), (25, 3) = Vector(2, {(1) = -1, (2) = -1}), (26, 1) = Vector(2, {(1) = 5, (2) = 5}), (26, 2) = Vector(2, {(1) = -2, (2) = 1}), (26, 3) = Vector(2, {(1) = -1, (2) = -1}), (27, 1) = Vector(2, {(1) = 3, (2) = 6}), (27, 2) = Vector(2, {(1) = -3, (2) = 0}), (27, 3) = Vector(2, {(1) = -1, (2) = -1}), (28, 1) = Vector(2, {(1) = 0, (2) = 6}), (28, 2) = Vector(2, {(1) = -3, (2) = -1}), (28, 3) = Vector(2, {(1) = 0, (2) = -1}), (29, 1) = Vector(2, {(1) = -3, (2) = 5}), (29, 2) = Vector(2, {(1) = -2, (2) = -2}), (29, 3) = Vector(2, {(1) = 1, (2) = -1}), (30, 1) = Vector(2, {(1) = -5, (2) = 3}), (30, 2) = Vector(2, {(1) = -1, (2) = -3}), (30, 3) = Vector(2, {(1) = 1, (2) = -1}), (31, 1) = Vector(2, {(1) = -6, (2) = 0}), (31, 2) = Vector(2, {(1) = 0, (2) = -3}), (31, 3) = Vector(2, {(1) = 1, (2) = 0}), (32, 1) = Vector(2, {(1) = -6, (2) = -3}), (32, 2) = Vector(2, {(1) = 1, (2) = -2}), (32, 3) = Vector(2, {(1) = 1, (2) = 1}), (33, 1) = Vector(2, {(1) = -5, (2) = -5}), (33, 2) = Vector(2, {(1) = 2, (2) = -1}), (33, 3) = Vector(2, {(1) = 1, (2) = 1}), (34, 1) = Vector(2, {(1) = -3, (2) = -6}), (34, 2) = Vector(2, {(1) = 3, (2) = 0}), (34, 3) = Vector(2, {(1) = 1, (2) = 1}), (35, 1) = Vector(2, {(1) = 0, (2) = -6}), (35, 2) = Vector(2, {(1) = 3, (2) = 1}), (35, 3) = Vector(2, {(1) = 0, (2) = 1}), (36, 1) = Vector(2, {(1) = 3, (2) = -5}), (36, 2) = Vector(2, {(1) = 2, (2) = 2}), (36, 3) = Vector(2, {(1) = -1, (2) = 1}), (37, 1) = Vector(2, {(1) = 5, (2) = -3}), (37, 2) = Vector(2, {(1) = 1, (2) = 3}), (37, 3) = Vector(2, {(1) = -1, (2) = 1}), (38, 1) = Vector(2, {(1) = 6, (2) = 0}), (38, 2) = Vector(2, {(1) = 0, (2) = 3}), (38, 3) = Vector(2, {(1) = -1, (2) = 0}), (39, 1) = Vector(2, {(1) = 6, (2) = 3}), (39, 2) = Vector(2, {(1) = -1, (2) = 2}), (39, 3) = Vector(2, {(1) = -1, (2) = -1}), (40, 1) = Vector(2, {(1) = 5, (2) = 5}), (40, 2) = Vector(2, {(1) = -2, (2) = 1}), (40, 3) = Vector(2, {(1) = -1, (2) = -1}), (41, 1) = Vector(2, {(1) = 3, (2) = 6}), (41, 2) = Vector(2, {(1) = -3, (2) = 0}), (41, 3) = Vector(2, {(1) = -1, (2) = -1}), (42, 1) = Vector(2, {(1) = 0, (2) = 6}), (42, 2) = Vector(2, {(1) = -3, (2) = -1}), (42, 3) = Vector(2, {(1) = 0, (2) = -1}), (43, 1) = Vector(2, {(1) = -3, (2) = 5}), (43, 2) = Vector(2, {(1) = -2, (2) = -2}), (43, 3) = Vector(2, {(1) = 1, (2) = -1}), (44, 1) = Vector(2, {(1) = -5, (2) = 3}), (44, 2) = Vector(2, {(1) = -1, (2) = -3}), (44, 3) = Vector(2, {(1) = 1, (2) = -1}), (45, 1) = Vector(2, {(1) = -6, (2) = 0}), (45, 2) = Vector(2, {(1) = 0, (2) = -3}), (45, 3) = Vector(2, {(1) = 1, (2) = 0}), (46, 1) = Vector(2, {(1) = -6, (2) = -3}), (46, 2) = Vector(2, {(1) = 1, (2) = -2}), (46, 3) = Vector(2, {(1) = 1, (2) = 1}), (47, 1) = Vector(2, {(1) = -5, (2) = -5}), (47, 2) = Vector(2, {(1) = 2, (2) = -1}), (47, 3) = Vector(2, {(1) = 1, (2) = 1}), (48, 1) = Vector(2, {(1) = -3, (2) = -6}), (48, 2) = Vector(2, {(1) = 3, (2) = 0}), (48, 3) = Vector(2, {(1) = 1, (2) = 1}), (49, 1) = Vector(2, {(1) = 0, (2) = -6}), (49, 2) = Vector(2, {(1) = 3, (2) = 1}), (49, 3) = Vector(2, {(1) = 0, (2) = 1}), (50, 1) = Vector(2, {(1) = 3, (2) = -5}), (50, 2) = Vector(2, {(1) = 2, (2) = 2}), (50, 3) = Vector(2, {(1) = -1, (2) = 1}), (51, 1) = Vector(2, {(1) = 5, (2) = -3}), (51, 2) = Vector(2, {(1) = 1, (2) = 3}), (51, 3) = Vector(2, {(1) = -1, (2) = 1}), (52, 1) = Vector(2, {(1) = 6, (2) = 0}), (52, 2) = Vector(2, {(1) = 0, (2) = 3}), (52, 3) = Vector(2, {(1) = -1, (2) = 0}), (53, 1) = Vector(2, {(1) = 6, (2) = 3}), (53, 2) = Vector(2, {(1) = -1, (2) = 2}), (53, 3) = Vector(2, {(1) = -1, (2) = -1}), (54, 1) = Vector(2, {(1) = 5, (2) = 5}), (54, 2) = Vector(2, {(1) = -2, (2) = 1}), (54, 3) = Vector(2, {(1) = -1, (2) = -1}), (55, 1) = Vector(2, {(1) = 3, (2) = 6}), (55, 2) = Vector(2, {(1) = -3, (2) = 0}), (55, 3) = Vector(2, {(1) = -1, (2) = -1}), (56, 1) = Vector(2, {(1) = 0, (2) = 6}), (56, 2) = Vector(2, {(1) = -3, (2) = -1}), (56, 3) = Vector(2, {(1) = 0, (2) = -1}), (57, 1) = Vector(2, {(1) = -3, (2) = 5}), (57, 2) = Vector(2, {(1) = -2, (2) = -2}), (57, 3) = Vector(2, {(1) = 1, (2) = -1}), (58, 1) = Vector(2, {(1) = -5, (2) = 3}), (58, 2) = Vector(2, {(1) = -1, (2) = -3}), (58, 3) = Vector(2, {(1) = 1, (2) = -1}), (59, 1) = Vector(2, {(1) = -6, (2) = 0}), (59, 2) = Vector(2, {(1) = 0, (2) = -3}), (59, 3) = Vector(2, {(1) = 1, (2) = 0}), (60, 1) = Vector(2, {(1) = -6, (2) = -3}), (60, 2) = Vector(2, {(1) = 1, (2) = -2}), (60, 3) = Vector(2, {(1) = 1, (2) = 1})})

(1)

M[1, 1]; for i from 2 while M[i, 1] <> M[1, 1] and i < 25 do print(i, M[i, 1]) end do

24, Vector[column](%id = 18446745366646139710)

(2)

``


 

Download Test_While_do_loop.mw


 

For Maple 2018.1, there are improvements in pdsolve's ability to solve PDE with boundary and initial conditions. This is work done together with E.S. Cheb-Terrab. The improvements include an extended ability to solve problems involving non-homogeneous PDE and/or non-homogeneous boundary and initial conditions, as well as improved simplification of solutions and better handling of functions such as piecewise in the arguments and in the processing of solutions. This is also an ongoing project, with updates being distributed regularly within the Physics Updates.

Solving more problems involving non-homogeneous PDE and/or non-homogeneous boundary and initial conditions

 

 

Example 1: Pinchover and Rubinstein's exercise 6.17: we have a non-homogenous PDE and boundary and initial conditions that are also non-homogeneous:

pde__1 := diff(u(x, t), t)-(diff(u(x, t), x, x)) = 1+x*cos(t)
iv__1 := (D[1](u))(0, t) = sin(t), (D[1](u))(1, t) = sin(t), u(x, 0) = 1+cos(2*Pi*x)

pdsolve([pde__1, iv__1])

u(x, t) = 1+cos(2*Pi*x)*exp(-4*Pi^2*t)+t+x*sin(t)

(1)

How we solve the problem, step by step:

   

 

Example 2: the PDE is homogeneous but the boundary conditions are not. We solve the problem through the same process, which means we end up solving a nonhomogeneous pde with homogeneous BC as an intermediate step:

pde__2 := diff(u(x, t), t) = 13*(diff(u(x, t), x, x))
iv__2 := (D[1](u))(0, t) = 0, (D[1](u))(1, t) = 1, u(x, 0) = (1/2)*x^2+x

pdsolve([pde__2, iv__2])

u(x, t) = 1/2+Sum(2*(-1+(-1)^n)*cos(n*Pi*x)*exp(-13*Pi^2*n^2*t)/(Pi^2*n^2), n = 1 .. infinity)+13*t+(1/2)*x^2

(12)

How we solve the problem, step by step:

   

 

Example 3: a wave PDE with a source that does not depend on time:

pde__3 := (diff(u(x, t), x, x))*a^2+1 = diff(u(x, t), t, t)
iv__3 := u(0, t) = 0, u(L, t) = 0, u(x, 0) = f(x), (D[2](u))(x, 0) = g(x)

`assuming`([pdsolve([pde__3, iv__3])], [L > 0])

u(x, t) = (1/2)*(2*(Sum(sin(n*Pi*x/L)*(2*L*(Int(sin(n*Pi*x/L)*g(x), x = 0 .. L))*sin(a*Pi*t*n/L)*a-Pi*(Int(sin(n*Pi*x/L)*(-2*f(x)*a^2+L*x-x^2), x = 0 .. L))*cos(a*Pi*t*n/L)*n)/(Pi*n*a^2*L), n = 1 .. infinity))*a^2+L*x-x^2)/a^2

(23)

How we solve the problem, step by step:

   

 

Example 4: Pinchover and Rubinstein's exercise 6.23 - we have a non-homogenous PDE and initial condition:

pde__4 := diff(u(x, t), t)-(diff(u(x, t), x, x)) = g(x, t)
iv__4 := (D[1](u))(0, t) = 0, (D[1](u))(1, t) = 0, u(x, 0) = f(x)

pdsolve([pde__4, iv__4], u(x, t))

u(x, t) = Int(f(tau1), tau1 = 0 .. 1)+Sum(2*(Int(f(tau1)*cos(n*Pi*tau1), tau1 = 0 .. 1))*cos(n*Pi*x)*exp(-Pi^2*n^2*t), n = 1 .. infinity)+Int(Int(g(x, tau1), x = 0 .. 1)+Sum(2*(Int(g(x, tau1)*cos(n1*Pi*x), x = 0 .. 1))*cos(n1*Pi*x)*exp(-Pi^2*n1^2*(t-tau1)), n1 = 1 .. infinity), tau1 = 0 .. t)

(30)

If we now make the functions f and g into specific mappings, we can compare pdsolve's solutions to the general and specific problems:

f := proc (x) options operator, arrow; 3*cos(42*x*Pi) end proc
g := proc (x, t) options operator, arrow; exp(3*t)*cos(17*x*Pi) end proc

 

Here is what pdsolve's solution to the general problem looks like when taking into account the new values of f(x) and g(x,t):

value(simplify(evalindets(u(x, t) = Int(f(tau1), tau1 = 0 .. 1)+Sum(2*(Int(f(tau1)*cos(n*Pi*tau1), tau1 = 0 .. 1))*cos(n*Pi*x)*exp(-Pi^2*n^2*t), n = 1 .. infinity)+Int(Int(g(x, tau1), x = 0 .. 1)+Sum(2*(Int(g(x, tau1)*cos(n1*Pi*x), x = 0 .. 1))*cos(n1*Pi*x)*exp(-Pi^2*n1^2*(t-tau1)), n1 = 1 .. infinity), tau1 = 0 .. t), specfunc(Int), proc (u) options operator, arrow; `PDEtools/int`(op(u), AllSolutions) end proc)))

u(x, t) = 3*cos(42*Pi*x)*exp(-1764*Pi^2*t)+cos(Pi*x)*(65536*cos(Pi*x)^16-278528*cos(Pi*x)^14+487424*cos(Pi*x)^12-452608*cos(Pi*x)^10+239360*cos(Pi*x)^8-71808*cos(Pi*x)^6+11424*cos(Pi*x)^4-816*cos(Pi*x)^2+17)*(exp(289*Pi^2*t+3*t)-1)*exp(-289*Pi^2*t)/(289*Pi^2+3)

(31)

 

Here is pdsolve's solution to the specific problem:

pdsolve([pde__4, iv__4], u(x, t))

u(x, t) = ((867*Pi^2+9)*cos(42*Pi*x)*exp(-1764*Pi^2*t)+cos(17*Pi*x)*(exp(3*t)-exp(-289*Pi^2*t)))/(289*Pi^2+3)

(32)

 

And the two solutions are equal:

simplify(combine((u(x, t) = 3*cos(42*x*Pi)*exp(-1764*Pi^2*t)+cos(x*Pi)*(65536*cos(x*Pi)^16-278528*cos(x*Pi)^14+487424*cos(x*Pi)^12-452608*cos(x*Pi)^10+239360*cos(x*Pi)^8-71808*cos(x*Pi)^6+11424*cos(x*Pi)^4-816*cos(x*Pi)^2+17)*(exp(289*Pi^2*t+3*t)-1)*exp(-289*Pi^2*t)/(289*Pi^2+3))-(u(x, t) = ((867*Pi^2+9)*cos(42*x*Pi)*exp(-1764*Pi^2*t)+cos(17*x*Pi)*(exp(3*t)-exp(-289*Pi^2*t)))/(289*Pi^2+3)), trig))

0 = 0

(33)

f := 'f'; g := 'g'

 

Improved simplification in integrals, piecewise functions, and sums in the solutions returned by pdsolve

 

 

Example 1: exercise 6.21 from Pinchover and Rubinstein is a non-homogeneous heat problem. Its solution used to include unevaluated integrals and sums, but is now returned in a significantly simpler format.

pde__5 := diff(u(x, t), t)-(diff(u(x, t), x, x)) = t*cos(2001*x)
iv__5 := (D[1](u))(0, t) = 0, (D[1](u))(Pi, t) = 0, u(x, 0) = Pi*cos(2*x)

pdsolve([pde__5, iv__5])

u(x, t) = (1/16032024008001)*(4004001*t+exp(-4004001*t)-1)*cos(2001*x)+Pi*cos(2*x)*exp(-4*t)

(34)

pdetest(%, [pde__5, iv__5])

[0, 0, 0, 0]

(35)

 

Example 2: example 6.46 from Pinchover and Rubinstein is a non-homogeneous heat equation with non-homogeneous boundary and initial conditions. Its solution used to involve two separate sums with unevaluated integrals, but is now returned with only one sum and unevaluated integral.

pde__6 := diff(u(x, t), t)-(diff(u(x, t), x, x)) = exp(-t)*sin(3*x)
iv__6 := u(0, t) = 0, u(Pi, t) = 1, u(x, 0) = phi(x)

pdsolve([pde__6, iv__6], u(x, t))

u(x, t) = (1/8)*(8*(Sum(2*(Int(-(-phi(x)*Pi+x)*sin(n*x), x = 0 .. Pi))*sin(n*x)*exp(-n^2*t)/Pi^2, n = 1 .. infinity))*Pi-Pi*(exp(-9*t)-exp(-t))*sin(3*x)+8*x)/Pi

(36)

pdetest(%, [pde__6, iv__6])

[0, 0, 0, (-phi(x)*Pi^2+Pi*x+2*(Sum((Int(-(-phi(x)*Pi+x)*sin(n*x), x = 0 .. Pi))*sin(n*x), n = 1 .. infinity)))/Pi^2]

(37)

 

More accuracy when returning series solutions that have exceptions for certain values of the summation index or a parameter

 

 

Example 1: the answer to this problem was previously given with n = 0 .. infinity instead of n = 1 .. infinity as it should be:

pde__7 := diff(v(x, t), t, t)-(diff(v(x, t), x, x))

iv__7 := v(0, t) = 0, v(x, 0) = -(exp(2)*x-exp(x+1)-x+exp(1-x))/(exp(2)-1), (D[2](v))(x, 0) = 1+(exp(2)*x-exp(x+1)-x+exp(1-x))/(exp(2)-1), v(1, t) = 0

pdsolve([pde__7, iv__7])

v(x, t) = Sum(-2*sin(n*Pi*x)*((Pi^2*(-1)^n*n^2-Pi^2*n^2+2*(-1)^n-1)*sin(Pi*t*n)-(-1)^n*cos(Pi*t*n)*Pi*n)/(Pi^2*n^2*(Pi^2*n^2+1)), n = 1 .. infinity)

(38)

 

Example 2: the answer to exercise 6.25 from Pinchover and Rubinstein is now given in a much simpler format, with the special limit case for w = 0 calculated separately:

pde__8 := diff(u(x, t), t) = k*(diff(u(x, t), x, x))+cos(w*t)
iv__8 := (D[1](u))(L, t) = 0, (D[1](u))(0, t) = 0, u(x, 0) = x

`assuming`([pdsolve([pde__8, iv__8], u(x, t))], [L > 0])

u(x, t) = piecewise(w = 0, (1/2)*L+Sum(2*L*(-1+(-1)^n)*cos(n*Pi*x/L)*exp(-Pi^2*n^2*k*t/L^2)/(n^2*Pi^2), n = 1 .. infinity)+t, (1/2)*(L*w+2*(Sum(2*L*(-1+(-1)^n)*cos(n*Pi*x/L)*exp(-Pi^2*n^2*k*t/L^2)/(n^2*Pi^2), n = 1 .. infinity))*w+2*sin(w*t))/w)

(39)

 

Improved handling of piecewise, eval/diff in the given problem

 

 

Example 1: this problem, which contains a piecewise function in the initial condition, can now be solved:

pde__9 := diff(f(x, t), t) = diff(f(x, t), x, x)
iv__9 := f(0, t) = 0, f(1, t) = 1, f(x, 0) = piecewise(x = 0, 0, 1)

pdsolve([pde__9, iv__9])

f(x, t) = Sum(2*sin(n*Pi*x)*exp(-Pi^2*n^2*t)/(n*Pi), n = 1 .. infinity)+x

(40)

 

Example 2: this problem, which contains a derivative written using eval/diff, can now be solved:

pde__10 := -(diff(u(x, t), t, t))-(diff(u(x, t), x, x))+u(x, t) = 2*exp(-t)*(x-(1/2)*x^2+(1/2)*t-1)

iv__10 := u(x, 0) = x^2-2*x, u(x, 1) = u(x, 1/2)+((1/2)*x^2-x)*exp(-1)-((3/4)*x^2-(3/2)*x)*exp(-1/2), u(0, t) = 0, eval(diff(u(x, t), x), {x = 1}) = 0

pdsolve([pde__10, iv__10], u(x, t))

u(x, t) = -(1/2)*exp(-t)*x*(x-2)*(t-2)

(41)

 

References:

 

Pinchover, Y. and Rubinstein, J.. An Introduction to Partial Differential Equations. Cambridge UP, 2005.


 

Download What_is_New_after_Maple_2018.mw

Katherina von Bülow

Hello Friends

I have a critical problem that I wish to solve it with maple

suppose we have a list like following: y_obs=(2,4,8,7,9,52,35,478,52) and corresponding variance σy=(.2,.3,.5,.87,.1.2,.22,.78,.99,1.5)
we know y as the function of x described such as y_theoric=x+p and minimizing X is

X=Sigma [(y_theoric-y_obs)^2]/σy which includes the sum of nine numbers...

the question is:

How we can find p from likelihood function and plot general behavior of y versus of x through two above series?

for example this solution used in article under the names Hubble parameter data constraints on dark energy by Yun Chen and Bhatra Ratra (Physics Letters B)

Thank you

 

I mean 

restart;
 plots:-implicitplot(sqrt(b)*sqrt(1-4*p/b)-2*arctan(sqrt((9*p/b-22201/10000)/(9/4-9*p/b))) = 0, b = 0 .. 5,
 p = 0 .. 5, gridrefine = 2, rational);

I find the above result unsatisfactory.

Hello,

     I have a very large expression I'm tring to average (by doing limit(1/L*int(<expr>,t=-L..L),L=infinty) ). However, given that this expression is so large (sum of 11k terms), I'm was looking for ways to speed up the calculation and use less RAM.

     I found that applying the lim@int seperately to each term of the sum helps. Also, since my integrand has various functions of other variables (eg. f(x), g(y), etc), Maple seems to go faster if I freeze those functions using frontend.

     However, the problem I'm running into is that, as I'm running through my for-loop to apply lim@int to each term, Maple starts running slower and slower, as well as taking more and more RAM. Additionally, it doesn't go to completion because it runs out of stack space.

     Is there an optimization trick to avoid this problem? I've tried garbage collecting after each iteration; that helps the RAM problem (at a cost of speed), but it still slows down over time.

      I've attached my code: MWE.maple. Fair warning: on a non-server computer, it is liable to run very slow.

Is it possible to convert E1(x) to Ei(x) explicitly?

In particular I have this expression which is real, but imaginary numbers appear due to the definition of Ei1 for negative arguments.

(-exp(j*z)*Ei(1, j*z)+I*Pi*exp(-j*z)+exp(-j*z)*Ei(1, -j*z))/(2*j)

 

j>0,z>0

 

Thank you

The procedure F computes the smallest prime factor of  ithprime(n)-2

F := n -> ifactors((ithprime(n)-2))[2][1][1]:

F(11);
                               29
Strangely, print(F)  must be interrupted!
print(F);
Warning,  computation interrupted
 
Also,

F := n -> ifactors((ithprime(n)-2))[2][1][1];

Warning,  computation interrupted
Warning,  computation interrupted

(F is defined, only the display fails).
This happens only for interface(typesetting=extended).
In Maple 2017 it was OK.

 

how I can remove this error.

Error, numeric exception: division by zero

code2.mw

Hello,

      I was trying to apply some assumptions to a pdsolve command and noticed a strange error. Here's a minimal working example.

restart():

pdsolve(diff(f(t,x),t) = 0, {f(t,x)}, ivars = {x, t}) assuming x::real:

returns

Error, (in simpl/relopsum) invalid terms in sum: diff(f(t,x),t) = 0

Is this indeed a bug, or is it expected behavior?

We have released an update to Maple, Maple 2018.1. This release provides enhancements to the mathematical computation engine, including physics and DEs.  It also provides substantial improvements to the command line version, easier access to group management tools in the MapleCloud, and a few other interface improvements.

This update is available through Tools>Check for Updates in Maple, and is also available from our website on the Maple 2018.1 download page, where you can also find more details.

please see maple attachment below.

btw, what i'm really trying to do is represent spin 1/2 states, along with the usual spin operators, and be able to take tensor products of the spin states. any hints on how to do that would be greatly appreciated. 

btw, the physics package is amazing! 

thanks, 

larry

bug.mw

 

One of the frustrating things I am finding in using Maple debugger is that I can't set breakpoint using stopat() at some line number in some inner module, if the inner module is local module. It has to be an exported module.

Here is an example

restart;
foo:=module()
   export main_entry;
   local foo1; #inner module. But if local, Can't set breakpoint from outside

   foo1:=module()
     export main_entry;
     local foo2;

     foo2:=proc() #or breakpoint in first line here
        local s,x;
        s:=1;     #suppose I want to set break point here
        s:=s+sin(x);
     end proc;
     
     main_entry:=proc()         
        foo2();
     end proc;    
  end module;

  main_entry :=proc()
    foo1:-main_entry(); #call inner module's proc
  end proc;

end module;

Since there is inner module, local to outside module, I can't set break into the inner module procs anywhere.

stopat(foo:-foo1::foo2);
Error, module does not export `foo1`

A workaround for now is to change "local" to "export" on the inner modules declarations I want to debug, so I can setbreak points inside them, then when done, make them local again. So changed "local foo1" to "export foo1" above, and now

          stopat(foo:-foo1::foo2,2);

works.

This was also a little strange to me, since foo2() is a LOCAL proc to module foo1, yet Maple did not complain like it did when module foo1 was a LOCAL module to foo. I would have expected Maple to complain again for same reason.

So I am using the above workaround for now. But it is just a little annoying becuase I have to keep changing module from LOCAL to EXPORT in order to set breakpoints, then remember to make them local again.

Is there a better workaround?

A product suggestion: make stopat() ignore the local module setting and treat it as export for the purpose of setting a break point. This way one does not have to change the code just to set a breakpoint. Or if not to change current behavior, add a new option, as in

          stopat(........, option= ignore_local_setting)

So the default remain the same as now, but with the new option, it will set breakpoint anywhere, even in local modules.

 

Thank you

 

 

Hello, everyone! My name’s Sophie and I’m an intern at Maplesoft. @Samir Khan asked me to develop a couple of demonstration applications using the DeepLearning package - my work is featured on the Application Center

I thought I’d describe two critical commands used in the applications – DNNClassifier() and DNNRegressor().

The DNNClassifier calls tf.estimator.DNNClassifier from the Tensorflow Python API. This command builds a feedforward multilayer neural network that is trained with a set of labeled data in order to perform classification on similar, unlabeled data.

Dataset used for training and validating the classifier has the type DataFrame in Maple. In the Prediction of malignant/benign of breast mass example, the training set is a DataFrame with 32 columns in total, with column labels: “ID Number”, “Diagnosis”, “radius”, “texture”, etc. Note that labeling the columns of the dataset is mandatory, as later the neural network needs to identify which feature column corresponds to which list of values.

Feature columns are what come between the raw input data and the classifier model; they are required by Tensorflow to specify how the input data should be transformed before given to the model. Maple now supports three types of Feature Columns, including:

  • NumericColumn that represents real, numerical figure,
  • CategoricalColumn that denotes categorical(ordinal) data
  • BucketizedColumn that organizes continuous data into a discrete number buckets with specified boundaries.

In this application, the input data consists of 30 real, numeric values that represents physical traits of a cell nucleus computed from a digitized image of the breast mass. We create a list of NumericColumns by calling

with(DeepLearning):
fc := [seq(NumericColumn(u,shape=[1]), u in cols[3..])]:

where cols is a list of column labels and shape[1] indicates that each data input is just a single numeric value.

When we create a DNNClassifier, we need to specify the feature columns (input layer), the architecture of the neural network (hidden layers) and the number of classes (output layer). Recall that the DNNClassifier builds a feedforward multilayer neural network, hence when we call the function, we need to indicate how many hidden layers we want and how many nodes there should be on each of the layer. This is done by passing a list of non-negative integers as the parameter hidden_units when we call the function. In the example, we did:

classifier := DNNClassifier(fc, hidden_units=[20,40,20],num_classes=2):

where we set 3 hidden layer each with 20, 40, 20 nodes respectively. In addition, there are 30 input nodes (i.e. the number of feature columns) and 1 output node (i.e. binary classification). The diagram below illustrates a simpler example with an input layer with 3 nodes, 2 hidden layers with 7, 5 nodes and an output layer with 1 node.

(Created using NN-SVG by https://github.com/zfrenchee/NN-SVG)

After we built the model, we can train it by calling

classifier:-Train(train_data[3..32], train_data[2], steps = 256, num_epochs = 3, shuffle = true):

where we

  1. Give the training data (train_data[3..32]) and the corresponding labels (train_data[2]) to the model.
  2. Specified that the entire dataset will be passed to the model for three times and each iteration has 256 steps.
  3. Specified that data batches for training will be created by randomly shuffling the tensors.

Now the training process is complete, we can use the validation set to evaluate the effectiveness of our model.

classifier:-Evaluate(test_data[3..32],test_data[2], steps = 32);

The output indicates an accuracy of ~92.11% in this case. There are more indices like accuracy_basline, auc, average_loss that help us decide if we need to modify the architecture for better performance.

We then build a predictor function that takes an arbitrary set of measurements as a DataSeries and returns a prediction generated by the trained DNN classifier.

predictor := proc (ds) classifier:-Predict(Transpose(DataFrame(ds)), num_epochs = 1, shuffle = false)[1] end proc;

Now we can pass a DataSeries with 30 labeled rows to the predictor: (Recall the cols is a list of the column names)

ds := DataSeries([11.49, 14.59, 73.99, 404.9, 0.1046, 8.23E-02, 5.31E-02, 1.97E-02, 0.1779, 6.57E-02, 0.2034, 1.166, 1.567, 14.34, 4.96E-03, 2.11E-02, 4.16E-02, 8.04E-03, 1.84E-02, 3.61E-03, 12.4, 21.9, 82.04, 467.6, 0.1352, 0.201, 0.2596, 7.43E-02, 0.2941, 9.18E-02], labels = cols[3..]); 
predictor(ds);

The output indicates that the probability of this data being a class _id [0] is ~90.79%. In other words, according to our model, the probability of this breast mass cell being benign is ~90.79%.

The use of the DNNRegressor is very similar (almost identical) to that of the Classifier, the only significant difference is that while the Classifier predicts discrete labels as classes, the Regressor predicts a continuous qualitative result with the provided data (Note that CategoricalColumn is still applicable). For more details about the basic usage of the DNNRegressor, please refer to Predicting the burnt area of a forest fires with DNN Regressor.

 

First 33 34 35 36 37 38 39 Page 35 of 42