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
  •    Maplesoft aims to promote innovation in science, technology, engineering and math (STEM) in high school students by partnering with various organizations, and sponsoring initiatives in education, research and innovation. Every year, Maplesoft commits time, funds and people to enhance the quality of math-based learning and discovery and to encourage high school students to strengthen their math skills.

       One such organization we partner with is The Perimeter Institute, a leading centre for scientific research, training and educational outreach in foundational theoretical physics.  Maplesoft currently serves as its Educational Outreach Champion, supporting various initiatives that promote math learning and exploration. Perhaps the most popular of its student outreach program is the annual International Summer School for Young Physicists (ISSYP), a two-week camp that brings together 40 exceptional students from high schools across the globe.  Each year students receive a complimentary copy of Maple, and use the product to practice and strengthen their math skills.  The ISSYP program also uses Möbius, the comprehensive online STEM courseware platform from Maplesoft, to offer preparatory course materials to students.  Completing lessons in Möbius aid in making the summer program a more productive and dynamic experience for the students.


    International Summer School for Young Scientists at Perimeter Institute


       Who Wants to Be a Mathematician is a competition organized by the American Mathematical Society (AMS) for high school students in North America. Maplesoft has been a sponsor of the contest for many years.  Maple T.A., the testing and assessment tool by Maplesoft, is used to administer the tests online, saving significant time and money for the organizers. When Maplesoft first introduced Maple T.A. to the contest, taking the competition from pen-and-paper tests to online tests, the number of contestants doubled, with about 2000 students participating in the contest. Maplesoft also donates prizes to the games in order to promote the use and love of math by high school students.  This year will be first time the competition moves international. Six students in the UK took the Round 2 qualifying test, with the use of Maple T.A., and qualified for the live, on-stage finals of the UK edition of the competition that took place at the 2017 Maths Fest in London. Maplesoft is also supporting the spread of the WWTBAM contest to Canada in 2017.

    Who Wants to be a Mathematician finals

    Maplesoft also sponsors two outreach initiatives in Texas A&M University.  The Summer Educational Enrichment (SEE) Math Program is a summer workshop attended by gifted middle school students. Students spend two weeks exploring ideas such as algebra, geometry, graph theory, and topology.  The University also conducts the Integral Bee every year, a math based contest for high school students.

    In addition to the above key projects, throughout the year Maplesoft also sponsors and is associated with a number of other competitions, conferences, and educational initiatives. A few of these are listed below.

    • The Connecticut Science & Engineering Fair is a yearly, statewide science and engineering fair open to all 7th through 12th grade students.  An important objective of their program is to attract young people to careers in science and engineering while developing skills essential to critical thinking.
    • FIRST Robotics Competition is a high school robotics competition. Each year, teams of high school students and mentors work during a six-week period to build game-playing robots that weigh up to 120 pounds.


    FIRSTRobotics Competition

    • ScienceExpo Conference is a student-run event that engages students with STEM-related opportunities and workshops
    • SWATposium is an annual robotics conference that brings together nearly 40 First Robotic Competition teams from both Canada and the United States for a day of guest speakers, workshops and social activities.



    • FIRST LEGO League gives elementary and middle school students and their adult coaches the opportunity to work and create together to solve a common problem.


    FIRST LEGO League at St. Luke's School in Waterloo

       Maplesoft’s objective of these sponsorships is to support those who inspire and channel young minds to be STEM focussed. By engaging them in exciting contests and programs the hope is that they build science, engineering, and technology skills at a young age and grow to be innovators and technology leaders of tomorrow.

    Sudoku is a well known Latin square type game, see

    Here is a Sudoku game and its (unique) solution:

    A,Sol:=  # A = Sudoku matrix, 0 for each empty cell
    Matrix(9, [
    Matrix(9, [

    The procedure which follows is a very compact Sudoku solver. It uses Groebner bases. I hope that you will like it.
    The input is the Sudoku matrix and the solution matrix is returned.
    Note that the Sudoku matrix must be valid and must have a unique solution.
    (Otherwise, theoretically, the error "Invalid Sudoku matrix" should appear.)
    Note also that the procedure may be very slow for some games or Maple may crash. This happened to me once with a very "hard" matrix.

    I was impressed that Maple's implementation for Groebner bases works now so well for this problem!

    A few years ago on this site:
    it was an attempt to solve the problem with this method but it failed (due to wrong number of polynomials).

    local x_A,x,Q,R,r, i,j,u,v,G;
    Q:=proc(X,Y) normal((mul(X-i,i=1..9)-mul(Y-i,i=1..9))/(X-Y)) end;
    x_A:=seq(seq( `if`(A[i,j]>0,x[i,j]-A[i,j],NULL),i=1..9),j=1..9);
    R:={seq({seq(x[i,j],j=1..9)},i=1..9), seq({seq(x[i,j],i=1..9)},j=1..9),
    G:=Groebner:-Basis({seq(seq(seq(Q(u,v),u=r minus {v}),v=r),r=R),x_A},'_vv');
    if nops(G)<>81 then error "Invalid Sudoku matrix" fi;
    eval(Matrix(9,symbol=x), `union`(map(u->solve({u}), G)[]));

    sudoku(A) < A; # Solving the previous game

    # Let's solve another one:
    sudoku(A) < A;

    Matrix   # A Sudoku matrix which crashes Maple!



    The distance from the point to the surface easily calculated using the NLPSolve of Optimization package. If the point is not special, we will find for it a point on the surface, the distance between these two points is the shortest between the selected point and the surface.
    Two examples:  the implicit surface and the parametric surface.
    To test, we restore the normals from the  calculated  points (red) by using analytical equations.

    In the present work it has been shown how Maple helps in the teaching of Mathematics in the different subjects that it has. Using a Maple worksheet as if it were a class preparation notebook could develop problems such as: Vector Analysis, EDO, EDP, Statistics, Algebra, Geometry, etc., among others; Taking as a method of solution the clickable-mathpopup, the right click (contextual) or at best embedded components. No criteria or prerequisite is needed to use Maple; Rather than being willing to forget the traditional slate and down and replace it with dynamic leaves that maple offers us; To achieve excellent academic profiles both individually and in groups. The proprietary methods are used to develop applications (math-apps) being a professional criterion; That is to say, according to the problematic reality, we are looking for enduring interactive solutions. Here we use the graphical algorithm and the block diagram as a solution proposal but not as something obligatory to implement solutions. We take as a teaching-learning measure the results of our students in the ability to analyze and interpret the results; Since in the times of calculation; Maple helps tremendously; Opening up this way to train students competent in basic sciences and engineering.



    In Spanish

    Lenin Araujo Castillo

    Ambassador of Maple - Perú



    In the creation of this animation the technique from here  was used.




    The code of this animation:

    with(plots): with(plottools):
    SmallHeart:=plot([1/20*sin(t)^3, 1/20*(13*cos(t)/16-5*cos(2*t)/16-2*cos(3*t)/16-cos(4*t)/16), t = 0 .. 2*Pi], color = "Red", thickness=3, filled):
    F:=t->[sin(t)^3, 13*cos(t)/16-5*cos(2*t)/16-2*cos(3*t)/16-cos(4*t)/16]:
    Gf:=display(translate(SmallHeart, 0,0.37)):
    Gl:=display(translate(SmallHeart, 0,-1)):
    G:=t->display(translate(SmallHeart, F(t)[])):
    A:=display(seq(display(op([Gf,seq(G(-Pi/20*t), t=3..k),seq(G(Pi/20*t), t=3..k)]))$4,k=2..17),display(op([Gf,seq(G(-Pi/20*t), t=3..17),seq(G(Pi/20*t), t=3..17),Gl]))$30, insequence=true, size=[600,600]):
    B:=animate(textplot,[[-0.6,0.25, "Happy"[1..round(n)]],color="Orange", font=[times,bolditalic,40], align=right],n=0..5,frames=18, paraminfo=false):
    C:=animate(textplot,[[-0.2,0, "Valentine's"[1..round(n)]],color=green, font=[times,bolditalic,40], align=right],n=1..11,frames=35, paraminfo=false):
    E:=animate(textplot,[[-0.3,-0.25, "Day!"[1..round(n)]],color="Blue", font=[times,bolditalic,40], align=right],n=1..4,frames=41, paraminfo=false):
    T:=display([B, display(op([1,-1,1],B),C), display(op([1,-1,1],B),op([1,-1,1],C),E)], insequence=true):
    K:=display(A, T, axes=none):

    The last frame of this animation:

    display(op([1,-1],K), size=[600,600], axes=none);  # The last frame



    Edit. The code was edited - the number of frames has been increased.

    Let us consider the linear integer programming problem:

    A := Matrix([[1, 7, 1, 3], [1, 6, 4, 6], [17, 1, 5, 1], [1, 6, 10, 4]]):
     n := 4; z := add(add(A[i, j]*x[i, j], j = 1 .. n), i = 1 .. n):
    restr := {seq(add(x[i, j], i = 1 .. n) = 1, j = 1 .. n), seq(add(x[i, j], j = 1 .. n) = 1, i = 1 .. n)}:
     sol := Optimization[LPSolve](z, restr, assume = binary);
    Error, (in Optimization:-LPSolve) no feasible integer point found; 
    use feasibilitytolerance option to adjust tolerance
    sol1 := Optimization[LPSolve](z, restr, assume = binary, feasibilitytolerance = 100, integertolerance = 1);
    Error, (in Optimization:-LPSolve) no feasible integer point found;
     use feasibilitytolerance option to adjust tolerance

    That was OK in Maple 16, outputting


    The bug in one of the principal Maple commands lasts since Maple 2015, where the above code causes "Kernel connection has been lost". The SCRs about it were submitted three times (see

    We have just released a small update to MapleSim.  MapleSim 2016.2a is an update to MapleSim 2016.2 that includes improvements in several areas, including corrections to problems related to custom components and importing Modelica libraries. As usual, we recommend that every MapleSim customer install all available updates.  The update is availble through Help>Check for Updates and as a download from our website.  See MapleSim 2016.2a for details.


    The Mobius strip

    Variants :

    The line and the curve on the surface.


    Recently, I came across an addendum to a problem that appears in many calculus texts, an addendum I had never explored. It intrigued me, and I hope it will capture your attention too.

    The problem is that of girding the equator of the earth with a belt, then extending by one unit (here, taken as the foot) the radius of the circle so formed. The question is by how much does the circumference of the belt increase. This problem usually appears in the section of the calculus text dealing with linear approximations by the differential. It turns out that the circumference of the enlarged band is 2*Pi ft greater than the original band.

    (An alternate version of this has the circumference of the band increased by one foot, with the radius then being increased by 0.16 ft.)

    The addendum to the problem then asked how high would the enlarged band be over the surface of the earth if it were lifted at one point and drawn as tight as possible around the equator. At first, I didn't know what to think. Would the height be some surprisingly large number? And how would one go about calculating this height.

    It turns out that the enlarged and lifted band would be some 616.67 feet above the surface of the earth! This is significantly larger than the increase in the diameter of the original band. So, the result is a surprise, at least to me.

    This is the kind of amusement that retirement affords. I heartily recommend both the amusement and the retirement. The supporting calculations can be found in the attached worksheet:

    Let us consider 

    MultiSeries:-limit(sin(n)/n, n = infinity, complex);

    The answer is wrong: in view of the Casorati-Weierstrass theorem the limit does not exist. Let us try another limit command of Maple

    limit(sin(n)/n, n = infinity, complex);
    (lim) (sin(n))/(n)

    which fails. Therefore, Maple user does not obtain the correct answer. 

    Suppose we have some simple animations. Our goal - to build a more complex animation, combining the original animations in different ways.
    We show how to do it on the example of the three animations. The technique is general and can be applied to any number of animations.

    Here are the three simple animations:

    A:=animate(plot, [sin(x), x=-Pi..a, color=red, thickness=3], a=-Pi..Pi):
    B:=animate(plot, [x^2-1, x=-2..a, thickness=3, color=green], a=-2..2): 
    C:=animate(plot, [[4*cos(t),4*sin(t), t=0..a], color=blue, thickness=3], a=0..2*Pi):


    In Example 1 all three animation executed simultaneously:

    display([A, B, C], view=[-4..4,-4..4]);



    In Example 2, the same animation performed sequentially. Note that the previous animation disappears completely when the next one begins to execute:

    display([A, B, C], insequence);



    Below we show how to save the last frame of every previous animation into subsequent animations:

    display([A, display(op([1,-1,1],A),B), display(op([1,-1,1],A),op([1,-1,1],B),C)], insequence);



    Using this technique, we can anyhow combine the original animations. For example, in the following example at firstly animations   and  B  are executed simultaneously, afterwards C is executed:

    display([display(A, B), display(op([1,-1,1],A),op([1,-1,1],B),C)], insequence);



    The last example in 3D I have taken from here:

    A:=animate(plot3d,[[2*cos(phi),2*sin(phi),z], z =0..a, phi=0..2*Pi, style=surface, color=red], a=0..5):
    B:=animate(plot3d,[[(2+6/5*(z-5))*cos(phi), (2+6/5*(z-5))*sin(phi),z], z=5..a, phi=0..2*Pi, style=surface, color=blue], a=5..10):
    C:=animate(plot3d,[[8*cos(phi),8*sin(phi),z], z =10..a, phi=0..2*Pi, style=surface, color=green], a=10..20):
    display([A, display(op([1,-1,1],A),B), display(op([1,-1,1],A),op([1,-1,1],B),C)], insequence, scaling=constrained, axes=normal);



    We have just released an update to Maple.  It includes updates to the Maple Workbook, the video component, the Physics package, and many other small improvements throughout the product. It is available through Tools>Check for Updates in Maple, and is also available from our website on the Maple 2016.2 download page.


    We have just released a major update to MapleSim and the MapleSim family of products. This update includes significant enhancements in the areas of model development and toolchain connectivity, including:

    • Live simulations let you see results as the simulation is running, so you can track progress and react to problems immediately.
    • A new 3-D overlay option lets you easily compare simulation visualizations by overlaying one visualization on top of another
    • Tools for revision control enable a structured approach to managing and tracking changes to your model, making it easier to manage projects when multiple engineers are working on the same model and reducing development risk.
    • MapleSim now supports direct import of models created in other FMI-compatible software, providing even greater cross-tool compatibility and opportunities for co-simulation.
    • The MapleSim Connector, for connectivity with Simulink®, and the MapleSim Connector for FMI, for exporting MapleSim models to other FMI-compatible tools, have been expanded to allow you to explore simulation results involving exported MapleSim models from within MapleSim, even though the simulation was done in the target tool.


    This update is being distributed through the automatic Check for Updates system, and is also available from our website. See the MapleSim 2016.2  downloads page for details on obtaining this update.



    I'd like to pay attention of Maple community to the recent work by Alex Degtyarev in algebraic geometry done with Maple.

    I am pleased to announce that we have just released a significant update to Maple T.A. 2016, our online assessment system.

    Maple T.A. 2016.1 includes a wide range of features and improvements that have been requested by customers, including new options for questions and assignments, improved content management, and enhanced integration with course management systems. It also includes a substantial number of small enhancements and corrections across all areas of the product, providing improved responsiveness, more efficient load handling, and smoother workflow for instructors and students.

    For more information, visit What’s New in Maple T.A.

    Jonny Zivku
    Product Manager, Online Education Products

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