Product Tips & Techniques

Tips and Tricks on how to get the most about Maple and MapleSim

A Flow and Maple user wonders why Maple Flow may evaluate to high-precision, floating point numbers compared to the same commands used in Maple that evaluate to simple, concise answers.

 

 

We suggest the same results can be achieved by toggling the numeric/symbolic evaluation mode toggle in the Flow math container(s)

 

 

primes-flow-evaluation-modes.flow

 

For more information, please see section 3.5 of the Maple Flow User Manual (Numeric and Symbolic Evaluation Modes). 

We have just released updates to Maple and MapleSim.

Maple 2023.2 includes a strikethrough character style, a new unit system, improved behavior when editing or deleting subscripts, improved find-and-replace, better mouse selection of piecewise functions and the contents of matrices, and moreWe recommend that all Maple 2023 users install this update.

This update also include a fix to the problem with setoptions3d, as first reported on MaplePrimes. Thanks, as always, for helping us make Maple better.

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

At the same time, we have also released an update to MapleSim, which contains a variety of improvements to MapleSim and its add-ons. You can find more information on the MapleSim 2023.2 download page.

It’s finally here. The mystical treasure that has long been rumoured to lie deep within the labyrinthine halls of Maple Learn is within your grasp at last. The ordeals ahead are treacherous, and most who have ventured in have never returned… but, armed with nothing but your wits and your curiosity, you know you’re prepared to conquer the trials that await you. Can you be the first to uncover the secrets of Maple Learn?

A screenshot of the start screen of 'The Treasure of Maple Learn', which consists of colourful squares spelling the word 'START'.

A screenshot of the first room of the Treasure of Maple Learn. The text reads, 'A distant howl echoes through the dark, misty forest as you tread carefully past the towering trees. Many have walked this path seeking the legendary treasure within Maple Learn, but few have returned. You stop in front of a huge stone door, carved with ancient symbols.'

Surprise! We here at Maplesoft have decided to become game developers. Okay, maybe not really, but we do have one game that we’re excited to be sharing with you all. Introducing: The Treasure of Maple Learn. This series of documents mimics the style of a text-based adventure game, and takes you through a series of puzzles that challenge you to discover for yourself all of what Maple Learn has to offer. It was originally created by myself and a team of other co-op students during the 2021 Maplesoft Hackathon, and I’m very excited to be releasing this updated and polished version of the game. Finally, it’s time to set out on your quest to discover the legendary treasure that lurks within Maple Learn… if you dare.

If you don’t dare, don’t worry, we have other options. You can also check out our new video on Getting Started with Maple Learn, which takes you through everything you need to know to become a Maple Learn expert. And if that’s not enough learning Maple Learn for you, we also have an extensive collection of How-To documents. Want an in-depth look at how to use the plot window? How about an exploration of how to work with linear algebra? Or maybe you want to unleash your artistic side? We’ve got you covered.

So if you’re just getting started with Maple Learn and are looking for a tutorial, you’ve got options—we’ve got a quick video overview, tons of collections of in-depth documentation, and a quest through the treacherous depths of Maple Learn to uncover the secrets that lie within. Pick your poison! (But maybe watch out for literal poison in that labyrinth.)

 

Advanced Engineering Mathematics with Maple (AEM) by Dr. Lopez is such an art.

Mathematics and Control Theory talks easily in Maple...

Thanks Prof. Lopez. You are the MAN !!

Dr. Ali GÜZEL

The concept of “Maple Learn art” debuted on the MaplePrimes blog in December 2021.  Since then, we’ve come a long way with new Maple Learn features and ever-growing creative minds.  Creating art using mathematical expressions and shapes is a great way to hone both your mathematical skills and your creativity, and is the perfect break from a bout of studying or the like.

I started my own Maple Learn art journey over one year ago.  Let’s see how one’s art can improve over time using new and advanced features!

Art with Shapes, March 2022

This pi-themed pie is simple and cute, but could use some additional features:

Adding Shaded() around Maple Learn shape commands colors them in!

Fun fact: I hand-picked all of the coordinates for that pi symbol.  It was an arduous but rewarding process.  Nowadays, I recommend a new method.  When you create a table in Maple Learn with two number columns, the values are plotted as points.  These points can be clicked and dragged across the plot window, and the table updates automatically to display the new coordinates.  How can you use this to make art?

  1. Create a table as described above.
  2. Move the points with your mouse to create an outline of the desired shape.
  3. Use the coordinates from your table in your geometry command.

Let’s apply these techniques in a newer piece: a full recreation of the spaghetti emoji!

Art with Shapes, August 2023

Would you look at that?!  Fully-shaded colors, a background, and lines of spaghetti noodles that weren’t painstakingly guesstimated combine to create a wonderfully improved piece of art.

Art with Animation, March 2022

Visit the document to see its animation.  Animation is an invaluable feature in Maple Learn, frequently utilized to observe how changing variables affect functions or model a concept.  We’ve harnessed its power for animated artwork!  This animation is cute, using parametric functions and more to change the image as the animation variable changes.  Like the previous piece, it’s missing a background, and the leaves overlap the stem awkwardly in some places.

Art with Animation, August 2023

 

This piece has a simple background made with a large black square, but it enhances the overall effect.

The animation here comes from piecewise functions, which display different values based on a given criterion.  In this case, the criterion is the current value of the animation variable.

There are 32 individual polygons in this image (including 8 really tiny ones along the edges!) and 8 rainbow colors.  Each color is associated with a different piecewise function, and displays four random squares in that color in each frame of the animation.

This image isn’t that much more advanced than the animated flower, but I think the execution has vastly improved.

Whether you’ve been following these blog posts since December 2021 or are new to Maple Learn, we hope you give Maple Learn art a try.

And don’t forget that Maple is also a goldmine of artistic potential.  Maple’s bountiful collection of packages such as Fractals, ColorTools, plottools and more are great places to start for math that is as aesthetically pleasing as it is informative.

This week, our staff participated in a series of art challenges using either Maple Learn or Maple itself, each featuring a suggested theme and suggested mathematical content.  Check out the challenges and some of our employees’ entries below, and try out a challenge for yourself!

 

Tuesday’s Art Theme: Pasta

Mathematical Content: Shapes

Example: Lazar Paroski’s spiraling take on spaghetti

 

Wednesday’s Art Theme: Nature

Mathematical Content: Fractals

Example: John May’s Penrose tiling landscape (in Maple!)

 

Thursday’s Art Theme: Disco

Mathematical Content: Animation

Example: Paulina Chin’s disco ball (in Maple!)

 

Friday’s Art Theme: Space

Mathematical Content: Color

Example: that’s today!  Who knows what our staff will create…?

 

We hope these prompts have inspired you! If you create some art you’re really proud of, consider submitting it to be featured in the 2023 Maple Conference’s Creative Works Showcase.

Hi
It's been years since expressions like A %* B %+ C involving inert arithmetic operators used in infix form are correctly understood (parsed) when written on a 1D-Math input line. The idea is simple: have the operators %. %*, %+, %-, %^, %/ work on input as infix operators the same way their active forms: ., *, +, -, ^, / do. This useful functionality, however, remained elusive when using 2D-Math input notation, so one would have to resort to using the functional form of the operators. E.g., input the above as `%+`(`%*`(A, B) ,C), which for me is really ugly. Besides being a bit demoralizing: we do all this fuzz about how great computer algebra and 2D-Math input notation is, and then input things in that way …

So this is to mention that this elusive functionality of inert arithmetic operators used in infix form within a 2D-Math input line now works. The novelty is present in the latest Maplesoft Physics Updates for Maple 2023, which is version 1490. As usual, to install the Updates open a Maple worksheet and input Physics:-Version(latest).

Here is an image (worksheet at the end) showing the new thing


The implementation is pretty new; reports of anything related to these inert operators not displayed/working as you'd expect are much appreciated. 


Download Inert_arithmetic_operators_in_2D_Math.mw

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

Maple introduced "Copy as LaTeX" a few versions ago and I have used this feature exensively when it suddenly stopped working.

After som experiments I found the root cause and easy (but irritating) workaround for OSX

Problem:

"Copy as LaTeX" suddenly stops working ("Copy as MathML" still works fine)

Cause:

This problem appears if in “Display Setting”-tab in settings dialogue the “Input display” is set to “Maple Notation

In that case all attempts on “Copy as LaTeX” will be a null-function and not move anything at all into the copy buffer.

The “Copy as MathML” is not affected by this in the same way.

I have confirmed this on OSX in Maple versions 2022, 2023, and 2024

Workaround:

Adjusting “Display Setting”-tab in settings dialogue so that the “Input display” is set to “2-D Math” and “Apply Globally” makes it work again.

A bit annoying as a prefer the maple notation input and I cannot have this setting if I want the copy to latex to work.

Note:

in OSX this can also be fixed by removing the Maple preferences file and letting Maple restore it.

~/Library/Preferences/Maple/2023/Maple Preferences

Edit: Added 2024 as affected version.

Maple's fsolve command can quickly solve expressions involving large floating point numbers where the (symbolic) solve command can take much longer attempting to solve the equivalent rational expression. For example, consider the following worksheet:

restart;

sys := {a + b^0.2784982189 = c+1, b + c^0.9575068354 = a+2, c + a^0.1576130817 = b+3};

{a+b^.2784982189 = c+1, b+c^.9575068354 = a+2, c+a^.1576130817 = b+3}

(1)

fsolve_start:=time[real]():

fsolve(sys);

{a = 3.561242843, b = 1.994950678, c = 3.773320855}

(2)

fsolve_elapsed_seconds:= time[real]()-fsolve_start;

0.50e-1

(3)

solve_start:=time[real]():

###warning, the following command may crash and/or execute indefinitely###

solve(sys);

solve_elapsed_hours:=(time[real]()-solve_start)/3600;


 

Download solve-fsolve-primes.mw

We have just released updates to Maple and MapleSim.

Maple 2023.1 includes improvements to the math engine, Plot Builder, import/export, and moreWe recommend that all Maple 2023 users install this update.

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

In particular, please note that this update includes fixes to problems with Quantifier Elimination and Group  Theory, and improves performance after a period of inactivity, all of which were reported on MaplePrimes. Thanks for the feedback!

At the same time, we have also released an update to MapleSim, which contains a variety of improvements to MapleSim and its add-ons. You can find more information on the MapleSim 2023.1 download page.

Sometimes, it’s the little things. Those little improvements that make a good tool even better. Sometimes, it’s as simple as an easy shorthand notation that allows you to create and label points on a graph with a single command. Just to pick a totally random example.

 

A screenshot of a Maple Learn document containing a math cell and a plot. The math cell reads 'A(1,2)'. The plot show a point plotted at (1,2) with the label 'A'.

Okay, maybe it’s not totally random. Maybe this new point notation is one of our newest features in Maple Learn, and maybe it’s now easy and quick for you to create labeled points to your heart’s content. Maybe you could learn more about all the ins and outs of this new feature by checking out the how-to document.

But I can’t make any guarantees, of course.

That said, if this hypothetical scenario were true, you would also be able to see it in action in our new document on the proof of the triangle inequality.

A screenshot of a Maple Learn document. The left side shows an explanation of how the triangles are constructed for Euclid's proof of the triangle inequality. The right side shows an adjustable graph of said triangles.

With this document, you can explore a detailed (and interactive!) visualization of the proof using Euclidean geometry. You can adjust the triangles to see for yourself that the sum of the lengths of any two sides must be greater than the third side, read through the explanation to see the mathematical proof, and challenge yourself with the questions it leaves you to answer. And those points on those triangles? Labeled. Smoothly and easily. I wonder how they might have done it?

We hope you enjoy the new update! Let us know what other features you want to see in Maple Learn, and we’ll do our best to turn those dreams into reality.

We all know that math is beautiful in and of itself—but sometimes students might need a little convincing. What better way to do that then sprucing up your math with a little colour? With Maple Learn, plot colours are fully customizable. We have several colour palettes to choose from—want your document to evoke the delicate tones of springtime? Looking for a palette that’s colourblind friendly? Or maybe you’re just nostalgic for the colours of Maple V? All these options and more are available for making your graphs colourful and coordinated. But maybe you’re the kind of person who wants to go against the grain, and you laugh in the face of predetermined colour coordination. Don’t worry, we’ve got you covered too! With our colour selector, you can also choose your own custom colours. The full colour spectrum is right at your fingertips. To learn more about how to customize the colours on your document, check out this How-To guide.

And of course, the potential for colour inevitably leads to the potential for art. Our Maple Learn Art Gallery has plenty of fun and colourful works you can admire and contemplate (and maybe even draw inspiration from!). One of our most recent and most colourful additions is this document showcasing the history of the rainbow pride flag, in honour of June being Pride Month. You can use the slider to move through time, letting you see how the colours on the flag evolved and read about the meanings behind them. And, thanks to the colour selector, the colours match the precise shades used for the original flags! That’s the magic of hexadecimal colours for you.


Hold on—the magic of hexadecimal colours, I hear you ask? What an enticing concept. If only we had some kind of document, perhaps one made in Maple Learn, that explained how hexadecimal colours worked and included an interactive example so that you could easily see how the red, green, and blue colour values blend together to create any given colour… Too bad we don’t!

Just kidding. Of course we do.

If all these colours have inspired you, be sure to check out our Call for Creative Works for the upcoming Maple Conference! Maybe your colourful creation could be this year’s winner.

Ever wonder how to show progress updates from your executing code without printing new lines each time?

One way to do this is to use a TextArea component and the DocumentTools package. The TextArea could be inserted from the Components Palette in Maple, or programmatically like so:

restart;

with(DocumentTools):

with(DocumentTools:-Components):

with(DocumentTools:-Layout):

s := "0": #initial text value

T := TextArea(s, identity = "TextArea0"):
xml := Worksheet(Group(Input(Textfield(T)))):

insertedname:=InsertContent(xml)[1,1]: #find the inserted component name in case changed

for i to 10 do #start the demonstration procedure
   Threads:-Sleep(1);
   SetProperty(insertedname,value,sprintf("%d",i),refresh=true);
end do:

Maplets:-Examples:-Message("Done");


Download text-area-update-progress.mw

This post discusses a solution for modeling a traveling load on Maplesim's Flexible Beam component and provides an example of a bouncing load.

The idea for the above example came from an attempt to reproduce a model of a mass sliding on a beam from MapleSim's model gallery. However, reproducing it using contact components in combination with the Flexible Beam component turned out to be not straightforward, and this will be discussed in the following.

To simulate a traveling load on the Flexible Beam component, one could apply forces at discrete locations for a certain duration. However, the fidelity of this approach is limited by the number of discrete locations, which must be defined using the Flexible Beam Frame component, as well as the way in which the forces are activated.

One potential solution to address the issue of temporal activation of forces is to attach contact elements (such as Rectangle components) at distinct locations along the beam, which are defined by Flexible Beam Frame components, and make contact using a spherical or toroidal contact element. However, this approach also introduces two new problems:

  • An additional bending moment is generated when the load is not applied at the center of the contact element's attachment point, the Flexible Beam Frame component. Depending on the length of the contact element, deformations caused by this moment can be greater than the deformation caused by the force itself when the force is applied at the ends of the contact element. Overall, this unwanted moment makes the simulation unrealistic and must be avoided.
  • When the beam bends, a gap (see below) or an overlap is created between adjacent Rectangle components. If there is a gap, the object exerting a force on the beam can fall through it. Overlaps can create differences in dynamic behavior when the radius of curvature of the beam is on the opposite side of the point of contact.

To avoid these problems, the solution presented here uses an intermediate kinematic chain (encircled in yellow below) that redistributes the contact force on the Rectangle component on two support points (ports to attach Flexible Beam Frame components) in a linear fashion.

 

 

To address gaps, the contact element (Rectangle) attached to the kinematic chain has the same width as the chain and connects to the adjacent contact elements via multibody frames. In the image below, 10 contact elements are laid on top of a single Flexible Beam component, like a belt made out of tiles. The belt has to be pinned to the flexible beam at one location (highlighted in yellow). The location of this fixed point determines how the flexible beam is loaded by tangential contact forces (friction forces) and should be selected carefully.

 

 

Some observations on the attached model:

  • Low damping and high initial potential energy of the ball can result in a failed simulation (due to constraint projection failure). Increasing the number of elastic coordinates has a similar effect. Constraint projection can be turned off in the simulation settings to continue simulation.
  • The bouncing ball excites several eigenmodes at once, causing the beam to wiggle chaotically in combination with the varying bouncing frequency of the ball. A similar looking effect can also be achieved with special initial conditions, as demonstrated with Maple in this excellent post on Euler beams and partial differential equations.
  • Repeated simulations with low damping lead to different results (an indication of chaotic behavior; see three successive simulations below (gold) compared to a saved solution(red)). The moment in the animation when the ball travels backward represents a metastable equilibrium point of the simulation. This makes predictions beyond this point difficult, as the behavior of the system is highly dependent on the model parameters. Whether the reversal is a simulation artifact or can happen in reality remains to be seen. Overall, this example could evolve into a nice experimental fun project for students.

  • Setting the gravitational constant for Mars, everything is different. I could not reproduce the fun factor on Earth. A reason more to stay ,-)

Ball_bouncing_on_a_flexible_beam.msim

 

 

# countourplot3d piggybacks on top of plot3d.
# For the "coloring=[lowColor, highColor]", the "filledregions=true" option must be present.
# If "filledregions=true" is not present, plot3d will throw an error.
# This code shows the three cases, only one of which will work.
Note to support. I cannot add a new tag. contourplot3d should be a tag.

restart;
with(plots);
with(ColorTools);
cGr4s := Color([0.50, 0.50, 0.50]);
contourplot3d(-5*d/(d^2 + y^2 + 1), d = -3 .. 3, y = -3 .. 3, color = black, thickness = 3, coloring = [cGr4s, cGr4s], contours = [-2, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, 2]);
contourplot3d(-5*d/(d^2 + y^2 + 1), d = -3 .. 3, y = -3 .. 3, filledregions = false, color = black, thickness = 3, coloring = [cGr4s, cGr4s], contours = [-2, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, 2]);
contourplot3d(-5*d/(d^2 + y^2 + 1), d = -3 .. 3, y = -3 .. 3, filledregions = true, color = black, thickness = 3, coloring = [cGr4s, cGr4s], contours = [-2, -1.5, -1, -0.5, 0, 0.5, 1, 1.5, 2]);

 

The recent Maple 2023 release comes with a multitude of new features, including a new Canvas Scripting Gallery full of templates for creating interactive Maple Learn documents.

The Maple Learn Scripting Gallery can be accessed through Maple, by searching “BuildInteractiveContent Maple2023” in the search bar at the top of the application and clicking on the only result that appears. This will bring you to the help page titled “Build and Share Interactive Content”, which can also be found by searching “scripting gallery” in the search bar of a Maple help page window. The link to the Maple Learn Scripting Gallery is found under the “Canvas Scripting” section on this help page and clicking on it will open a Maple workbook full of examples and templates for you to explore.

The interactive content in the Scripting Gallery is organized into five main categories – Graphing, Visualization, Quiz, Add-ons and Options, and Applications Optimized for Maple Learn – each with its own sub-categories, templates, and examples.

One of the example scripts that I find particularly interesting is the “Normal Distribution” script, under the Visualizations category.

 

 

All of the code for each of the examples and templates in the gallery is provided, so we can see exactly how the Normal Distribution script creates a Maple Learn canvas. It displays a list of grades, a plot for the grade distribution to later appear on, math groups for the data’s mean and variance, and finally a “Calculate” button that runs a function called UpdateStats.

The initial grades loaded into the document result in the below plot, created using Maple’s DensityPlot and Histogram functions, from the Statistics package. 




 

The UpdateStats function takes the data provided in the list of grades and uses a helper function, getDist, to generate the new plot to display the data, the distribution, the mean, and the variance. Then, the function uses a Script object to update the Maple Learn canvas with the new plot and information.

The rest of the code is contained in the getDist function, which uses a variety of functions from Maple’s Statistics package. The Normal Distribution script takes advantage of Maple’s ability to easily calculate mean and variance for data sets, and to use that information to create different types of random variable distributions.

Using the “Interactive Visualization” template, provided in the gallery, many more interactive documents can be created, like this Polyhedra Visualization and this Damped Harmonic Oscillator – both from the Scripted Gallery or like my own Linear Regression: Method of Least Squares document.


 

Another new feature of Maple 2023 is the Quiz Builder, also featured in the Scripting Gallery. Quizzes created using Quiz Builder can be displayed in Maple or launched as Maple Learn quizzes, and the process for creating such a quiz is short.

The QuizBuilder template also provides access to many structured examples, available from a dropdown list:


As an example, check out this Maple Learn quiz on Expected Value: Continuous Practice. Here is what the quiz looks like when generated in Maple:


 

This quiz, in particular, is “Fill-in the blank” style, but Maple users can also choose “Multiple Choice”, “True/False”, “Multiple Select”, or “Multi-Line Feedback”. It also makes use of all of the featured code regions from the template, providing functionality for checking inputted answers, generating more questions, showing comprehensive solutions, and providing a hint at the press of a button.

Check out the Maple Learn Scripting Gallery for yourself and see what kinds of interactive content you can make for Maple and Maple Learn!

 

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