## Scripting Maple Learn Documents

by: Maple 2022 Maple Learn

Have you ever wanted to create practice problems and quizzes that use buttons and other features to support a student making their way to an answer, such as the following?

Let’s take a look at how you can use Maple 2022 to create documents like these that can be deployed in Maple Learn. I know I’ve always wanted to learn, so let’s learn together. All examples have a document that you can use to follow along, found here, in Maple Cloud.

The most important command you’ll want to take a look at is ShareCanvas. This command generates a Maple Learn document. Make sure to remember that command, instead of ShowCanvas, so that the end result gives you a link to a document instead of showing the results in Maple. You’ll also want to make sure you load the DocumentTools:-Canvas subpackage using with(DocumentTools:- Canvas).

If you take a look at our first example, below, the code may seem intimidating. However, let’s break it down, I promise it makes sense!

```with(DocumentTools:-Canvas);
cv := NewCanvas([Text("Volume of Revolution", fontsize = 24), "This solid of revolution is created by rotating", f(x) = cos(x) + 1, Text("about the y=0 axis on the interval %1", 0 <= x and x <= 4*Pi), Plot3D("Student:-Calculus1:-VolumeOfRevolution(cos(x) + 1, x = 0 .. 4*Pi, output = plot, caption=``)")]);
ShareCanvas(cv);
```

The key command is Plot3D. This plots the desired graph and places it into a Maple Learn document. The code around it places text and a math group containing the equation being graphed.

Let’s take a look at IntPractice now. The next example allows a student to practice evaluating an integral.

```with(Grading):
```

This command allows you to enter an integral and the variable of integration, and then evaluates each step a student enters on their way to finding a result. The feedback given on every line is incredibly useful. Not only will it tell you if your steps are right, but will let you know if your last line is correct, i.e if the answer is correct.

```with(Grading):
SolvePractice(2*x + 3 = 6*x - 9, 'output' = 'link');
```

This command takes an equation, and evaluates it for the specified variable. Like the IntPractice command, this command will check your steps and provide feedback. The image below shows how this command looks in Maple 2022.

These commands are the stepping stones for creating practice questions in Maple Learn. We can do so much more in Maple 2022 scripting than I realized, so let’s continue to learn together!

Some other examples of scripted documents in the Maple Learn Document Gallery are our steps documents, this document on the Four Color Visualization Theorem, and a color by numbers. As you can see, there’s a lot that can be done with Maple Scripting.

Let us know in the comments if you’d like to see more on Maple 2022 scripting and Maple Learn.

## Equation Extraction for Kinematics

MapleSim is a fantastic tool to model multi-domain physical systems at a level that was unthinkable not so long ago. This post is about a simple problem that can be solved by hand, but where I failed with MapleSim using online resources.

For some time, I have been looking for answers to two questions:

• How to control which variables (and parameters) are included in MapleSims equation exports? This question is crucial to derive forward and inverse kinematics.
• Can the Equation Extraction App (in principle) provide a similar set of equations than the Multibody Analysis App? This question is rather academic until multidomain exports are desired (which the Multibody Analysis can’t provide).

The attached model helped me to clarify a few things and discover a real hidden secret (at least it was for me). I hope it can help others.

The model is a rather simple 3DOF mechanism. The task was to get a set of equations to derive the two rotations and the one displacement of the mechanism as a function of x,y,z coordinates.

After watching videos and inspecting models from the model gallery on inverse kinematics, I placed motion drivers for the input variables, added sensors for the output variables and wrapped the mechanism into a subsystem. However, as explained in more detail in the attachment, the set of exported variables was incomplete in both apps (AEs exports in the Equation Extraction Export and Position Constraints in the Multibody Analysis Export). Furthermore, the number of extracted equations did not match the three degrees of freedom.

After numerous trials it turned out that in addition to the motion drivers and sensors, initial conditions (ICs) had to be set. This is the hidden secret.  The crucial initial conditions (detailed in the attachment) are not required to assemble and run the model. So, introducing them temporarily for equation extraction is not obvious and never came to my mind. Setting ICs is, if I am not completely mistaken, also not highlighted in the documentation. This little trick of additionally setting initial conditions answered the above questions positively (at least for this 3DOF mechanism). In fact, it worked so well that all other failed attempts of conditioning the model for equations extraction worked immediately:

• Immobilizing the assembly with a Fixed Frame (using parameters for the fixed frame position to represent input variables; the fixed frame can be inside or outside the subsystem model).
• Using one Prescribed Translation component Instead of 3 motion drivers
• Using variables to pass motion signals into the model subsystem instead of using signals and ports (using From variable and To Variable components)

These attempts underline the effort and the time spend to get the relevant equations for that simple problem. As it turned out, all approaches work but are not even required for the mechanism. The key to success was setting the ICs of the joints.  One can even strip the model down to its skeleton (removing all motion drivers and sensors as in the screen shot bellow) and still get the desired simple set of equations, provided the ICs are set.

It has to be noted, that the mechanically coupled (highlighted in yellow) prismatic joints contributed to the problems: MapleSim does not seem to take this mechanical constraint into account (as I would have expected). The ICs of both coupled components must be set to get the three equations containing all desired in and output variables.

If my finding is correct and of general relevance, I like to suggest including such kind of tips and tricks in training or reference material.  From an application engineer or developers’ perspective, knowing the underlying algorithms, its probably obvious what has to be done. But from a user’s perspective MaplsSim is a black box that works magically well in most cases. If it does not, trial and error is often the only alternative to make it work, because models are either too complex or too confidential to be shared with others.

What I am addressing here is only the initial step of getting the desired equations. There is more to master. Save manipulation of equations too big to be inspected visually is also important. This has been well covered in several videos. Unfortunately, the quality of some of the footage does not allow to capture details of Maple commands. If possible, such material should be updated or replaced.

Overall, a collection of tips&tricks and dos&don’ts could establish some kind of best practice in deriving kinematics. If others would share their experience and findings, we all could save allot of time. A collection of valuable posts, questions, models, videos, and webinars could be a start. This collection not necessarily has to meet the high Maple standards of mathematical exactness and consistency. Engineers also accept pragmatic solutions to solve a problem.

If my findings are incorrect or you have better advise, please let us know.

MBA_and_equation_extraction.msim

## Maple Flow 2022 Takes Off!

by: Maple Flow

We’ve just released Maple Flow 2022!

The name of the product – Flow - references a psychological concept known as the flow state. You might know it as being in the zone. That’s when you’re so immersed in your present task that outside distractions melt away, your problem solving skills are firing on all four cylinders, and feel-good neurochemicals flood your brain.

Maple Flow supports a mathematical flow state through a simple design that productively guides the loosely structured and somewhat haphazard way that most people work.

Since Maple Flow's release a year ago, we've regularly added new features through updates, and we're commited to maintaining that momentum. These updates are driven by user feedback, so keep sending your comments and requests my way.

Here’s what we have lined up for you in Flow 2022.

Flow 2022 features a new in-product help system - see it in action here:

In addition to copying & pasting equations and expressions from a help page, you can open entire help pages as worksheets. The nature of Flow means that the help pages have a certain immediacy that becomes very tangible once you start working with them.

You can change the background colour of containers to highlight important results or draw the reader's attention to specific groups of containers.

Prior versions of Flow were a toolbox that needed to be installed on top of Maple.

Now, Flow 2022 is completely standalone, and does not require an existing installation of Maple.This makes managing an installation of Flow far simpler.

A new options menu let you specify how you want worksheet hyperlinks to open – in the same application window, or in a new application window.

## Maple Learn Spotlight: Nonograms and Games!

by: Maple Learn

If you do as much math as I do, you’ll likely agree that it’s important to take breaks from intensive work.  However, sometimes one wants to keep one’s mind stimulated with math.  This makes mathematical puzzles and games a perfect respite.  Alternatively, even if you don’t do as much math professionally, math puzzles are a fun and easily-accessible way to keep your mind sharp.  Games like sudoku and Rubik’s cubes are incredibly popular for good reason.

My personal favourite math puzzle is the nonogram, sometimes called hanjie, picross, or picture cross.  The game presents players with a blank grid of squares and clues indicating which ones should be colored in.  When the puzzle is solved, the colored squares depict a simple image.  You can read more thorough instructions here.

Nonograms are now available in Maple Learn!  These documents are coded using Maple scripts which can be viewed online in Maple Learn.  The document collection has pre-made puzzles and randomly-generated puzzles, and now you can create your own!  Use this document to create an image, and follow the instructions therein to generate the interactive puzzle.  Once you’ve created your own Maple Learn nonogram, use the sharelink to send it to friends!  Also keep your eye on the entire Maple Learn games collection for more in the future!

## Searching for Variables in a Procedure

Maple

A user of ours came up with an interesting request: taking a procedure name as an argument and then within the procedure, return a set containing the names of all variables within the procedure. This task can be accomplished in one of two ways, one with local variables, one with global variables.

One method is:

```find_vars_in_proc(f :: procedure, \$)
return {op(2, eval(f))};
end proc;```

for variables that Maple unambiguously determines to be local variables. For global variables, a slight variation appears as:

```find_vars_in_proc(f :: procedure, \$)
return {op(2, eval(f)), op(6, eval(f))};
end proc;```

As always, typing ?procedure directly in the worksheet brings up the help guide containing more information on operands of a procedure!

## Mises à jour de Maple Learn - Combinaisons

by: Maple Learn

Bon vendredi à tous! Je suis de retour avec un autre article de mise à jour détaillant les nouveautés que nous avons apportés à Maple Learn cette semaine. Bonne lecture!

Tout d'abord, nous avons ajouté des permutations et des combinaisons, ainsi que la notation binomiale, à Maple Learn ! Gardez l’œil à l’affût des documents utilisant ces nouvelles fonctionnalités et consultez nos exemples ici et ici. Les opérations se trouvent dans la palette des fonctions. Nous espérons que cela permettra de rendre votre création de document avec Maple Learn encore plus agréable !

Nous avons également mis à jour la syntaxe des graphiques paramétriques pour utiliser l'opérateur tel que. Veuillez consulter notre page d’instruction pour plus de détails (ici). Remplacez simplement la virgule de l'ancienne syntaxe par le |. À partir de là, placez vos restrictions et le tour est joué ! Un graphique paramétrique utilisant l'opérateur tel que.

Enfin, quelques changements mineurs à Maple Learn. Nous avons ajusté la taille de police par défaut à une police de taille 20. De plus, nous avons fait en sorte qu'il remplace automatiquement <= ou >= par le symbole ≤ ou ≥.

J'espère que ces nouvelles fonctionnalités sont tout aussi intéressantes pour vous qu'elles le sont pour moi ! Faites-nous savoir ce que vous pensez dans les commentaires ci-dessous.

## Maple Learn Combinations Update

by: Maple Learn

Happy Friday everyone! I’m back with another update post detailing the new changes we’ve made to Maple Learn this week. Just keep reading, and we’ll get right into them.

First, we’ve added permutations and combinations, along with binomial notation, to Maple Learn! Keep an eye out for documents using these new features, and check out our examples here and here.  The operations can be found in the functions palette. We hope that this allows even more fun with documents on Maple Learn!

We’ve also updated the syntax for parametric plots to use the such that operator. Please see our how-to page for more detail (here). Simply replace the comma from the old syntax with the |. From there, place your restrictions, and voila! A parametric plot using the such that operator.

Finally, some minor changes to Maple Learn. We’ve adjusted the default font size to 20 point font. As well, we’ve made it automatically change <= or >= to the ≤ or ≥ symbol.

I hope these new features are just as exciting to you as they are to me! Let us know what you think in the comments below.

## length command

Users often wonder how the length(expr) command works.

length(expr) returns the length of expr.

## Maple Learn document spotlight: Probability

by:

Probability is a field of mathematics that sees extensive use outside of academics.  Whether one’s checking the likelihood of rain on a weather app or the odds of winning the lottery, probability is everywhere.  My favorite application of probability is dice games like Dungeons and Dragons.  The game can be played very simply (choose to attack a monster, roll a 20-sided-die, try to exceed a certain number) or with a complexity that rivals high school math courses.  There are spells and abilities that modify one’s dice rolls, such as adding additional rolls to the total or rerolling the die and using the higher result.  A good player regularly asks themself when to activate certain buffs and how likely they are to succeed with or without them.

All of these questions boil down to the basics of probability.  Things that one learns in an introductory statistics course extend into countless applications.  Currently, I’m adding some of that knowledge to the Maple Learn document gallery, and I’m here to give a sneak peek.

First, I’ve built tree diagrams in Maple Learn.  Tree diagrams are a way to map probability across multiple events occurring in sequence.  Each branching path represents a series of events that have a specified probability of occurring.

Here’s an example: one morning I flip a coin to decide if I buy a lottery ticket.  If it’s heads, I do.  If I buy the ticket, I have a one in a million chance of winning the cash prize.  Drawn as a tree diagram…

I drew this using Maple Learn line, point, and label operations.

My new D&D-themed documents are a bit more exciting.  In the first, we explore a tree diagram with variable probabilities.  A brave hero makes their way into a dungeon, attacking any random monster they see.  How likely are they to land an attack?  Adjust the details of the question and watch the diagram change.

In the second, I used Maple program scripting to add a live randomized dice roller.  Many probability techniques are at play to analyze which of two buffs will do more good for a dice-rolling adventurer.

I plan on making more documents like these; keep your eyes on the Document Gallery probability collection for updates.

## Nouveau document vedette Maple Learn : Probabilité...

by:

Les probabilités sont  un domaine des mathématiques largement utilisé en dehors des universités. Que l'on vérifie la probabilité de l’apparition de la pluie sur une application météo ou les chances de gagner à la loterie, les probabilités sont partout. Mon application des probabilités préférée est les jeux de dés comme Donjons et Dragons. Le jeu peut se jouer très simplement (choisir d'attaquer un monstre, lancer un dé à 20 faces, essayer de dépasser un certain nombre) ou avec une complexité qui rivalise avec les cours de mathématiques du lycée. Il existe des sorts et des capacités qui modifient les lancés de dés, comme ajouter des lancés supplémentaires au total ou relancer le dé et utiliser le résultat le plus élevé. Un bon joueur se demande régulièrement quand activer certains « buffs » et quelle est la probabilité qu'ils réussissent avec ou sans eux.

Toutes ces questions se résument aux bases des probabilités. Les choses que l'on apprend dans un cours d'introduction aux statistiques s'étendent à d'innombrables applications. Actuellement, j'ajoute certaines de ces connaissances à la galerie de documents Maple Learn je voulais vous en donner un aperçu.

Tout d'abord, j'ai construit des arbres de probabilité avec Maple Learn. Ceux-ci permettent de représenter graphiquement la probabilité de plusieurs événements se produisant en séquence. Chaque chemin de branchement représente une série d'événements qui ont une probabilité de se produire spécifique.

Voici un exemple : un matin, je lance une pièce pour décider si j'achète un billet de loterie. Si c'est face, je le fais. Si j'achète le billet, j'ai une chance sur un million de gagner l’argent. Dessiné sous forme d'arbre de probabilité…

J'ai dessiné ceci en utilisant les fonctionnalités ligne, point et étiquette de Maple Learn.

Mes nouveaux documents sur le thème de D&D sont un peu plus intéressants. Dans le premier, nous explorons un arbre de probabilités variables. Un héros courageux se rend dans un donjon, attaquant n'importe quel monstre aléatoire qu'il voit. Quelle est la probabilité qu'ils lancent une attaque ? Ajustez les détails de la question et regardez le diagramme changer.

Dans le second, j'ai utilisé la fonction script de Maple pour ajouter un lanceur de dés aléatoire en direct. De nombreuses techniques de probabilité sont en jeu pour analyser lequel des deux « buffs » fera le plus de bien à un aventurier qui lance les dés.

Je prévois de faire plus de documents comme ceux-ci; gardez un œil sur la catégorie de probabilités dans la galerie de documents Maple Learn pour les mises à jour.

## Integration by Parts examples from Calculus Study...

Maple 2022

A user wondered why an example of integration by parts from the Calculus Study Guide was immediately showing the final answer instead of the parts steps shown in the Guide.

We suggest users pay special attention to the "Initialize" rows of the Guide example(s) where converting the integral to inert form is discussed.

Using an inert form of the integral ensures that Maple does not evaluate the integral unexpectedly.

 >

=

## Determinants, Gauss and Cramer

Maple 2021

Applications to develop exercises on systems of equations using the technique of determinants, Gauss and Crammer. For science and engineering students. In spanish.

Determinantes_Gauss_Crammer.mw

Lenin Araujo

## Créations artistiques avec Maple Learn – Deuxième...

by: Maple Learn

Récemment, j’ai assisté à une présentation sur comment utiliser Maple Learn pour créer des documents artistiques et aujourd’hui  je vous écris pour vous donner mes conseils sur ce sujet. Maple Learn a beaucoup de fonctionnalités permettant de créer des documents visuels tout en étant un outil parfait pour faire vos devoirs.

Caractéristique 1 : Les formes

Le premier document artistique de cette collection, le « Pi Pie » a été créé en utilisant la palette géométrie de Maple Learn. Elle fournit des modèles pour tracer des formes géométriques de façon plus simple. Le plus important dans ce document est l’utilisation de « Polygon() » pour créer le symbole pi. Insérez le nombre de points que vous voulez entre les parenthèses et le graphique connectera les points dans l’ordre entre eux. J’ai dessiné le symbole de pi sur un papier graphique et j’ai copié les points dans Maple Learn. C’est beaucoup d’effort, mais je pense que l’effet créé en vaut la peine.

Caractéristique 2 : Les fonctions

Ce personnage se nomme Milo je l’ai créé au lycée. Avec Maple Learn je l’ai reproduit en utilisant avec uniquement des fonctions. Voyons cela plus en détails :

• La tête et les cheveux sont des fonctions paramétriques. Les personnes  se souvenant de leur cours de maths savent que (x, y) = (cos(t), sin(t)) est la formule d’ un cercle unitaire. Nous pouvons modifier l ‘étendue de t, les coefficients avant sin(t) et cos(t) et additionner ou soustraire les constantes pour créer des cercles partielles ou des ellipses.
• Les yeux grisés sont fait avec des inégalités. Maple Learn permet de griser des régions d’inégalités automatiquement.
• Le sourire de Milo est l’équation d’un cercle limité par “| y < -0.5”. L’opérateur barre  « such that » vous permet de limiter le domaine et l’étendue d’une fonction.
• Le cœur vient d’une formule trouvée en ligne. Les mathématiciens ont découvert beaucoup d’équations incrédules de ce type !

Caractéristique 3 : L’animation

Mon document artistique final permet de voir germer une jolie fleur lorsque l’on utilise le curseur de la barre de défilement.  Après avoir défini une variable dans Maple Learn, la barre de défilement apparait et permet l’ajustement de la valeur de la variable. Par exemple :

• Associez les coordonnées d’un point avec une variable. Évaluez une fonction à un point correspondant à cette variable et voyez comment lorsque la variable change, le point se déplace.
• Associez l’étendue  d’une fonction paramétrique à une variable. Quand la variable change la fonction s’étend ou se contracte.
• Utilisez une variable avec une fonction par morceaux. Quand la variable est dans la gamme lui correspondant vous pouvez la visualiser.

Les mathématiques sont une belle langue et chaque type d’expression peut ajouter un plus à votre toile. Mes techniques ne sont que le début de belles pièces d’arts dans Maple Learn. Montrez-nous vos documents artistiques ou vos techniques dans les commentaires !

## Maple Learn Art 2: Electric Boogaloo

by: Maple Learn

It’s been a few months since the previous blog post on Maple Learn art, and the possibilities keep on growing.  I recently took part in a presentation on art in Maple Learn, and am here to pass on some tips and tricks to you, dear blog reader.  Maple Learn has a huge capacity for both creativity and ingenuity, and is the perfect program for doing your homework or exploring the world of mathematical art.  Check out the art I made here, and soon even more will be added to the Maple Learn Example Gallery!

Feature 1: Shapes

The first drawing in the batch, the “Pi Pie” (happy Pi Day!) was created using Maple Learn’s geometry palette.  The palette provides templates for plotting geometric shapes easily.  Most notably in this art is the use of Polygon() to create the pi symbol.  Insert as many points as you want between the brackets, and the plot will connect each one in order.  I drew pi on graph paper and copied down all the coordinates into Maple Learn.  A lot of work, but the effect was worth it.

Feature 2: Functions

This is Milo, a character I made in high school.  In Maple Learn, he is built entirely out of functions.  Let’s take a deep dive into what’s going on:

• The head and hair are parametric functions.  Folks who’ve taken a math class that includes parametrics know that (x, y) = (cos(t), sin(t)) is the formula for a unit circle.  We can modify the range of t, coefficients in front of sin(t) and cos(t), and add or subtract constants to create partial circles and ellipses.

• The shaded eyes are done with inequalities; Maple Learn shades inequality areas automatically.

• Milo’s big smile is the equation of a circle with the added detail “| y < -0.5”.  The bar is the “such that” operator, which allows users to limit the domain and range of the function.

• The body is a piecewise function: positive slope for x-values on the left side, negative slope for x-values on the right, and nothing in between.

• The heart shape came from a formula found online.  Mathematicians have discovered some incredible equations!

Feature 3: Animation

By final piece sprouts into a beautiful flower as one moves a slider.  After defining a variable in Maple Learn, a slider appears to adjust it.  This can be used for interactive explorations of graphs and animations.  For example:

• Associate the coordinates of a point with the variable or a function evaluated at the variable.  As the variable changes, the point will move.

• Associate the range of a parametric function with the variable.  As the variable changes, more or less of the function will appear.

• Use the variable in the conditions of piecewise functions.  When the variable is in the correct range, the shapes or functions you defined in the piecewise will appear.

Mathematics is a beautiful language, and every type of expression can add more to your canvas.  These techniques are just the beginning of beautiful Maple Learn art.  Feel free to share your own art or your favorite tips in the comments!

## Tower of Hanoi

by: Maple

In computer science, the Towers of Hanoi (Wiki) are considered a prime example of a problem that can only be solved recursively (or iteratively). The time for calculating a certain position n thus grows exponentially with O(2n). In this article an explicit solution is presented with which one can compute any position n with the same computing time O(1). This explicit solution is used in all animations.

Explicit solution

 1 2 3 4 5 6 7 Last Page 2 of 286
﻿