Personal Stories

Stories about how you have used Maple, MapleSim and Math in your life or work.

 

Dear Maple Community,

It has been a year since the passing of Stefan Vorkoetter, who started contributing to the Maple project in the 80s and was a long term member of our development team. 

Here are a few recently published articles about Stefan, that I'd like to share with you:

https://mapletransactions.org/index.php/maple/article/view/18269
https://mapletransactions.org/index.php/maple/article/view/18681

we shall not forget

 

 

In our recent project, we're diving deep into understanding the SIR model—a fundamental framework in epidemiology that helps us analyze how diseases spread through populations. The SIR model categorizes individuals into three groups: Susceptible (S), Infected (I), and Recovered (R). By tracking how people move through these categories, we can predict disease dynamics and evaluate interventions.

Key Points of the SIR Model:

  • Susceptible (S): Individuals who can catch the disease.
  • Infected (I): Those currently infected and capable of spreading the disease.
  • Recovered (R): Individuals who have recovered and developed immunity.

Vaccination Impact: One of the critical interventions in disease control is vaccination, which moves individuals directly from the susceptible to the recovered group. This simple action reduces the number of people at risk, thereby lowering the overall spread of the disease.

We're experimenting with a simple model to understand how different vaccination rates can significantly alter the dynamics of an outbreak. By simulating scenarios with varying vaccination coverage, students can observe how herd immunity plays a crucial role in controlling diseases. Our goal is to make these abstract concepts clear and relatable through practical modeling exercises.


 

In this exercise, we are going back to the simple SIR model, without births or deaths, to look at the effect of vaccination. The aim of this activity is to represent vaccination in a very simple way - we are assuming it already happened before we run our model! By changing the initial conditions, we can prepare the population so that it has received a certain coverage of vaccination.

We are starting with the transmission and recovery parameters  b = .4/daysand c = .1/days . To incorporate immunity from vaccination in the model, we assume that a proportion p of the total population starts in the recovered compartment, representing the vaccine coverage and assuming the vaccine is perfectly effective. Again, we assume the epidemic starts with a single infected case introduced into the population.​
We are going to model this scenario for a duration of 2 years, assuming that the vaccine coverage is 50%, and plot the prevalence in each compartment over time.

 

restart
with(plots)

b := .4; c := .1; n := 10^6; p := .5

deS := diff(S(t), t) = -b*S(t)*I0(t); deI := diff(I0(t), t) = b*S(t)*I0(t)-c*I0(t); deR := diff(R(t), t) = c*I0(t)

diff(R(t), t) = .1*I0(t)

(1)

F := dsolve([deS, deI, deR, S(0) = 1-p, I0(0) = 1/n, R(0) = p], [S(t), I0(t), R(t)], numeric, method = rkf45, maxfun = 100000)

odeplot(F, [[t, S(t)], [t, I0(t)], [t, R(t)]], t = 0 .. 730, colour = [blue, red, green], legend = ["S(t)", "I0(t)", "R(t)"], labels = ["Time (days)", "  Proportion\nof Population "], title = "SIR Model with vaccine coverage 50 %", size = [500, 300])

 

F(100)

[t = 100., S(t) = HFloat(0.46146837378273076), I0(t) = HFloat(0.018483974421123688), R(t) = HFloat(0.5200486517961457)]

(2)

eval(S(:-t), F(100))

HFloat(0.46146837378273076)

(3)

Reff := proc (s) options operator, arrow; b*(eval(S(:-t), F(s)))/(c*n) end proc; Reff(100)

HFloat(1.845873495130923e-6)

(4)

plot(Reff, 0 .. 730, size = [500, 300])

 

Increasing the vaccine coverage to 75%

NULL

restart
with(plots)

b := .4; c := .1; n := 10^6; p := .75

deS := diff(S(t), t) = -b*S(t)*I0(t); deI := diff(I0(t), t) = b*S(t)*I0(t)-c*I0(t); deR := diff(R(t), t) = c*I0(t)

diff(R(t), t) = .1*I0(t)

(5)

NULL

F1 := dsolve([deS, deI, deR, S(0) = 1-p, I0(0) = 1/n, R(0) = p], [S(t), I0(t), R(t)], numeric, method = rkf45, maxfun = 100000)

odeplot(F1, [[t, S(t)], [t, I0(t)], [t, R(t)]], t = 0 .. 730, colour = [blue, red, green], legend = ["S(t)", "I0(t)", "R(t)"], labels = ["Time (days)", "  Proportion\nof Population "], title = "SIR Model with vaccine coverage 75%", size = [500, 300])

 

F(1100)

eval(S(:-t), F1(100))

HFloat(0.249990000844159)

(6)

Reff := proc (s) options operator, arrow; b*(eval(S(:-t), F1(s)))/(c*n) end proc; Reff(100)

HFloat(9.99960003376636e-7)

(7)

plot(Reff, 0 .. 730, size = [500, 300])

 

Does everyone in the population need to be vaccinated in order to prevent an epidemic?What do you observe if you model the infection dynamics with different values for p?

No, not everyone in the population needs to be vaccinated in order to prevent an epidemic . In this scenario, if p equals 0.75 or higher, no epidemic occurs - 75 % is the critical vaccination/herd immunity threshold . Remember,, herd immunity describes the phenomenon in which there is sufficient immunity in a population to interrupt transmission . Because of this, not everyone needs to be vaccinated to prevent an outbreak .

What proportion of the population needs to be vaccinated in order to prevent an epidemic if b = .4and c = .2/days? What if b = .6 and "c=0.1 days^(-1)?"

In the context of the SIR model, the critical proportion of the population that needs to be vaccinated in order to prevent an epidemic is often referred to as the "herd immunity threshold" or "critical vaccination coverage."

• 

Scenario 1: b = .4and c = .2/days

``

restart
with(plots)

b := .4; c := .2; n := 10^6; p := .5``

deS := diff(S(t), t) = -b*S(t)*I0(t); deI := diff(I0(t), t) = b*S(t)*I0(t)-c*I0(t); deR := diff(R(t), t) = c*I0(t)

diff(R(t), t) = .2*I0(t)

(8)

F1 := dsolve([deS, deI, deR, S(0) = 1-p, I0(0) = 1/n, R(0) = p], [S(t), I0(t), R(t)], numeric, method = rkf45, maxfun = 100000)

odeplot(F1, [[t, S(t)], [t, I0(t)], [t, R(t)]], t = 0 .. 730, colour = [blue, red, green], legend = ["S(t)", "I0(t)", "R(t)"], labels = ["Time (days)", "  Proportion\nof Population "], title = "SIR Model with vaccine coverage 50 %", size = [500, 300])

 


The required vaccination coverage is around 50% .

• 

Scenario 1: b = .6and c = .1/days

restart
with(plots)

b := .6; c := .1; n := 10^6; p := .83NULL

deS := diff(S(t), t) = -b*S(t)*I0(t); deI := diff(I0(t), t) = b*S(t)*I0(t)-c*I0(t); deR := diff(R(t), t) = c*I0(t)

diff(R(t), t) = .1*I0(t)

(9)

NULL

F1 := dsolve([deS, deI, deR, S(0) = 1-p, I0(0) = 1/n, R(0) = p], [S(t), I0(t), R(t)], numeric, method = rkf45, maxfun = 100000)

odeplot(F1, [[t, S(t)], [t, I0(t)], [t, R(t)]], t = 0 .. 730, colour = [blue, red, green], legend = ["S(t)", "I0(t)", "R(t)"], labels = ["Time (days)", "  Proportion\nof Population "], title = "SIR Model with vaccine coverage 83% ", size = [500, 300])

 

"The required vaccination coverage is around 83 `%` ."


Download SIR_simple_vaccination_example.mw

This Maplesoft guest blog post is from Prof. Dr. Johannes Blümlein from Deutsches Elektronen-Synchrotron (DESY), one of the world’s leading particle accelerator centres used by thousands of researchers from around the world to advance our knowledge of the microcosm. Prof. Dr. Blümlein is a senior researcher in the Theory Group at DESY, where he and his team make significant use of Maple in their investigations of high energy physics, as do other groups working in Quantum Field Theory. In addition, he has been involved in EU programs that give PhD students opportunities to develop their Maple programming skills to support their own research and even expand Maple’s support for theoretical physics.


 

The use of Maple in solving frontier problems in theoretical high energy physics

For several decades, progress in theoretical high energy physics relies on the use of efficient computer-algebra calculations. This applies both to so-called perturbative calculations, but also to non-perturbative computations in lattice field theory. In the former case, large classes of Feynman diagrams are calculated analytically and are represented in terms of classes of special functions. In early approaches started during the 1960s, packages like Reduce [1] and Schoonship [2] were used. In the late 1980s FORM [3] followed and later on more general packages like Maple and Mathematica became more and more important in the solution of these problems. Various of these problems are related to data amounts in computer-algebra of O(Tbyte) and computation times of several CPU years currently, cf. [4].

Initially one has to deal with huge amounts of integrals. An overwhelming part of them is related by Gauss’ divergence theorem up to a much smaller set of the so-called master integrals (MIs). One performs first the reduction to the MIs which are special multiple integrals. No general analytic integration procedures for these integrals exist. There are, however, several specific function spaces, which span these integrals. These are harmonic polylogarithms, generalized harmonic polylogarithms, root-valued iterated integrals and others. For physics problems having solutions in these function spaces codes were designed to compute the corresponding integrals. For generalized harmonic polylogarithms there is a Maple code HyperInt [5] and other codes [6], which have been applied in the solution of several large problems requiring storage of up to 30 Gbyte and running times of several days. In the systematic calculation of special numbers occurring in quantum field theory such as the so-called β-functions and anomalous dimensions to higher loop order, e.g. 7–loop order in Φ4 theory, the Maple package HyperLogProcedures [7] has been designed. Here the largest problems solved require storage of O(1 Tbyte) and run times of up to 8 months. Both these packages are available in Maple only.

A very central method to evaluate master integrals is the method of ordinary differential equations. In the case of first-order differential operators leading up to root-valued iterative integrals their solution is implemented in Maple in [8] taking advantage of the very efficient differential equation solvers provided by Maple. Furthermore, the Maple methods to deal with generating functions as e.g. gfun, has been most useful here. For non-first order factorizing differential equation systems one first would like to factorize the corresponding differential operators [9]. Here the most efficient algorithms are implemented in Maple only. A rather wide class of solutions is related to 2nd order differential equations with more than three singularities. Also here Maple is the only software package which provides to compute the so-called 2F1 solutions, cf. [10], which play a central role in many massive 3-loop calculations

The Maple-package is intensely used also in other branches of particle physics, such as in the computation of next-to-next-to leading order jet cross sections at the Large Hadron Collider (LHC) with the package NNLOJET and double-parton distribution functions. NNLOJET uses Maple extensively to build the numerical code. There are several routines to first build the driver with automatic links to the matrix elements and subtraction terms, generating all of the partonic subprocesses with the correct factors. To build the antenna subtraction terms, a meta-language has been developed that is read by Maple and converted into calls to numerical routines for the momentum mappings, calls to antenna and to routines with experimental cuts and plotting routines, cf. [11].

In lattice gauge calculations there is a wide use of Maple too. An important example concerns the perturbative predictions in the renormalization of different quantities. Within different European training networks, PhD students out of theoretical high energy physics and mathematics took the opportunity to take internships at Maplesoft for several months to work on parts of the Maple package and to improve their programming skills. In some cases also new software solutions could be obtained. Here Maplesoft acted as industrial partner in these academic networks.

References

[1] A.C. Hearn, Applications of Symbol Manipulation in Theoretical Physics, Commun. ACM 14 No. 8, 1971.

[2] M. Veltman, Schoonship (1963), a program for symbolic handling, documentation, 1991, edited by D.N. Williams.

[3] J.A.M. Vermaseren, New features of FORM, math-ph/0010025.

[4] J. Blümlein and C. Schneider, Analytic computing methods for precision calculations in quantum field theory, Int. J. Mod. Phys. A 33 (2018) no.17, 1830015 [arXiv:1809.02889 [hep-ph]].

[5] E. Panzer, Algorithms for the symbolic integration of hyperlogarithms with applications to Feynman integrals, Comput. Phys. Commun. 188 (2015) 148–166 [arXiv:1403.3385 [hep-th]].

[6] J. Ablinger, J. Blümlein, C .Raab, C. Schneider and F. Wissbrock, Calculating Massive 3-loop Graphs for Operator Matrix Elements by the Method of Hyperlogarithms, Nucl. Phys. 885 (2014) 409-447 [arXiv:1403.1137 [hep-ph]].

[7] O. Schnetz, φ4 theory at seven loops, Phys. Rev. D 107 (2023) no.3, 036002 [arXiv: 2212.03663 [hep-th]].

[8] J. Ablinger, J. Blümlein, C. G. Raab and C. Schneider, Iterated Binomial Sums and their Associated Iterated Integrals, J. Math. Phys. 55 (2014) 112301 [arXiv:1407.1822 [hep-th]].

[9] M. van Hoeij, Factorization of Differential Operators with Rational Functions Coefficients, Journal of Symbolic Computation, 24 (1997) 537–561.

[10] J. Ablinger, J. Blümlein, A. De Freitas, M. van Hoeij, E. Imamoglu, C. G. Raab, C. S. Radu and C. Schneider, Iterated Elliptic and Hypergeometric Integrals for Feynman Diagrams, J. Math. Phys. 59 (2018) no.6, 062305 [arXiv:1706.01299 [hep-th]].

[11] A. Gehrmann-De Ridder, T. Gehrmann, E.W.N. Glover, A. Huss and T.A. Morgan, Precise QCD predictions for the production of a Z boson in association with a hadronic jet, Phys. Rev. Lett. 117 (2016) no.2, 022001 [arXiv:1507.02850 [hep-ph]].

To celebrate this day of mathematics, I want to share my favourite equation involving Pi, the Bailey–Borwein–Plouffe (BBP) formula:

This is my favourite for a number of reasons. Firstly, Simon Plouffe and the late Peter Borwein (two of the authors that this formula is named after) are Canadian! While I personally have nothing to do with this formula, the fact that fellow Canadians contributed to such an elegant equation is something that I like to brag about.

Secondly, I find it fascinating how Plouffe first discovered this formula using a computer program. It can often be debated whether mathematics is discovered or invented, but there’s no doubt here since Plouffe found this formula by doing an extensive search with the PSLQ integer relation algorithm (interfaced with Maple). This is an example of how, with ingenuity and creativity, one can effectively use algorithms and programs as powerful tools to obtain mathematical results.

And finally (most importantly), with some clever rearranging, it can be used to compute arbitrary digits of Pi!

Digit 2024 is 8
Digit 31415 is 5
Digit 123456 is 4
Digit 314159 is also 4
Digit 355556 is… F?

That last digit might look strange… and that’s because they’re all in hexadecimal (base-16, where A-F represent 10-15). As it turns out, this type of formula only exists for Pi in bases that are powers of 2. Nevertheless, with the help of a Maple script and an implementation of the BBP formula by Carl Love, you can check out this Learn document to calculate some arbitrary digits of Pi in base-16 and learn a little bit about how it works.

After further developments, this formula led to project PiHex, a combined effort to calculate as many digits of Pi in binary as possible; it turns out that the quadrillionth bit of Pi is zero! This also led to a class of BBP-type formulas that can calculate the digits of other constants like (log2)*(π^2) and (log2)^5.

Part of what makes this formula so interesting is human curiosity: it’s fun to know these random digits. Another part is what makes mathematics so beautiful: you never know what discoveries this might lead to in the future. Now if you’ll excuse me, I have a slice of lemon meringue pie with my name on it 😋

 

References
BBP Formula (Wikipedia)
A Compendium of BBP-Type Formulas
The BBP Algorithm for Pi

In the most recent issue of Maple Transactions, I published (with David Jeffrey, and with a student named Johan Joby) a paper that used Jupyter Notebook with a Maple kernel as the main vehicle.  Have a look, and let me know what you think.

Two-cycles in the infinite exponential tower

 

A new “Sudoku Puzzle” document is now on Maple Learn! Sudoku is one of the world’s most popular puzzle games and it is now ready to play on our online platform. 

This document is a great example of how Maple scripts can be used to create complex and interactive content. Using Maple’s built-in DocumentTools:-Canvas package, anyone can build and share content in Maple Learn. If you are new to scripting, a great place to start is with one of the scripting templates, which are accessible through the Build Interactive Content help page. In fact, I built the Sudoku document script by starting from the “Clickable Plots” template.

A Sudoku puzzle is a special type of Latin Square. The concept of a Latin Square was introduced to the mathematical community by Leonard Euler in his 1782 paper, Recherches sur une nouvelle espèce de Quarrés, which translates to “Research on a new type of square”. A Latin Square is an n by n square array composed of n symbols, each repeated exactly once in every row and column. The Sudoku board is a Latin Square where n=9, the symbols are the digits from 1 to 9,  and there is an additional requirement that each 3 by 3 subgrid contains each digit exactly once. 

Mathematical research into Sudoku puzzles is still ongoing. While the theory about Latin Squares is extensive, the additional parameters and relative novelty of Sudoku means that there are still many open questions about the puzzle. For example, a 2023 paper from Peter Dukes and Kate Nimegeers examines Sudoku boards through the lenses of graph theory and linear algebra.

The modern game of Sudoku was created by a 74-year-old Indiana retiree named Howard Garnes in 1979 and published under the name “Number Place”. The game had gained popularity in Japan by the mid-1980s, where it was named “Sudoku,” an abbreviation of the phrase “Sūji wa dokushin ni kagiru,” which means “the numbers must be single”.

Today, Sudoku is a worldwide phenomenon. This number puzzle helps players practice using their logical reasoning, short-term memory, time management, and decision-making skills, all while having fun. Furthermore, research from the International Journal of Geriatric Psychiatry concluded that doing regular brain exercises, like solving a Sudoku, is correlated with better brain health for adults over 50 years old. Additionally, research published in the BMJ medical journal suggests that playing Sudoku can help your brain build and maintain cognition, meaning that mental decline due to degenerative conditions like Alzheimer’s would begin from a better initial state, and potentially delay severe symptoms. However, playing Sudoku will by no means cure or prevent such conditions.

If you are unfamiliar with the game of Sudoku, need a refresher on the rules, or want to improve your approach, the “Sudoku Rules and Strategies” document is the perfect place to start. This document will teach you essential strategies like Cross Hatching:

And Hidden Pairs:

After reading through this document, you will have all the tools you need to start solving puzzles with the “Sudoku Puzzle” document on Maple Learn. 

Have fun solving!

Happy Pride Month, everyone! June is a month for recognizing and celebrating the LGBT+ community. It was started to mark the anniversary of the Stonewall riots, which were a landmark event in the fight for LGBT+ rights. We celebrate Pride Month to honour those who have fought for their rights, acknowledge the struggles the LGBT+ community continues to face to this day, and celebrate LGBT+ identities and culture.

This Pride Month, I want to give a special shoutout to those in the math community who also identify as LGBT+. As a member of the LGBT+ community myself, I’ve noticed a fair amount of stigma against being queer in math spaces—and surprisingly often coming from within the community itself. It’s one thing for us to make jokes amongst ourselves about how none of us can sit in chairs properly (I don’t even want to describe how I’m sitting as I write this), but the similar jokes I’ve heard my LGBT+ friends making about being bad at math are a lot more harmful than they might realize. And of course it isn’t just coming from within the community—many people have a notion (whether conscious or unconscious) that all LGBT+ people are artistically inclined, not mathematical or scientific. Obviously, that’s just not true! So I want to spend some time celebrating queerness in mathematics, and I invite you to do the same.

One of the ways we’re celebrating queerness in math here at Maplesoft is with new Pride-themed Maple Learn documents, created by Miles Simmons. What better way to celebrate Pride than with trigonometry? This document uses sinusoidal transformations to mimic a pride flag waving in the wind. You can adjust the phase shift, vertical shift, horizontal stretch, and vertical stretch to see how that affects the shape of the flag. Then, you can watch the animation bring the flag to life! It’s a great way to learn about and visualize the different ways sinusoidal waves can be transformed, all while letting your colours fly!

 

A screenshot of a Maple Learn document. The plot window shows a pride flag constructed from sine waves, and the document describes how we will be adding wind in the form of function transformations.

For more trigonometry, you can also check out this fun paint-by-numbers that can help you practice the sines, cosines, and tangents of special angles. And, as you complete the exercise, you can watch the Pride-themed image come to life! Nothing like adding a little colour to your math practice to make it more engaging.

 

A screenshot of a Maple Learn document showing a partially coloured paint-by-numbers grid, where the numbers are special trig angles.

If you’re looking for more you can do to support LGBT+ mathematicians this Pride Month, take a look at Spectra, an association for LGBT+ mathematicians. Their website includes an “Outlist” of openly LGBT+ mathematicians around the world, and contact information if you want to learn more about their experiences. The Fields Institute has also hosted LGBT+Math Days in the past, which showcases the research of LGBT+ mathematicians and their experiences of being queer in the math community. Blog posts like this one by Anthony Bonato, a math professor at Toronto Metropolitan University, and interviews like this one with Autumn Kent, a math professor at the University of Wisconsin-Madison, can also help allies in mathematics to understand the experiences of their queer colleagues and how to best support them. Math is everywhere and for everyone—so let’s make sure that the systems we use to teach and explore math are for everyone too!

Happy Pride! 🏳️‍🌈

Just installing Maple 2023 on my office machine (a mac); installed it on my travel computer (a Surface Pro running Windows) yesterday.

Configured Jupyter notebooks to use the 2023 Maple Kernel and it all went smoothly.  I was *delighted* to notice that plotting Lambert W in Jupyter with the command

plot( [W(x), W(-1,x)], x=-1..4, view=[-1..4, -3.5..1.5], colour=[red,blue], scaling=constrained, labels=[x,W(x)] );

produced a *better* plot near the branch point.  This is hard to do automatically!  It turns out this is a side effect of the better/faster/more memory efficient adaptive plotting software, which I gather from "What's New" was written for efficiency not for quality.  But the quality is better, too!  Nice!

I am working my. way through the "What's New" and I'm really pleased to learn about the new univariate polynomial rootfinder, *not least because it cites the paper describing the algorithm*.  Lots of other goodies too; the new methods of integration look like serious improvements.  Well done. (One thing there: "parallel Risch" is a term of art, and may lead people to believe that Maple is doing something with parallel computing there.  I don't think so.  Could a reference be supplied?)

The new colour schemes and plotting features in 3d and contour plotting look fabulous.

Direct Python language support from a code edit region is not at all what I expected to see---I wonder if it will work in a Jupyter notebook?  I'm going to have to try it...

I'm quite impressed.  The folks at Maplesoft have been working very hard indeed.  Congratulations on a fine release!

 

Happy Springtime to all in the MaplePrimes Community! Though some in our community may not live in the northern hemisphere where flowers are beginning to bloom, many will be celebrating April holidays like Ramadan, Passover, and Easter.

One of my favorite springtime activities is decorating eggs. Today, the practice is typically associated with the Christian holiday of Easter. However, painted eggs have roots in many cultures.

For over 3,000 years, painting eggs has been a custom associated with the holiday of Nowruz, or Persian New Year, during the spring equinox. Furthermore, in the Bronze Age, decorated ostrich eggs were traded as luxury items across the Mediterranean and Northern Africa. Dipped eggs have also played an important role in the Jewish holiday of Passover since the 16th century.

To celebrate this tradition, I would like to invite all of the Maplesoft community to create a decorated egg of their own with the Easter Egg Art Maple Learn document. In this document, an ovoid egg equation is used to define the shape of an egg. 



The ovoid egg equation mimics the shape of a typical hen’s egg. Each bird species lays differently shaped eggs. For example, an ostrich’s egg is more oblong than an owl’s, and an owl’s egg is rounder than a goose’s. Surprisingly, every egg can be described by a single equation with four parameters:



Learn more about this equation and others like it with John May’s Egg Formulas Maple Learn document.

The Easter Egg Art document includes 9 different decorative elements; users can change the color, position, and size of each in order to create their own personal egg! The egg starts out looking like this:



In just a couple of minutes, you can create a unique egg. Have fun exploring this document and share a screenshot of your egg in the comments below!  Here’s one I made:


Recently, ChatGpt has gained a lot of attention and there are mixed reviews about it. Some people think highly of its capabilities, while others are more critical. Regardless, it has been an interesting  topic on assistant programming.

I'm going to give two examples to illustrate what's interesting and what's lacking.

First, I want ChatGpt to write a Maple code for the enumeration of all prime numbers up to 100. Then it writes:

primes:= proc(n)
   local i, j, primes;
   primes:= [2];
   for i from 3 to n do
      for j from 2 to i-1 do
         if i mod j = 0 then break;
      end do;
      if j = i then primes:= [op(primes), i]; end if;
   end do;
   return primes;
end proc;

primes(100);

I copy and paste this code, maple shows an error: Error, reserved word `do` unexpected

I report the error to it:

this code cannot run since "Error, reserved word `do` unexpected"

Then it gives: I apologize for the error in the previous code. Here is a corrected version of the code that can be run in Maple:

primes:= proc(n)
   local i, j, primesList;
   primesList:= [2];
   for i from 3 to n do
      for j from 2 to i-1 do
         if i mod j = 0 then 
            break;
         end if;
      end do;
      if j = i then 
         primesList:= [op(primesList), i]; 
      end if;
   end do;
   return primesList;
end proc;

primes(100);

Ok, It's tediously written code, but at least it's correct. 

Furthermore, I ask:

Is there a more concise approach that utilizes maple's built-in functions.

It tells me:

Yes, there is a more concise approach that utilizes Maple's built-in functions. Here's an example:

primes := [seq(i, i=2..100)]; primes := [op(select(isprime, primes))];

The seq function generates a list of numbers from 2 to 100. The select function filters out all non-prime numbers using the isprime function, which tests the primality of a number. The result is stored in the primes array.

Ok, this answer meets my expectations.

 

Another example is the generation of all 6th order non-isomorphic graphs, which pops up as:

# Load the GraphTheory package
with(GraphTheory):

# Generate a list of all non-isomorphic graphs with 6 vertices
graphs := NonIsomorphicGraphs(6):

# Print the list of non-isomorphic graphs
print(graphs);

But NonIsomorphicGraphs(6) as we know is the number  of non-isomorphic graphs but  not graphs  themselves.

 

So I say:

in the above codes, NonIsomorphicGraphs need the options output = graphs, outputform = graph

ChatGpt gives :

Here is a revised version of the code that takes into account the options output = graphs and outputform = graph:

 

# Load the GraphTheory package
with(GraphTheory):

# Generate a list of all non-isomorphic graphs with 6 vertices
graphsList := NonIsomorphicGraphs(6, output = graphs, outputform = graph):

# Print the number of non-isomorphic graphs
print("Number of non-isomorphic graphs: ", nops(graphsList));

# Print each non-isomorphic graph in the list
for i in 1 to nops(graphsList) do
  print("Graph ", i, ": ", graphsList[i]);
end do

It still has syntax errors. I made some artificial adjustments.

# Load the GraphTheory package
with(GraphTheory):

# Generate a list of all non-isomorphic graphs with 6 vertices
graphsList := [NonIsomorphicGraphs(6, output = graphs, outputform = graph)]:

# Print the number of non-isomorphic graphs
print("Number of non-isomorphic graphs: ", nops(graphsList));

# Print each non-isomorphic graph in the list
for i from 1 to nops(graphsList) do
  print("Graph ", i, ": ", graphsList[i]);
end do;

I pulled a wry face when  it builds a lot of codes  that do not exist in Maple.. Here's a little tidbit of my conversation with it.

This software still needs more work. I'm not sure how far it can go, but maybe programming becomes easier. Maybe more interesting examples will be found.

This year, for Christmas, my children* got a Valve Steam Deck under the Christmas tree.  It's a pretty cool device that looks a little  like a monsterous Nintendo Switch, but it can run an impressive subset of the Steam video game catalog, games mostly designed to run on Windows PCs.  It manages this by sporting a custom x86_64 processor by AMD and running a customized version of Arch Linux that uses Wine via Valve's Proton tool.  The key point here, is that it is a tiny x86_64 compatible computer running Linux. So, of course, I needed to install Maple on it. So, I just paired a bluetooth keyboard, rebooted it into desktop mode and with a few small trick, bam, Maple on the Steam Deck:

There were a few small hiccups that required some work. I had absolutely no problems getting the Maple installer onto the device via a USB drive and no problems running it. I only ran into problems durring license activation:

Fortunately, I talked to our crack technical support team and they were able to identify this as a problem with Arch Linux not having full LSB 3.0 support installed by default. The process for fixing that is documented on the Arch Linux Wiki and involves just installing the ld-lsb package via pacman -- with the small additional wrinkle that you need to take the Steam Deck operating system out of 'read-only' mode in order to do that. But once that was done, I had a full version of Maple running well (albeit at 1280x800 resolution on a 7" display).

Since this device is designed for gaming, I was curious how fast it is compared to some other machines I work on. I chose an arbitrary benchmark of exactly solving a random linear system with integer coefficients.

restart;
N := 400;
A := LinearAlgebra:-RandomMatrix(N, N):
b := LinearAlgebra:-RandomVector(N):
v := [seq(cat(v__, i), i = 1 .. N)]:
sys := LinearAlgebra:-GenerateEquations(A, v, b):
CodeTools:-Usage(SolveTools:-LinearSolvers:-Rational(`~`[lhs - rhs](sys), v, dense = false)):

which it solves in decent time:

For comparison, this is 30% faster than the 32 core Xeon e5 workstation I do most of my work on, and only 5% slower than my notebook computer with an 8th gen Intel i7.  Not bad for a toy! (please don't make me sad by telling me how much faster this is on a Mac M1 or M2)

Let me know in the comments if you have other benchmarks you want me to run on the Steam Deck. Also, please let me know if you manage to get your employer to buy you a Steam Deck to do scientific computing.

 

*Okay, maybe it was a gift for me. Shhhh, don't tell.

Hello,

  2022 was a wonderful year of progress in using Maple/MapleSim for almost everything my mathematical world.     

I just wanted to wish all the Maplesoft user community a very productive and Happy New Year for 2023.   I look forward to continue to find great nuggets of capability and insider techniques for using Maple in my endeavors.

Kindest Regards to ALL.
Happy New Year - 2023.
Bill

 

I have been making animated 3d plots recently; the last time was perhaps three years ago, and I had some problems then.  If I recall correctly, I couldn't make an animated 3d plot that was plotted in non-Cartesian coordinates.

 

I am very happy to report that this works very smoothly now in Maple 2022, and it's pretty fast, too.  I have a fairly complex function to plot, involving piecewise polynomials on a tensor product grid in the xi and eta variables (actually, I let plot3d pick out the grid; it seems happier to do so) and then plot them on an elliptical base, in coordinates x = d*cosh(xi)*cos(eta) and y=d*sinh(xi)*sin(eta)  (d is just a numerical constant, giving the location of the foci at (d,0) and (-d,0)), for 0 <= xi <= xi[0] (the outer elliptical boundary) and 0 <= eta <= 2Pi.  The straightforward command works, and building a sequence of plots and using plots[display] works.  I put option remember into my procedure w(xi,eta) and because the sample points are consistent for the time-dependent function exp(I*omega*t)*w(xi,eta) the xi-eta grid needs only to be done once and then one can compute (basically) as many frames as one wants in rapid succession.

 

Works great.  Thanks, folks!

 

for k to nplots do
    t := evalf(2*Pi*(k - 1)/nplots);
    plts[k] := plot3d([(xi, eta) -> focus*cosh(xi)*cos(eta), (xi, eta) -> focus*sinh(xi)*sin(eta), (xi, eta) -> Re(exp(omega*t*I)*w(xi, eta))], 0 .. xi[0], 0 .. 2*Pi, colour = ((xi, eta) -> Re(exp(omega*t*I)*w(xi, eta))), style = surfacecontour, lightmodel = "none");
end do;
plots[display](seq(plts[k], k = 1 .. nplots), insequence = true);
 

With the winter solstice speeding towards us, we thought we’d create some winter themed documents. Now that they’re here, it’s time to show you all! You’ll see two new puzzle documents in this post, along with three informative documents, so keep reading.

Let’s start with the tromino tree!

 

First, what’s a tromino? A tromino is a shape made from three equal sized squares, connected to the next along one full edge. In this puzzle, your goal is to take the trominos, and try to fill the Christmas tree shape.

There’s a smaller and larger tree shape, for different difficulties. Try and see how many ways you can fill the trees!

Next, we’ll look at our merry modulo color by numbers.

Table

Description automatically generated

In this puzzle, your goal is to solve the modulo problems in each square, and then fill in the square with the color that corresponds to the answer. Have fun solving the puzzle and seeing what the image is in the end!

Snowballs are a quintessential part of any winter season, and we’ve got two documents featuring them.

A picture containing icon

Description automatically generated

The first document uses a snowball rolling down a hill to illustrate a problem using differential equations. Disclaimer: The model is not intended to be realistic and is simplified for ease of illustration. This document features a unique visualization you shouldn’t miss!

Our second document featuring snowballs talks about finding the area of a 2-dimensional snowman! Using the formula for the area of a circle and a scale factor, the document walks through finding the area in a clear manner, with a cute snowman illustration to match!

Shape

Description automatically generated

The final document in this mini-series looks at Koch snowflakes, a type of fractal. This document walks you through the steps to create an iteration of the Koch snowflake and contains an interactive diagram to check your drawings with!

I hope you’ve enjoyed taking a look at our winter documents! Please let us know if there’s any other documents you’d like to see featured or created.

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. 

 

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