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
  • This command should have been in Physics on day one. Being more familiar with functional differentiation, and Physics:-Fundiff was the first Physics command that ever existed, I postponed writing LagrangeEquations year after year. In general, however, functional differentiation is seen as a more advanced topic. So there is now a new command, Physics:-LagrangeEquations, taking advantage of functional differentiation on background, and distributed for everybody using Maple 2022.2 within the Maplesoft Physics Updates. This is the first version of its help page.


    Download LagrangeEquations.mw

    Edgardo S. Cheb-Terrab
    Physics, Differential Equations and Mathematical Functions, Maplesoft

    Welcome back to another Maple Learn blog post! Today we’re going to talk about the gift-wrapping algorithm, used to find the convex hull of a set of points. If you’re not sure what that means yet, don’t worry! We’re going to go through it with four Maple Learn documents; two which are background information on the topic, one that is a visualization for the gift-wrapping algorithm, and another that goes through the steps. Each will be under their own heading, so feel free to skip ahead to your skill level!

    Before we can get into the gift-wrapping algorithm we need to define a few terms. Let’s start by defining polygons and simple polygons.

    A picture containing text, person

Description automatically generated

    Polygon: A closed shape created by joining a series of line segments.

    Simple polygon: A polygon without holes and that does not intersect itself.

    Shape, polygon

Description automatically generated

    So, what are convex and concave polygons? Well, there are three criteria that define a convex polygon. A polygon that is not convex is called concave. The criteria are…

    1. Any line segment connecting any two points within the polygon stays within the polygon.
    2. Any line intersects a polygon’s boundary at most twice.
    3. All interior angles are less than 180 degrees or pi radians.

    A picture containing chart

Description automatically generated

    Because the criteria are equivalent, if any one is missing, the shape is concave. AKA, all three criteria must be present for a shape to be convex. Most “regular shapes”, such as trapezoids, are convex polygons!

    A shape that satisfies convex criteria but not the criteria for being a polygon is called a convex set.

    As mentioned at the start of this post, the gift-wrapping algorithm is used to find the convex hull of a set of points. Now that we know what convex polygons and convex sets are, we can define the convex hull!

    Convex hull: The convex set of a shape or several shapes that fully contains the object and has the smallest possible area.

    A picture containing text, stationary, envelope, businesscard

Description automatically generated

    Why was the convex polygon important? Well, the convex hull of a set of points is always a convex polygon. Some of the points in the set are the vertices of said polygon, and are called extreme points. You can find the convex hull of either concave or convex polygons.

    This document amazed me when I tried it for the first time. Here, you can generate a set of points with the “Generate Another” button, and then press the “Visualize” button. The document then calculates the perimeter of the convex hull of the set of points! The set can be further customized below the buttons, by changing the number of points. The other option below it allows you to slow down or speed up the visualization. Pretty cool, huh? It’s like it’s thinking!

    Try the document out a few times, or watch the gif below to get a quick idea of it.

    This final document walks you through the steps of how to use the gift wrapping algorithm. It is a simple loop of 4 steps, with one set-up step. Unlike the other documents in this post, I won’t be delving too far into the math behind the steps. I want to encourage you to check this one out yourself, as it’s really quite a fun problem to solve once you have some time!

    Chart, line chart

Description automatically generated

    I hope you check out the documents in this post. Please let us know below if there’s any other documents you’d like to see featured!

    A failing slinky is another intriguing physics phenome that can be easily reproduced with MapleSim.

    The bottom of a vertically suspended slinky does not move when the top is released until the slinky is fully collapsed.

     

     

    To model this realistically in MapleSim, it is necessary to

    • Establish a stretched equilibrium state at the start of the fall
    • Avoid penetration of windings when windings collapse (i.e. get into contact)

    The equilibrium state is achieved with the snapshot option. Penetration is avoided with the Elasto Gap component. Details can be found in the attached model.

    A good overview of “Slinky research” is given here. The paper provides a continuous description of the collapse process (using an inhomogenous wave equation combined with contact modeling!!!) and introduces a finite time for the collapse of all windings. Results for a slinky are presented that collapses after 0.27s. The attached model has sufficient fidelity to collapse at the same time.

    Real Slinkies also feature a torsional wave that precedes the compression wave and disturbs an ideal collapse. This can be seen on slowmo footage and advanced computer models. With a torsion spring constant at hand (are there formulas for coil springs?), it could also be modeled with MapleSim.

    Falling_slinky.msim

    Have you ever heard of the Maurer Rose?

    The Maurer Rose was demonstrated in 1987 by Peter Maurer and is created by connecting certain points on a rose curve. This creates petal-like patterns, caused by the oscillation of a sine curve.

     

    Chart, radar chart

Description automatically generated

    So, how are these created? A "rose curve" is created in polar coordinates with the equation sin(nt) for a (positive integer) value of n.  To create the Maurer Rose, straight line segments are drawn connecting points on the curve at incrementing angle values.  The size of this increment (called d in our examples) leads to different patterns of lines across the curve.

    This can be done in Maple Learn! One example of the Maurer Rose already exists, complete with a full interactive visualization and a more detailed overview of the Maurer Rose.

    Play around with it and look below at some of the different shapes that can be created using this document! The first is created with an n value of 31 and a d value of 65, with blue and red. The second uses an n value of 4 and a d value of 133, and purple and green.

    Chart, diagram, radar chart

Description automatically generated

    Are there any other concepts you’d like to see represented in Maple Learn’s document gallery? Please let us know in the comments below!

    Hello MaplePrimes community,

    We just created a Frequently Asked Question article that may address some Primes questions about updates to Physics in Maple 2022.2: 

    Why does Maple 2022.2 throw an error executing Physics:-Version(latest)?

    For searchability, the specific error in question is

    Error, (in Physics:-Version) unable to determine the Physics Updates version, could you please report the problem to support [at] maplesoft [dot] com

     

    • Maplesoft will work to improve package updating in future versions of Maple.
    • In Maple 2022.2, the workaround is to install and/or update the Maplesoft Physics Updates using the MapleCloud toolbar.

    An example of uniform motion along a generalized coordinate using the Draghilev method. (This post was inspired by school example in one of the forums.)
    The equations used in the program are very simple and, I think, do not require any special comments. DM is a procedure that implements the Draghilev method with "partial parameterization".

    DM_V.mw

    When K = 1, parameterization is carried out by changing the angle of rotation of the wheel. That is, uniform rolling is carried out.

    For K = 4, the coordinate corresponding to the position of the slider is parametrized.

     

    When K = 6, the slider moves with acceleration, according to a given equation. Hence, we have carried out the parameterization with respect to “time”.



    With the help of such techniques, we can obtain the calculation of the kinematics of both lever mechanisms and various types of manipulators.

     

    Have you heard of Maple Scripting before? Do you want to extend your Maple Learn documents with your Maple knowledge? Scripting is the process of using Maple to create Maple Learn documents. If you’re already used to Maple, this may be a piece of cake for you, but we wanted to start from the basics for anyone who wants to extend their Maple Learn and Maple knowledge. This process can be used for many different types of documents, from quizzes to intensive 3D visualizations.

    So, let’s get started! All Maple Learn document scripting needs the DocumentTools:-Canvas package. The canvas, as you know, is that white space in a Maple Learn document. Therefore, this package is the core content of a scripted document! Always put:

    with(DocumentTools:-Canvas):

    At the top of your code, or put

    uses DocumentTools:-Canvas:

    At the start of your procedures.

    Now that we’ve told Maple to use the DocumentTools:-Canvas, we need to create a canvas.

    Canvases are created as variables, using the command NewCanvas. Inside NewCanvas, you will add a square-bracket list of all the content you want to see inside. For now, just know that you can add text cells with Text(“YOUR TEXT”) and a math cell with Math(YOUR MATH). On the next line, make sure to put either ShareCanvas(YOUR CANVAS VARIABLE) or ShowCanvas(YOUR CANVAS VARIABLE).  ShareCanvas creates a Maple Learn sharelink, while ShowCanvas shows the canvas directly in Maple. Note that ShowCanvas does not have every Maple Learn feature, but makes quick work of fast error checking.

    canvas := NewCanvas([Text(“My first canvas”), Math(3*x+2*y)]):
    
    ShareCanvas(canvas);

    There are two more things I want to show you in this post: How to make a group have multiple cells (instead of just the one), and how to position your items on the canvas. Let’s start with group making.

    To create a group with multiple cells, use the Group() command within the NewCanvas command, and separate the cells with commas, in a list. You don’t need to specify Text() or Math() when using Group().

    canvas := NewCanvas([Group([“This is the first cell…”, “The second….”, “and the third.”])]):

    At the end of any command/canvas element, within the brackets, you can define position=[x,y] to specify where on the canvas the object should go. You can adjust the precision pixel by pixel until you are happy with the layout.

    When we put all these together, we get code that looks like this:

    with(DocumentTools:-Canvas):
    
    canvas := NewCanvas([
    
    Group(["This is the first cell…", "The second…", "and the third."], position=[200,200]),
    
    Math(3*x+2, position=[100,100]),
    
    Text("This is text!", position=[400,400])]):
    
    ShareCanvas(canvas);

    And in the end, your scripted document looks like this.

    We hope this helps you get started with Maple Scripting. There will be another post on even more of what we can do with Maple Scripting, and how we can make these documents even more interactive. Let us know if there’s anything specific you want to see in that post!

     

    We've just released Maple Flow 2022.2. The update enhances the user experience in many areas, including user interaction, performance, and the interface.

    Performance is a signficant focus.

    • Maple Flow prioritizes the evaluation of the math you see on screen, giving you faster calculation updates for the part of the worksheet you’re working on, with more math being evaluated as you scroll down.
    • We also have more users developing larger documents. Adding white space to large documents, and interacting with sections is now more response and snappier.

    In response to many user requests for faster interaction, a new optional evaluation method lets you simply hit equals to evaluate math and display results.

    We've also refreshed the in-product Application Gallery with a new look and many new applications (this includes a library of section properties).


     

    You can also optionally restrict printing to the left-most column of pages, allowing you to have off-screen supporting calculations not displayed in the final report.

    You'll find a complete list of enhhacements here, and you can download the update here.

    There is something wrong with the search in mapleprimes. 

    I noted one users comment last week about using the search to find something being very difficult to find.  The results don't often match the search.  Only just this morning I was looking for something and the results were less than satisfying often pointing to a list of more results which didn't seem to help. 

    This has been a problem for a long time, is this going to be looked at or fixed soon?

    Greetings, fellow educators, researchers, engineers, students, and folx who love mathematics! 

     

    I believe in the importance of mathematics as a structure to our society, as a gateway to better financial decision making, and as a crucial subject to teach problem solving. I also believe in the success of all students, through self-discovery and creativity, while working with others to create their own knowledge. Consequently, I’ve designed my examples in the Maple Learn gallery to suit these needs. Many of my documents are meant to be “stand-alone” investigations, summary pages, or real-world applications of mathematical concepts meant to captivate the interest of students in using mathematics beyond the basic textbook work most curricula entail. Thus, I believe in the reciprocal teaching and learning relationship, through the independence and creativity that technology has afforded us. The following is an example of roller coaster track creation using functions. Split into a five part investigation, students are tasked to design the next roller coaster in a theme park, while keeping in mind the elements of safety, feasibility, and of course fun!

    Common elements we take for granted such as having a starting and ending platform that is the same height (since most coasters begin and end at the same location), boarding the coaster on a flat surface, and smooth connections between curves translate into modeling with functions. 

     

    Aside from interning with Maplesoft, I am an educator, researcher, student, financial educator, and above all, someone who just loves mathematics and wishes to share that joy with the whole world. As a practicing secondary mathematics and science teacher in Ontario, Canada, I have the privilege of taking what I learned in my doctorate studies and applying it to my classrooms on a daily basis. I gave this assignment to my students and they really enjoyed creating their coasters as it finally gave them a reason to learn why transformations of quadratics, amongst other functions, were important to learn, and where a “real life” application of a piecewise function could be used. 

    Graphical user interface, text, application, Word

Description automatically generated

     

    Having worked with the Ontario and International Baccalaureate mathematics curricula for over a decade, I have seen its evolution over time and in particular, what concepts students struggled to understand, and apply them to the “real world.” Concurrently, working with international mathematics curricula as part of my collaboration with Maplesoft, I have also seen trends and emergent patterns as many countries’ curricula have evolved to incorporate more mathematical literacy along with competencies and skills. In my future posts, you will see Maple Learn examples on financial literacy since working as a financial educator has allowed me to see just how ill prepared families are towards their retirement and how we can get lost amongst a plethora of options provided by mass media. Hence, I have 2 main goals I dedicate to a lifelong learning experience; financial literacy and greater comprehension of mathematics topics in the classroom. 

     

     

    Welcome back to another Maplesoft blog post! Today, we’re looking at how math appears in nature. Many people know that there’s math within the mysteries of nature, but don’t know exactly what’s going on. Today we’ll talk about some of the examples but remember that there’s always more.

    Let’s start with a well-known example: The Fibonacci sequence! This is a recursive sequence, made by adding the previous two terms together to make the next term. The Fibonacci sequence starts with 0, then 1. So, when modelling this sequence, you get “0, 1, 1, 2, 3, 5, 8,” and so on.

    Now, where can this sequence be seen? Well, the sequence forms a spiral. This spiral can be seen in fingerprints:

    Image: Andrea Greengard/Mindful Living Network

    Eggs:

    A picture containing orange, sport, pool ball

Description automatically generated

    Image: Andrea Greengard/Mindful Living Network

    And, in some cases, spiral galaxies. For more examples of the Fibonacci sequence, check out a blog on examples of the Fibonacci Sequence by Andrea Greengard!

    A picture containing star

Description automatically generated

    Image: Andrea Greengard/Mindful Living Network

    Another interesting intergalactic math fact is that celestial bodies are typically spherical, such as stars and planets. As well, orbits tend towards spherical, often being ellipses. It’s fascinating to see how many spheres there are in nature!

    Moving away from spirals in nature, another example of math in nature, although there are many more, is the Hardy-Weinburg Equilibrium.  When in Hardy-Weinburg Equilibrium, a population’s allele and genotype frequencies, in the absence of certain evolutionary factors, stay constant through generations. The Hardy-Weinburg Equilibrium is used to predict genotypes from phenotypes of certain populations, as one example. Come check out our documents on this topic for more details, both on the Hardy-Weinburg Equilibrium and some practice examples.

    Chart, line chart

Description automatically generated

    Image: Maplesoft

    In the end, math is incredibly ingrained in nature. We can use mathematical formulas and patterns to predict how plants will grow, or population genetics, and much more! Please let us know if there’s any examples you’d like to see in more depth, and we can see if writing a blog post on it is possible, or even a Maple Learn document for the gallery!

     

    Vectorial ODEs and vectorial integration constants

    In physics, it is traditional to work with vectors, as in analytic geometry, i.e. symbolic vectors, abstract as in `#mover(mi("A"),mo("→"))`, or projected into orthonormal basis such that the unit vectors appear explicitly. In Maple, that is implemented by the Physics:-Vectors  package. The underlying idea is the extension of the Maple computational domain to include a new category of objects: vectors, and related unit vectors and vectorial differential operators all based on `≡`(Nabla, VectorCalculus[Nabla]).

     

    But then, with paper and pencil, we frequently write vectorial differential equations, that when solved imply on vectorial integration constants, none of which were implemented; now they are, within the Maplesoft Physics Updates v.1341. As with everything new, there is more work to be done, mainly additional checks for consistency here and there, but the work is advanced; time to tell the story and we are grateful in advance for the always useful opinions / corrections if any.

     

    The input/output below illustrate the new features, which by the way compose on top of the new subscripted arbitrary constants by dsolve; this time extended to also be vectorial. The presentation has for context typical material of a first undergrad course in Mechanics. The purpose, anyway, is only to illustrate the new solving of vectorial differential equations and vectorial integration constants.

    NULL

    Download Vectorial_ODEs_and_integration_constants.mw

    Edgardo S. Cheb-Terrab
    Physics, Differential Equations and Mathematical Functions, Maplesoft

    The first day of Maple Conference 2022 is coming up on November 2 and it's not too late to register! Please go to our conference home page and click on the "Register Now" button. This is a free virtual event open to all.

    The schedule is available on the conference agenda page.

    Come join us to see recent developments in research, education and applications, find out about new and upcoming features in our products, talk to Maplesoft staff and other members of the Maple community and view (and vote on) Maple and Maple Learn artwork.

    We hope to see you at the conference!

    It seems to me that Draghilev's method can be applied quite successfully to the solution of Diophantine equations. Here is a simple example where we find two solutions at the intersection line of two ellipsoids:
      x1^2-x1*x2+x2^2+x2*x3+x3^2-961=0;
      (x1-3)^2+10*x2^2+x3^2-900=0;

    Solutions: (11, -4, -26) and (10, 1, 29).

     


    Based on the text of the program, it is possible to solve various examples with Diophantine equations.
    3d_1.mw

    Explanations.
    f3 is an auxiliary equation for finding the starting point, NPar is a procedure that implements the Draghilev method, the red color of the text is the place where the integer values of the points on the integral curve are filtered.

     Can be compared with the solution of the
    isolve function
     

     restart:
      f1 := x1^2-x1*x2+x2^2+x2*x3+x3^2-961;
      f2 := (x1-3)^2+10*x2^2+x3^2-900;
      isolve({f1, f2})

     

    Any chance to have "Evaluate->Remove Output From Worksheet" become active and usable when one is still running something in the worksheet?  May be in 2023 version?

    This is something that has been missing in Maple for ages.

    Maple definitely slows down when the worksheet becomes full of output (from print messages) when a command has been running for long time. Now there is no way to remove the output in the worksheet until the command completes which can take hours. May be this slow down because the scrolling/writing to the worksheet slows down, and this affects how long it takes to complete as the engine is waiting for the frontend to finish writing to the worksheet?. I do not know. I just know Maple slows down when this happens.

    I do not understand why Maple can't implement this. Is there a tehnical reson which will make removing current output in the worksheet not possible while a command is running?

    First 17 18 19 20 21 22 23 Last Page 19 of 306