MaplePrimes Posts

MaplePrimes Posts are for sharing your experiences, techniques and opinions about Maple, MapleSim and related products, as well as general interests in math and computing.

Latest Post
  • Latest Posts Feed
  • Greetings to all.

    I would like to share a brief observation concerning my experiences with the Euler-Maclaurin summation routine in Maple 17 (X86 64 LINUX). The following Math StackExchange Link shows how to compute a certain Euler-MacLaurin type asymptotic expansion using highly unorthodox divergent series summation techniques. The result that was obtained matches the output from eulermac which is definitely good to know. What follows is the output from said routine.

    > eulermac(1/(1+k/n),k=0..n,18);
         1       929569        3202291        691                O(1)
    O(- ---) - ----------- + ----------- - --------- + 1/1048576 ----
         19             15            17          11              19
        n      2097152 n     1048576 n     32768 n               n
            174611      5461        31       |      1           17        1
         - -------- + --------- + ------- +  |   ------- dk - ------- + ------
                 19          13         9    |   1 + k/n            7        5
           6600 n     65536 n     4096 n    /                 4096 n    256 n
             1       1
         - ------ + ---- + 3/4
                3   16 n
           128 n

    While I realize that this is good enough for most purposes I have two minor issues.

    • One could certainly evaluate the integral without leaving it to the user to force evaluation with the AllSolutions option. One can and should make use of what is known about n and k. In particular one can check whether there are singularities on the integration path because we know the range of k/n.
    • Why are there two order terms for the order of the remainder term? There should be at most one and a coefficient times an O(1) term makes little sense as the coefficient would be absorbed.

    You might want to fix these so that the output looks a bit more professional which does enter into play when potential future users decide on what CAS to commit to. Other than that it is a very useful routine even for certain harmonic sum computations where one can use Euler-Maclaurin to verify results.

    Best regards,

    Marko Riedel


    It seems that


    Limit(N+(sum((-1)^n*Sum(1/n^x, x = 1 .. N), n = 1 .. infinity)), N = infinity)=log(2)

     evalf(300+sum((-1)^n*(Sum(1/n^x, x = 1 .. 300)), n = 1 .. infinity), 30)



     sum(1/n^x, x = 1 .. infinity)



    In Maple 18, the Database package has been updated to include support for SQlite databases as well as a new option for plots to change the background images on plots.  To showcase both of these features, our engineering team put together an example that optimizes the flight path of a pan-US delivery drone.

    This application extracts the latitude and longitude of those zip codes from an SQLlite database (the application includes the database, which cross-references US zip codes against their latitude, longitude, city and state). The application then performs a traveling salesman optimization and plots the shortest path on a map of the US.

    To download the application click here:

    This is a 5-days mini-course I gave in Brazil last week, at the CBPF (Brazilian Center for Physics Research). The material will still receive polishment and improvements, towards evolving into a sort of manual, but it is also interesting to see it exactly as it was presented to people during the course. This material uses the update of Physics available at the Maplesoft Physics R&D webpage.

    Mini-Course: Computer Algebra for Physicists


    Edgardo S. Cheb-Terrab




    This course is organized as a guided experience, 2 hours per day during five days, on learning the basics of the Maple language, and on using it to formulate algebraic computations we do in physics with paper and pencil. It is oriented to people not familiar with computer algebra (sections 1-5), as well as to people who are familiar but want to learn more about how to use it in Physics.





    Among other things, with computer algebra:



    You can concentrate more on the ideas (the model and its formulation) instead of on the algebraic manipulations


    You can extend your results with ease


    You can explore the mathematics surrounding your problem


    You can share your results in a reproducible way - and with that exchange about a problem in more productive ways


    After you learn the basics, the speed at which algebraic results are obtained with the computer compensates with dramatic advantage the extra time invested to formulate the problem in the computer.


    All this doesn't mean that we need computer algebra, at all, but does mean computer algebra can enrich our working experience in significant ways.

    What is computer algebra - how do you learn to use it?


    What is this mini-course about?


    What can you expect from this mini-course?



    Explore. Having success doesn't matter, using your curiosity as a compass does - things can be done in so many different ways. Have full permission to fail. Share your insights. All questions are valid even if to the side. Computer algebra can transform the algebraic computation part of physics into interesting discoveries and fun.

    1. Arithmetic operations and elementary functions


    2. Algebraic Expressions, Equations and Functions


    3. Limits, Derivatives, Sums, Products, Integrals, Differential Equations


    4. Algebraic manipulation: simplify, factor, expand, combine, collect and convert


    5. Matrices (Linear Algebra)


    6. Vector Analysis


    7. Tensors and Special Relativity


    8. Quantum Mechanics


    9. General Relativity


    10. Field Theory



    Edgardo S. Cheb-Terrab
    Physics, Maplesoft

    We regularly host live webinars on a variety of topics for our customers, and we wanted to make this information available to the MaplePrimes community as well. We will be posting information about new webinars we think will be of interest approximately once per month.

    Partnering with the MAA to Revolutionize Placement Testing

    In this webinar, we will demonstrate how the Maple T.A. MAA Placement Test Suite can be used to ease the problem of placement testing and how it can benefit your campus in general.

    Other topics include:

    • How placement testing contributes to student success

    • How the MAA placement tests are created, and rigorously validated

    • How valid and reliable the MAA placement tests are for entry level mathematics courses

    • How you can use the Maple T.A. Placement Test Suite for easy administration, flexible delivery, and fast results

    To join us for the live presentation, please click here to register.

    At the user stored question list for every user stored at maplesoft, all posted dates are correct however at mapleprimes the dates start at April 2010 ???

    Also, unfortunately the question list at maplesoft seems to all end Oct 2013.  I'm not really sure what happened there.  But when I'm trying to search for something I qustioned or posted after Oct 2013 from that list is not going to happen.

    That list was the best thing!  All of your questions and posts ever created are in chronological order making it quite easy to locate a question you were looking for.

    I just wanted to remind everyone that this quarter's Möbius App Challenge closes on March 31st.  The next prize to be awarded is an Xbox One Prize Pack.  Video games are supposed to be good for the brain, after all, so really, you owe it to yourself to enter.

    To enter the contest, all you need to do is:

    1) Create an interactive App in Maple

    2) While in Maple, log-in to the MapleCloud through the MapleCloud palette.

    3) Click on the Send Document to the Cloud button

    4) Set the group to "Mobius@admin", then hit send.

    The group is moderated, so it won't appear instantly, but once approved it will appear on the Möbius Project server, where people can interact with it through a web browser, in Maple, or download it for use with the free Maple Player.

    Here are the full contest details and more information on creating and submitting Apps.

    Good luck!


    In this post we present the solution with Maple to the logical problem of "Gardens Puzzle"

    The Puzzle:

    Five friends have their gardens next to one another, where they grow three kinds of crops: fruits (apple, pear, nut, cherry), vegetables (carrot, parsley, gourd, onion) and flowers (aster, rose, tulip, lily).

    1. They grow 12 different varieties.
    2. Everybody grows exactly 4 different varieties
    3. Each variety is at least in one garden.
    4. Only one variety is in 4 gardens.
    5. Only in one garden are all 3 kinds of crops.
    6. Only in one garden are all 4 varieties of one kind of crops.
    7. Pear is only in the two border gardens.
    8. Paul's garden is in the middle with no lily.
    9. Aster grower doesn't grow vegetables.
    10. Rose growers don't grow parsley.
    11. Nuts grower has also gourd and parsley.
    12. In the first garden are apples and cherries.
    13. Only in two gardens are cherries.
    14. Sam has onions and cherries.
    15. Luke grows exactly two kinds of fruit.
    16. Tulip is only in two gardens.
    17. Apple is in a single garden.
    18. Only in one garden next to Zick's is parsley.
    19. Sam's garden is not on the border.
    20. Hank grows neither vegetables nor asters.
    21. Paul has exactly three kinds of vegetable.

    Who has which garden and what is grown where?


    About methods of solution. At first I just wanted to generate all variations and using conditions 1 .. 21 to find all solutions. But even if we use the condition that everybody grows exactly 4 different varieties then the total number variants equals  5!^2*binomial(12,4)^5=427945522455000000

    So from the very beginning using some of the conditions 1 .. 21 we maximally reduce the number of possible variants. For example from the conditions 11, 18 and 6 implies that only in one garden are all 4 varieties of flowers. Next we pass through these variants and using conditions 1 .. 21 and finally come to a unique solution:


    Fruits:={apple, pear, nut, cherry}:

    Vegetables:={carrot, parsley, gourd, onion}:

    Flowers:={aster, rose, tulip, lily}:




    Set2:=Fruits union Vegetables union Flowers minus {nut,gourd,parsley} minus {apple,cherry,rose}:

    Garden2:={seq({nut,gourd,parsley} union {Set2[i]}, i=1..nops(Set2))}:

    Set3:=Vegetables union Flowers minus {parsley}:

    Garden3:={seq({apple,cherry,pear} union {Set3[i]}, i=1..nops(Set3))}:

    Set4:=combinat[choose](Fruits union Vegetables union Flowers minus {onion,cherry} minus {apple,parsley,pear,nut}, 2):

    Garden4:={seq({onion,cherry} union Set4[i], i=1..nops(Set4))}:

    Set5:=Fruits union Vegetables union Flowers minus {apple, cherry,nut,parsley}:

    Garden5:=combinat[choose](Set5, 4):



    for s1 in Garden1 do

    for s2 in Garden2 do

    for s3 in Garden3 do

    for s4 in Garden4 do

    for s5 in Garden5 do

    s:=[s1,s2,s3,s4,s5]: s_4:=combinat[choose](s,4): m:=0: n:=0: k:=0: p:=0: q:=0:

    for i in s do

    if `intersect`(i,Fruits)<>{} and `intersect`(i,Vegetables)<>{} and `intersect`(i,Flowers)<>{} then m:=m+1: fi:

    if pear in i then n:=n+1: fi:

    if tulip in i then k:=k+1: fi:

    if aster in i and `intersect`(i,Vegetables)<>{} then p:=p+1: fi:

    if i=Fruits or i=Vegetables or i=Flowers then q:=q+1: fi:


    if nops(`union`(op(s)))=12 and nops(`union`(seq(`intersect`(op(s_4[j])), j=1..nops(s_4))))=1 and m=1 and n=2 and k=2 and p=0 and q=1 then S:=[op(S),[s1,s2,s3,s4,s5]]: fi:

    od: od: od: od: od:







    for l in L do

    for s in S do

    sol:=[seq([op(l[i]),s[i]], i=1..5)]:

    gad1:=op(select(has,sol,parsley)): gad2:=op(select(has,sol,Zick)):

    if abs(gad1[1]-gad2[1])=1 and convert([seq(((pear in sol[i][3] implies (sol[i][1]=1 or sol[i][1]=5)) and (sol[i][2]=Paul implies (not lily in sol[i][3])) and (sol[i][1]=1 implies (apple in sol[i][3] and cherry in sol[i][3])) and (sol[i][2]=Sam implies (onion in sol[i][3] and cherry in sol[i][3])) and (sol[i][2]=Luke implies nops(`intersect`(sol[i][3],Fruits))=2) and (sol[i][2]=Hank implies (`intersect`(sol[i][3],Vegetables)={} and not aster in sol[i][3])) and (sol[i][2]=Paul implies nops(`intersect`(sol[i][3],Vegetables))=3)), i=1..5)], `and`) then Sol:=[op(Sol), sol]: fi:


    od: od:

    for i in Sol do





    For some time I have been running into the problem where uploaded worksheets that are inlined into a Mapleprimes post get gridlines shown, even when they are not specified or shown in the original worksheet. This is a problem because quite often the gridlines make an inlined plot unattractive.

    I believe that Mapleprimes uses some version of MapleNet as a mechanism for inlining uploaded worksheets.

    It seems that the Standard GUI and/or MapleNet have special handling for gridlines in the sense that they actually distinguish between PLOT structures generated without the `gridlines` option versus those created with `gridlines=false`.  I believe that this has something to do with the persistence of various plot qualities in an output region which (perhaps for historical reasons?)  allow re-execution of a plot input command to produce a plot output rendering that remembers whether gridlines are visible.

    If the second plot below does indeed get rendered here in Primes without gridlines visible then one workaround is evident: adding `gridlines=false` instead of omitting the option.





    I'll submit a bug report against MapleNet.


    In this post we present another compact proof of this remarkable theorem without using  geometry package.
    The proof uses a procedure called  Cc , which for three points returns a list of the coordinates of the center and the radius of the circumscribed circle.



    local x1, y1, x2, y2, x3, y3, x, y;

    x1,y1:=op(A);  x2,y2:=op(B);  x3,y3:=op(C);

    solve({(x2-x1)*(x-(x1+x2)/2)+(y2-y1)*(y-(y1+y2)/2)=0, (x2-x3)*(x-(x2+x3)/2)+(y2-y3)*(y-(y2+y3)/2)=0},{x,y});


    [simplify([x,y]), simplify(sqrt((x-x1)^2+(y-y1)^2))];

    end proc:

    Proof for arbitrary triangle:

    A, B, C:=[x1,y1], [x2,y2], [x3,y3]:

    A1, B1, C1, M:=(B+C)/2, (A+C)/2, (A+B)/2, (A+B+C)/3:

    P1:=Cc(A,M,B1)[1]: P2:=Cc(B1,M,C)[1]: P3:=Cc(C,M,A1)[1]:

    P4:=Cc(A1,M,B)[1]: P5:=Cc(B,M,C1)[1]: P6:=Cc(C1,M,A)[1]:

    Cc1:=Cc(P1,P2,P3):  Cc2:=Cc(P4,P5,P6):



    MapleSim 6.4 includes more powerful tools for creating custom components, performance enhancements, and enhancements to the model generators for Simulink® and FMI. 

    We have also made important updates to the MapleSim Control Design Toolbox. This toolbox now offers a more complete set of algorithms for PID control, new commands for computing closed-loop transfer functions, and numerous improvements to existing commands. These enhancements allow engineers to design a greater variety of controllers and controller-observer systems while taking advantage of the greater flexibility and analysis options available through the use of symbolic parameters. 

    See What’s New in MapleSim 6.4 and What’s New in the MapleSim Control Design Toolbox for details.



    Let  us consider the general case of symbolic values C(xC,yC). I make use of the idea suggested by edgar in : no assumptions.

    restart; with(geometry); point(A, 0, 0);
    point(B, 1, 0);
    point(C, xC, yC);
    point(MA, (xC+1)*(1/2), (1/2)*yC);
    point(MC, 1/2, 0);
    point(MB, (1/2)*xC, (1/2)*yC);
    point(E, (0+1+xC)*(1/3), (0+0+yC)*(1/3));# the center of mass
    line(l1, x = 1/4, [x, y]);
    The coordinates of the center of the first described circle are found as the solutions of the system of the equations of midperpendiculars.

    midpoint(ae, A, E); coordinates(ae);

    S1 := solve({x = 1/4, ((xC+1)*(1/3))*(x-(xC+1)*(1/6))+(1/3)*yC*(y-(1/6)*yC) = 0}, {x, y});

    BTW, Maple can't create the midperpendiculars in this case.

    point(O1, op(map(rhs, S1)));

    Simple details are omitted in the above. The coordinates of the centers of the two next described circles are found similarly.
    coordinates(midpoint(mce, MC, E));

    S2 := solve({x = 3/4, ((-1/2+xC)*(1/3))*(x-5/12-(1/6)*xC)+(1/3)*yC*(y-(1/6)*yC) = 0}, {x, y});

    point(O2, op(map(rhs, S2)));

    coordinates(midpoint(bma, B, MA)); coordinates(midpoint(be, B, E));


    S3 := solve({(xC-1)*(x-(xC+3)*(1/4))+yC*(y-(1/4)*yC) = 0, ((-2+xC)*(1/3))*(x-(4+xC)*(1/6))+(1/3)*yC*(y-(1/6)*yC) = 0}, {x, y});

    point(O3, op(map(rhs, S3)));


    Now we find the equation of the circumference which passes through O1, O2, and O3.

    eq := a*x+b*y+x^2+y^2+c = 0:
    sol := solve({eval(eq, S1), eval(eq, S2), eval(eq, S3)}, {a, b, c});

    A long output can be seen in the attached .mw file.

    eq1 := eval(eq, sol);

      Now we find (in suspense)  the coordinates of the next center and verify whether it belongs to the sircumference O1O2O3.

    coordinates(midpoint(mac, C, MA)); coordinates(midpoint(ec, E, C)); S4 := solve({(xC-1)*(x-(3*xC+1)*(1/4))+yC*(y-3*yC*(1/4)) = 0, ((2*xC-1)*(1/3))*(x-(4*xC+1)*(1/6))+(2*yC*(1/3))*(y-4*yC*(1/6)) = 0}, {x, y});

     point(O4, op(map(rhs, S4)));

    simplify(eval(eq1, S4));

                                 0 = 0

    Hope the reader will have a real pleasure to find the two residuary centers and to verify these on his/her own.





    It is well known that the medians of a triangle divide it into 6 triangles.
    It is less known that the centers of their circumscribed circles belong to one circumference as drawn below

    This remarkable theorem  was proved in the 21st century! Unfortunately, I lost its source.
    I can't prove this difficult  theorem by hand. However, I can prove it with Maple.
    The aim of this post is to expose these proofs. Everybody knows that it is scarcely possible
    to construct a general triangle with help of the geometry package of Maple.
    Without loss of generality one may assume that the vertex A is placed at the origin,
    the vertex B is placed at (1,0), and the vertex C(xC,yC). We firstly consider the theorem
    in the case of concrete values of xC and yC.

    restart; with(geometry):with(plots):
    point(A, 0, 0);
    point(B, 1, 0);
    xC := 15*(1/10); yC := sqrt(3); point(C, xC, yC);
    triangle(T, [A, B, C]);
    median(mA, A, T, MA);
    median(mB, B, T, MB);
    median(mC, C, T, MC);
    line(m1, [A, MA]);
    line(m2, [B, MB]);
    intersection(E, m1, m2);
    triangle(AEMB, [A, E, MB]);
    circumcircle(c1, AEMB, 'centername' = C1);
    circumcircle(c2, triangle(CEMB, [C, E, MB]), 'centername' = C2);
    circumcircle(c3, triangle(CEMA, [C, E, MA]), 'centername' = C3);
    circumcircle(c4, triangle(BEMA, [B, E, MA]), 'centername' = C4);
    circumcircle(c5, triangle(BEMC, [B, E, MC]), 'centername' = C5);
    circumcircle(c6, triangle(AEMC, [A, E, MC]), 'centername' = C6);
    circle(CC, [C1, C2, C3]);
    IsOnCircle(C4, CC);

    IsOnCircle(C5, CC);
    IsOnCircle(C6, CC);
    display([draw([T(color = black), mA(color = black), mB(color = black), mC(color = black), C1(color = blue), C2(color = blue), C3(color = blue), C4(color = blue), C5(color = blue), C6(color = blue), CC(color = red)], symbol = solidcircle, symbolsize = 15, thickness = 2, scaling = constrained), textplot({[-0.5e-1, 0.5e-1, "A"], [.95, 0.5e-1, "B"], [xC-0.5e-1, yC+0.5e-1, "C"]})], axes = frame, view = [-.1 .. max(1, xC)+.1, 0 .. yC+.1]);

    This can be done as a procedure in such a way.

    restart; SixPoints := proc (xC, yC) geometry:-point(A, 0, 0); geometry:-point(B, 1, 0); geometry:-point(C, xC, yC); geometry:-triangle(T, [A, B, C]); geometry:-median(mA, A, T, MA); geometry:-median(mB, B, T, MB); geometry:-median(mC, C, T, MC); geometry:-line(m1, [A, MA]); geometry:-line(m2, [B, MB]); geometry:-intersection(E, m1, m2); geometry:-triangle(AEMB, [A, E, MB]); geometry:-circumcircle(c1, AEMB, 'centername' = C1); geometry:-circumcircle(c2, geometry:-triangle(CEMB, [C, E, MB]), 'centername' = C2); geometry:-circumcircle(c3, geometry:-triangle(CEMA, [C, E, MA]), 'centername' = C3); geometry:-circumcircle(c4, geometry:-triangle(BEMA, [B, E, MA]), 'centername' = C4); geometry:-circumcircle(c5, geometry:-triangle(BEMC, [B, E, MC]), 'centername' = C5); geometry:-circumcircle(c6, geometry:-triangle(AEMC, [A, E, MC]), 'centername' = C6); geometry:-circle(CC, [C1, C2, C3]); return geometry:-IsOnCircle(C4, CC), geometry:-IsOnCircle(C5, CC), geometry:-IsOnCircle(C6, CC), geometry:-draw([CC(color = blue), C1(color = red), C2(color = red), C3(color = red), C4(color = red), C5(color = red), C6(color = red), T(color = black), mA(color = black), mB(color = black), mC(color = black), c1(color = green), c4(color = green), c2(color = green), c3(color = green), c5(color = green), c6(color = green)], symbol = solidcircle, symbolsize = 15, thickness = 2) end proc;
    SixPoints(1.5, 1.2);

    true, true, true, PLOT(...)
     SixPoints(1.5, 1.2)[4];


    To be continued (The general case will be considered in  part 2 .).




    Maple 18, document mode. Please try this:


    Now, as the cursor is right after the "m" above, hiting the ESC key to autocomplete, nothing happens. Only a beep, meaning Maple does not know about the variable name I wanted to expand to, which is "some_long_name". What I do now is manually add a space by  pushing the ")" away, like this:

      f(som )

    And now put the mouse back in front of the "m" and now hit ESC. Maple now can see the name I wanted.

    Really? This is very bad design. You might ask, why did I close the () first? Well, I like to start by writing () then fill it in, or it can be that I am changing things, and wanted to write a new name, and the () was allready there. I use name autocomplete alot, and it is very annoying to not be able to use it if happens that there is a ")" or "]" right next to the name.

    Having to keep pushing the ")" away, so that Maple can see the name makes no sense since ")" can't part of a name.

    In Mathematica it just works. I can do

    someLongName = 3;

    Then in a new cell,

    f[som] and hit CTRL-K  when mouse at the letter "m" just typed it in, and it will autocomplete.  I did not have to push "]" away first.

    Please Maple, fix your user interface so it is less awkward and annoying to use. This is version 18 of the software, and not version 1.


    A post to conjure up some interest.  Nasa seeks coders to hunt asteroids

    Just going out on a limb here but any of the three M's would have a good chance here.  A good opportunity to create some code.  Maple could port it to C code then compiled for speed.  On a smaller scale it would be an interesting challenge.  On the larger scale not sure if Maple would be best suited for the task.  Opinions?

    First 77 78 79 80 81 82 83 Last Page 79 of 297