MaplePrimes Posts

MaplePrimes Posts are for sharing your experiences, techniques and opinions about Maple, MapleSim and related products, as well as general interests in math and computing.

Latest Post
  • Latest Posts Feed
  • I'm an engineer and when showing results of calculations, some values will display as fractions, and I would prefer that instead floating numbers are displayed.  Also, there is kind of a quirk where if the multiplier of a unit is 1, the result displays as a unit only. I would prefer to see 1*A rather than A.

    I wrote this simple proc to convert a value with or without attached unit to a floating point number if it is a fraction or if it has a unit and the coefficient is 1.

    Let me know if there is a more elegant way to do this or you have any suggestions or questions.

       unrationalize := proc(x)
            local 
                returnval,
                localcoeff,
                localunit
            ;
            description
                "Converts a fractional number to float",
                "Units are supported"
            ;
            if type(x, fraction) or type(x, with_unit(fraction)) then 
                returnval := evalf(x)
            elif type(x, with_unit(1, 'localcoeff', 'localunit')) then
                returnval :=  evalf(localcoeff)*localunit
            else 
                returnval := x;
            end if;
            return returnval;
        end  proc;
    # Testing the proc
    list1 := [1/2, 1/2*Unit(('A')/('V')), 1, Unit('A')];
    listDescription := ["Fraction", "Fraction with Unit", "Unity", "Unity with Unit"];
    for i, myValue in list1 do
        [listDescription[i], "evalf:", evalf(myValue), "unrationalize:", unrationalize(myValue)];
    end do;

    Curve sketching is an important skill for all calculus students to learn. In an era where technology is increasingly relied upon to perform mathematical computations and representations, maintaining fundamental skills such as curve sketching is more important than ever.

    The new “Curve Sketching” collection is now available on Maple Learn. This collection provides background information on the process of curve sketching and opportunities to put this knowledge into practice. By starting with the “Curve Sketching Guide” and “Relationships Between Derivatives” documents, students are exposed to observational and computational strategies for drawing a function and its 1st and 2nd derivatives.

    After looking through these documents, students can begin to practice sketching by observing and interpreting graphical properties with the “Sketch Derivative From Function Graph”, “Sketch Second Derivative From Function Graph”, and “Sketch Function From Derivative Graphs” activities:

    Once a student has mastered extracting sketching information by graphical observation, they are ready for the next step: extracting information from a function’s definition. At this point, the student is ready to try sketching from a blank canvas with the “Sketch Curve From Function Definition” activity:

    This collection also has activities for students below the calculus level. For example, the “Curve Sketching Quadratics Activity”, can be completed using only factoring strategies:

    Whether you are a quadratics rookie or a calculus pro, this collection has an interactive activity to challenge your knowledge. Have fun sketching!

    My friend and colleague Nic Fillion and I are writing another book, this one on perturbation methods using backward error analysis (and Maple).  We have decided to make the supporting materials available by means of Jupyter notebooks with a Maple kernel (there are some Maple worksheets and workbooks already, but going forward we will use Jupyter).

    The presentation style is meant to aid reproducibility, and to allow others to solve related problems by changing the scripts as needed.

    The first one is up at 

    https://github.com/rcorless/Perturbation-Methods-in-Maple

    Comments very welcome.  This particular method is a bit advanced in theory (but it's very simple in practice, for weakly nonlinear oscillators).  I haven't coded for efficiency and there may be some improvements possible ("may" he says, sheesh).  Comments on that are also welcome.

    -r

    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

    Happy new year everyone. Instead on making my usual new year resolutions, I though I would put up a request for some helpful  improvements here.

    1) Please make search work properly. Allow searches to target specific sections. Posts, Questions, My own account, Other users. etc,

    2) Add links to Maple help. Is there an online way of viewing Maple document? Or build Maple viewer into this site.

    3) Add links to Maple Learn.

     

    restart;

    plots:-inequal([x^2+y^2<100, x+y>Pi]);      # ?,  evalf(Pi) ok

    Error, (in ReasonableDomain:-Implicit) invalid input: ReasonableDomain:-Recorder:-AddPoint expects its 2nd argument, point, to be of type list(numeric), but received [Pi, 0]

     

    plots:-inequal([x^2+y^2<100, x+y>sqrt(3)]); # ?

    Error, (in ReasonableDomain:-Implicit) invalid input: ReasonableDomain:-Recorder:-AddPoint expects its 2nd argument, point, to be of type list(numeric), but received [3^(1/2), 0]

     

    solve({x^2+y^2<100, x+y>Pi});               # ?

    Warning, solutions may have been lost

     

    solve({x^2+y^2<100, x+y>sqrt(10)});         # ?

    Warning, solutions may have been lost

     

    solve({x^2+y^2<100, x+y>4}, [x,y]);         # OK

    [[x < 2+46^(1/2), 2-46^(1/2) < x, y < (-x^2+100)^(1/2), 4-x < y], [x = 2+46^(1/2), y < -2+46^(1/2), 2-46^(1/2) < y], [x < 10, 2+46^(1/2) < x, y < (-x^2+100)^(1/2), -(-x^2+100)^(1/2) < y]]

    (1)

    solve({x^2+y^2<100, x+y>a}, [x,y]) assuming 3<a, a<5;              #?

    []

    (2)

    solve({x^2+y^2<100, x+y>a}, [x,y], parametric) assuming 3<a, a<5;  # OK

    [[x = (1/2)*a+(1/2)*(-a^2+200)^(1/2), (1/2)*a-(1/2)*(-a^2+200)^(1/2) < y, y < -(1/2)*a+(1/2)*(-a^2+200)^(1/2)], [(1/2)*a-(1/2)*(-a^2+200)^(1/2) < x, x < (1/2)*a+(1/2)*(-a^2+200)^(1/2), a-x < y, y < (-x^2+100)^(1/2)], [(1/2)*a+(1/2)*(-a^2+200)^(1/2) < x, x < 10, -(-x^2+100)^(1/2) < y, y < (-x^2+100)^(1/2)]]

    (3)


    Download bugs-irrationals.mw

    Two solstices occur on Earth every year, around June 21st and December 21st, often called the “June Solstice” and the “December Solstice” respectively. These solstices occur when the sun reaches its northernmost or southernmost point relative to the equator. During a solstice, the Northern Hemisphere will either experience the most sunlight of the year or the least sunlight of the year, while the Southern Hemisphere will experience the opposite phenomenon. The hemisphere with the most sunlight experiences a summer solstice, while the other hemisphere experiences a winter solstice.

    Canada is located in the Northern Hemisphere and this Thursday, December 21st, we will be experiencing a winter solstice. As the day with the least sunlight, this will be the shortest day of the year and consequently the longest night of the year.

    Here in Canada, the sun will reach its minimum elevation during the winter solstice, and it will reach its maximum elevation during the Southern Hemisphere’s summer solstice on the same day. 

    How high in the sky does the sun really get during these solstices? Check out our new Maple Learn document, Winter and Summer Solstice Sun Angles to find out. The answer depends on your latitude; for instance, with a latitude of approximately 43.51°, the document helps us find that the maximum midday elevation of the sun, which occurs during a summer solstice, will be 69.99°.

    But how is the latitude of a location determined in the first place? See Maple Learn’s Calculating Latitude document to find out how the star Polaris, the center of the Earth, and the equator are all connected to latitude.

    Latitude is one of two geographical coordinates that are paired together to specify a position on Earth, the other being longitude. See our Calculating Longitude document to explore how you can use your local time to approximate your longitude.

    Armed with these coordinates, you can describe your position on the planet and find any number of interesting facts, such as your solstice sun angles from earlier, the time for sunrise and sunset, and the position of the Moon.

    Happy Winter Solstice!

    Why this post
    This work was intended to be a simple reply to a question asked a few days ago.
    At some point, I realised that the approach I was using could have a more general interest which, in my opinion, was worth a post.
    In a few words, this post is about solving an algebra problem using a method originally designed to tackle statistical problems.

    The Context
    Recently @raj2018 submitted a question I'm going to resume this way:

    Let S(phi ;  beta, f) a function of phi parameterized by beta and f.
    Here is the graph of S(phi ;  0.449, 0.19)  @raj2018 provided

    @raj2018 then asked how we can find other values (A, B)  of values for (beta, f) such that the graph of S(phi, A, B) has the same aspect of the graph above.
    More precisely, let phi_0 the largest strictly negative value of phi such that  S(phi_0, A, B) = 0.
    Then  S(phi, A, B) must be negative (strictly negative?) in the open interval (phi_0, 0), and must have exactly 3 extrema in this range.
    I will said the point  (A, B) is admissible is S(phi, A, B) verifies thess conditions

    The expression of S(phi, A, B) is that complex that it is likely impossible to find an (several?, all?) admissible point using analytic developments.

    The approach

    When I began thinking to this problem I early thought to find the entire domain of admissible points: was it something possible, at least with some reasonable accuracy? 

    Quite rapidly I draw an analogy with an other type of problems whose solution is part of my job: the approximate construction of the probability density function (PDF) of multivariate random variables (obviously this implies that no analytical expression of this PDF is available). This is a very classical problem in Bayesian Statistics, for instance when we have to construt an approximation of a posterior PDF.

    To stick with this example and put aside the rare situations where this PDF can be derived analytically, building a posterior PDF is largely based on specific numerical methods. 
    The iconic one is known under the generic name MCMC  which stands for Markov Chain Monte Carlo.

    Why am I speaking about MCMC or PDF or even random variables?
    Let us consider some multivariate random variable R whose PDF as a constant on some bounded domain D and is equal to 0 elsewhere. R is then a uniform random variable with support supp(R) = D.
    Assuming the domain Adm of admissible (beta, f) is bounded, we may  think of it as the support of some uniform random variable. Following this analogy we may expect to use some MCMC method to "build the PDF of the bivariate random variable (beta, f)", otherwise stated "to capture​​​​​​ the boundary of​ Adm".

    The simplest MCMC method is the Metropolis-Hastings algorithm (MH).
    In a few simple words MH builds a Markov chain this way:

    1. Let us assume that the chain already contains elements e1, ..., en.
      Let  f  some suitable "fitness" function (whose nature is of no importance right now).
    2. A potential new element c is randomly picked in some neighborhood or en.
    3. If the ratio (c) / (en) is larger than 1, we decide to put c into the chain (thus en+1 = c) otherwise we leave it to chance to decide whether or not c iis put into the chain.
      If chance decides the contrary,  then en is duclicated (thus en+1 = en).


    MH is not the most efficient MCMC algorithm but it is efficient enough for what we want to achieve.
    The main difficulty here is that there is no natural way to build the fitness function  f , mainly because the equivalent random variable I talked about is a purely abstract construction.

    A preliminary observation is that if S(phi, beta, f) < 0 whatever phi in (phi_0, 0), then S has an odd number of extrema in (phi_0, 0). The simplest way to find these extrema is to search for the zeros of the derivative S' of S with respect to phi, while discardinq those where the second derivative can reveal "false" extrema where both S'' of S is null (I emphasize this last point because I didn't account for it in attached file).
    The algorithm designed in this file probably misses a few points for not checking if S''=0, but it is important to keep in mind that we don't want a complete identification of  Adm but just the capture of its boundary.
    Unless we are extremely unlucky there is only a very small chance that omitting to check if S''=0 will deeply modify this boundary.


    How to define function f  ?
    What we want is that  f (c) / (en) represents the probability to decide wether c is an admissible point or not. In a Markov chain this  ratio represents how better or worse c is relatively to en, and this is essential for the chain to be a true Markov chain.
    But as our aim is not to build a true Markov chain but simply a chain which looks like a Markov chain, we we can take some liberties and replace  f (c) / (en) by some function  g(c) which quantifies the propability for c to be an admissible couple. So we want that  g(c) = 1 if  S(phi, c) has exactly M=3 negative extrema and  g(c) < 1 if M <> 3.
    The previous algorihm transforms into:

    1. Let us assume that the chain already contains elements e1, ..., en.
      Let  g  a function which the propability that element is admissible
    2. A potential new element c is randomly picked in some neighborhood or en.
    3. If the ratio g(c) is larger than 1, we decide to put c into the chain (thus en+1 = c) otherwise we leave it to chance to decide whether or not c iis put into the chain.
      If chance decides the contrary,  then en is duclicated (thus en+1 = en).

    This algorithm can also be seen as a kind of genetic algorithm.

    A possible choice is  g(c)= exp(-|3-M|).
    In the attached file I use instead the expression g(c) = (M + 1) / 4 fo several reasons:

    • It is less sharp at M=3 and thus enables more often to put c into the chain, which increases its exploratory capabilities.
    • The case M > 3, which no preliminary investigation was able to uncover, is by construction eliminated in the procedure Extrema which use an early stopping strategy (if as soon as more than M=3 negative extrema are found the procedure stops).


    The algorithm I designed basically relies upon two stages:

    1. The first one is aimed to construct a "long" Markov-like chain ("long" and not long because Markov chains are usually much longer than those I use).
      There are two goals here:
      1. Check if Adm is or not simply-connected or not (if it has holes or not).
      2. Find a first set of admissible points that can be used as starting points for subsequent chains.
         
    2. Run several independent Markov-like chains from a reduced set of admissible points.
      The way this reduced set is constructed depends on the goal to achieve:
      1. One may think of adding points among those already known in order to assess the connectivity of Adm,
      2. or refinining the boundary of Adm.

    These two concurent objectives are mixed in an ad hoc way depending on the observation of the results already in hand.


    We point here an important feature of MCMC methods: behind their apparent algorithmic simplicity, it is common that high-quality results can only be obtained efficiently at the cost of problem-dependent tuning.

    A last word to say that after several trials and failures I found it simpler to reparameterize the problems in terms of (phi_0, f) instead of (beta, f).

    Codes and results

    Choice g(c) = (M + 1) / 4 
    The code : Extrema_and_MCMC.mw

    To access the full results I got load this m file (do not bother its extension, Mapleprimes doesn't enable uploading m files) MCMC_20231209_160249.mw (save it and change it's extension in to m instead mw)

    EDITED: choice  g(c)= exp(-|3-M|)
    Here are the files contzining the code and the results:
    Extrema_and_MCMC_g2.mw
    MCMC_20231211_084053.mw

    To ease the comparison of the two sets of results I used the same random seeds inn both codes.
    Comparing the results got around the first admissible point is straightforward.
    It's more complex for @raj2018's solution because the first step of the algorithim (drawing of a sibgle chain of length 1000) finds six times more admissible point with g(c)= exp(-|3-M|) than with g(c) = (M + 1) / 4.                                 

    Plots of physical quantities has significantly improved with Maple 2022. The updated useunits option makes unit conversion errors in plots very unlikely. A lot of time is saved when creating plots of physical quantities where values and units must be correct.

    One final source of user errors remains: The manual entry of incorrect units in labels.

    Below is a way to avoid such errors by computing labels with units for three prevalent axis labeling schemes.


    Other desireable labels are given as a suggestion for future plot label enhancements where plot commands could provide formating functionality.

    The rendering on this website adds double brakets ⟦ ⟧ wherever units are used. You have to open the document to see how Maple renders.

    NULL

    Simple plot example: Solar irradiance in space

    G__0 := 1361*Unit('W'/'m'^2)

    1361*Units:-Unit(W/m^2)

    (1)

    G__0*sin(2*Pi*t/(24*Unit('h')))

    1361*Units:-Unit(W/m^2)*sin((1/12)*Pi*t/Units:-Unit(h))

    (2)

    plot(1361*Units:-Unit(W/m^2)*sin((1/12)*Pi*t/Units:-Unit(h)), t = 0 .. 12*Unit('h'))

     

    This plot has inconsistent axis labeling:

    • 

    The vertical axis has units but no name

    • 

    The horizontal axis has a name and units but they are not easily distinguishable. Misinterpretation is possible. Due to the close spacing the label could be read as a product of the dimension "time squared" (the time t times hours h is of the dimension time squared). Or the reader confounds name and units. (The use of italic fonts for names and roman fonts for units might not be noticeable and is a convention that is not used everywhere.)

     

    The above labeling should be improved for communication, documentation or publication purposes.

     

    A quick attempt using strings and the options useuints and labels.

    plot(1361*Units:-Unit(W/m^2)*sin((1/12)*Pi*t/Units:-Unit(h)), t = 0 .. 12*Unit('h'), useunits = ['d', kW/m^2], labels = ["Time t in days", "Exposure G in kV/m^2"])

     

    Axes are now consistent and can be interpreted unambiguously. Formatting can still be improved.

     

    Unfortunately, using the options useunits (for unit conversion) and labels this way introduces a new source of user error when labels are entered with the wrong units.

     

    A way to address this and to ensure unit error-free plotting of expressions of physical quantities is the following:

     

    Step1: Define two lists, one for the units to display and the other for the names to display

    a := [Unit('s'), Unit('W'/'cm'^2)]; b := [t, G]

    [t, G]

    (3)

    Step2: Compute labels from the lists

    This step avoids the labeling error: No manual entry of units in labels required.

    c := [b[1]/a[1], typeset(b[2]/a[2])]; d := [typeset(b[1], "  ", "&lobrk;", a[1], "&robrk;"), typeset(b[2], "  &lobrk;", a[2], "&robrk;")]; e := [typeset(b[1], "  ", "(", a[1], ")"), typeset(b[2], "  (", a[2], ")")]

    [typeset(t, "  ", "(", Units:-Unit(s), ")"), typeset(G, "  (", Units:-Unit(W/cm^2), ")")]

    (4)

    NULL

     

    Dimensionless labels

     Double brackets

    Parenthesis

    plot(1361*Units:-Unit(W/m^2)*sin((1/12)*Pi*t/Units:-Unit(h)), t = 0 .. 12*Unit('h'), useunits = a, labels = c)

     

    plot(1361*Units:-Unit(W/m^2)*sin((1/12)*Pi*t/Units:-Unit(h)), t = 0 .. 12*Unit('h'), useunits = a, labels = d)

     

    plot(1361*Units:-Unit(W/m^2)*sin((1/12)*Pi*t/Units:-Unit(h)), t = 0 .. 12*Unit('h'), useunits = a, labels = e)

     

    The axis values equal physical quantities divided by their units. The algebraic equation G*cm^2/W = 0.8e-1, for example, is physically speaking correct. Most functions of Maple can process dimensionless expression of the kind G*cm^2/W if G is given with appropriate physical units.

    This way of using physical quantities is consistent with ISO 80000.  

    Used in Maple to enter units in 2D-Math input mode

    Can be confounded with functional notation. Units are therefore often written as a whole word (e.g. seconds instead of s).

     

     

    NULL

    The time to produce the above three plots was about 10 Minutes. The most part was spent to get the typesetting of the second and third plot correct.

     

    What takes significant more time (more a question of hours when Typesetting is used for the first time) are

     

    Labels with "/ cm^(2) "or 1/cm^2 formatting.

     

    This formatting might be preferred but is unfortunately again not free from user errors. (I would probably use it if there was a simple and safe way).

    f := [b[1]/a[1], b[2]/`#mrow(mo("W "),mo(" "),mo(" / "),msup(mo("cm"),mn("2")))`]; g := [typeset(b[1], "  ", "&lobrk;", a[1], "&robrk;"), typeset(b[2], "  &lobrk;", (`@`(`@`(Units:-Unit, numer), op))(a[2]), "/", (`@`(`@`(Units:-Unit, denom), op))(a[2]), "&robrk;")]; h := [typeset(b[1], "  ", "(", Unit('s'), ")"), typeset(b[2], "  (", `#mrow(mo("W"),mo(" "),msup(mo("cm"),mn("-2")))`, ")")]

    [typeset(t, "  ", "(", Units:-Unit(s), ")"), typeset(G, "  (", `#mrow(mo("W"),mo(" "),msup(mo("cm"),mn("-2")))`, ")")]

    (5)

     

    plot(1361*Units:-Unit(W/m^2)*sin((1/12)*Pi*t/Units:-Unit(h)), t = 0 .. 12*Unit('h'), useunits = a, labels = f)

     

    plot(1361*Units:-Unit(W/m^2)*sin((1/12)*Pi*t/Units:-Unit(h)), t = 0 .. 12*Unit('h'), useunits = a, labels = g)

     

    plot(1361*Units:-Unit(W/m^2)*sin((1/12)*Pi*t/Units:-Unit(h)), t = 0 .. 12*Unit('h'), useunits = a, labels = h)

     

    NULL

     

     

     

    Remarks

    • 

    For two reasons, I have not given an example with the often used square brackets [ ] because:
        
        Maple uses square brackets already for lists and indexing purposes,
        and ISO 80000 uses square brackets as an operator that extracts the unit from a physical quantity (e.g.       [G] = Unit('W'/'cm'^2)).

    • 

    Adding a unit to each value at axes ticks would definitely be a nice labeling feature for simple units.

    • 

    Programmatically analyzing the units defined in list a above and converting them in a generic way to a typesetting structure is not possible with a few high-level commands.

     

    • 

    For inline quotients like in 1/2, an additional backslash must be entered in 2D-Math: \/  

    Unit('W')/Unit('cm')^2

    Units:-Unit(W)/Units:-Unit(cm)^2

    (6)

         This will not prevent evaluation to a normal quotient but the input can be used to create an atomic variable (select with mouse -> 2-D Math -> Atomic Variable)

    `#mrow(mfenced(mi("W",fontstyle = "normal"),open = "&lobrk;",close = "&robrk;"),mo("&sol;"),mo("&InvisibleTimes;"),msup(mfenced(mi("cm",fontstyle = "normal"),open = "&lobrk;",close = "&robrk;"),mn("2")),mo("&InvisibleTimes;"))`

    `#mrow(mfenced(mi("W",fontstyle = "normal"),open = "&lobrk;",close = "&robrk;"),mo("&sol;"),mo("&InvisibleTimes;"),msup(mfenced(mi("cm",fontstyle = "normal"),open = "&lobrk;",close = "&robrk;"),mn("2")),mo("&InvisibleTimes;"))`

    (7)

         This makes labeling much easier as compared to typesetting commands (compare to the above statements).

    f := [b[1]/a[1], b[2]/`#mrow(mfenced(mi("W",fontstyle = "normal"),open = "&lobrk;",close = "&robrk;"),mo("&sol;"),mo("&InvisibleTimes;"),msup(mfenced(mi("cm",fontstyle = "normal"),open = "&lobrk;",close = "&robrk;"),mn("2")),mo("&InvisibleTimes;"))`]

    [t/Units:-Unit(s), G/`#mrow(mfenced(mi("W",fontstyle = "normal"),open = "&lobrk;",close = "&robrk;"),mo("&sol;"),mo("&InvisibleTimes;"),msup(mfenced(mi("cm",fontstyle = "normal"),open = "&lobrk;",close = "&robrk;"),mn("2")),mo("&InvisibleTimes;"))`]

    (8)

    In any case it is a good idea to read ?plot,typesetting before experimenting with typesetting.

     

    Axes_with_unit_labels.mw

    My personal preference is for dimensionless labels.

    Note:

    The solution to avoid labeling errors works only for Maple 2022 and higher.

    Some plot commands do not support plotting with units, or they do not fully support it yet.

     

    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!

    We have just released an update to Maple 2023 to address a couple of issues.

    • We’ve had a few reports of people encountering “Kernel connection has been lost” errors, and this update should fix that problem.
    • We fixed a problem involving entering math (specifically, the right curly bracket, } ) using an international keyboard.

    If you are experiencing kernel connection problems or use Maple with an international keyboard, you should install this update.

    This update is available through Tools>Check for Updates in Maple, and is also available from the Maple 2023.2.1 download page. MapleSim users can get this update from the MapleSim Check for Updates or from the MapleSim 2023.2.1 download page, where you will also find an update to the MapleSim Ropes and Pulleys Library.

    How much did you weigh when you were born? How tall are you? What is your current blood pressure? It is well documented that in the general population, these variables – birth weight, height, and blood pressure – are normally or approximately normally distributed. This is the case for many variables in the natural and social sciences, which makes the normal distribution a key distribution used in research and experiments. 

    The Maple Learn Examples Gallery now includes a series of documents about normal distributions and related topics in the Continuous Probability Distributions subcollection.

    The Normal Distribution: Overview will introduce you to the probability density function, cumulative distribution function, and the parameters of the distribution. This document also provides an opportunity for you to alter the parameters of a normal distribution and observe the resulting graphs. Try out a few real life examples to see the graphs of their distributions! For example, according to Statology, diastolic blood pressure for men is normally distributed with a mean of 80 mmHg and a standard deviation of 20 mmHg.

    Next, the Normal Distribution: Empirical Rule document introduces the empirical rule, also referred to as the 68-95-99.7 rule, which describes approximately what percentage of normally distributed data lies within one, two, and three standard deviations of the distribution’s mean.

    The empirical rule is frequently used to assess whether a set of data might fit a normal distribution, so Maple Learn also provides a Model Checking Exploration to help you familiarize yourself with applications of this rule. 

    In this exploration, you will work through a series of questions about various statistics from the data – the mean, standard deviation, and specific intervals – before you are asked to decide if the data could have come from a normal distribution. Throughout this investigation, you will use the intuition built from exploring the Normal Distribution: Overview and Normal Distribution: Empirical Rule documents as you analyze different data sets.

    Once you are confident in using the empirical rule and working with normal distributions, you can conduct your own model checking investigations in real life. Perhaps a set of quiz grades or the weights of apples available at a grocery store might follow a normal distribution – it’s up to you to find out!

    For years I've been angry that Maple isn't capable of formally manipulating random vectors (aka multivariate random variables).
    For the record Mathematica does.

    The problem I'm concerned with is to create a vector W such that

    type(W, RandomVariable)

    will return true.
    Of course defining W from its components w1, .., wN, where each w is a random variable is easy, even if these components are correlated or, more generally dependent ( the two concepts being equivalent iif all the w are gaussian random variables).
    But one looses the property that W is no longer a (multivariate) random variable.
    See a simple example here: NoRandomVectorsInMaple.mw

    This is the reason why I've developped among years several pieces of code to build a few multivariate random variable (multinormal, Dirichlet, Logistic-Normal, Skew Multivariate Normal, ...).

    In the framework of my activities, they are of great interest and the purpose of this post is to share what I have done on this subject by presenting the most classic example: the multivariate gaussian random variable.

    My leading idea was (is) to build a package named MVStatistics on the image of the Statistics package but devoted to Multi Variate random variables.
    I have already construct such a package aggregating about fifty different procedures. But this latter doesn't merit the appellation of "Maple package" because I'm not qualified to write something like this which would be at the same time perennial, robust, documented, open and conflict-free with the  Statistics package.
    In case any of you are interested in pursuing this work (because I'm about to change jobs), I can provide it all the different procedures I built to construct and manipulate multivariate random variables.

    To help you understand the principles I used, here is the most iconic example of a multivariate gaussian random variable.
    The attached file contains the following procedures

    MVNormal
      Constructs a gaussian random vector whose components can be mutually correlated
      The statistics defined in Distribution are: (this list could be extended to other
      statistics, provided they are "recognized" statitics, see at the end of this 
      post):
          PDF
          Mode
          Mean
          Variance
          StandardDeviation = add(s[k]*x[k], k=1..K)
          RandomSample
    
    DispersionEllipse
      Builds and draws the dispersion ellipses of a bivariate gaussia, random vector
    
    DispersionEllipsoid
      Builds and draws the dispersion ellipsoids of a trivariate gaussia, random vector
    
    MVstat
      Computes several statistics of a random vector (Mean, Variance, ...)
    
    Iserlis
      Computes the moments of any order of a gaussian random vector
    
    MVCentralMoment
      Computes the central moments of a gaussian random vector
    
    Conditional
      Builds the conditional random vector of a gaussian random vector wrt some of its components 
      the moments of any order of a gaussian random vector.
      Note: the result has type RandomVariable.
    
    MarginalizeAgainst
      Builds the marginal random vector of a gaussian random vector wrt some of its components 
      the moments of any order of a gaussian random vector.
      Note: the result has type RandomVariable.
    
    MardiaNormalityTest
      The multi-dimensional analogue of the Shapiro-Wilks normality test
    
    HZNormalityTest
      Henze-Zirkler test for Multivariate Normality
    
    MVWaldWolfowitzTest
      A multivariate version of the non-parametrix Wald-Folfowitz test
    

    Do not hesitate to ask me any questions that might come to mind.
    In particular, as Maple introduces limitations on the type of some attributes (for instance Mean  must be of algebraic type), I've been forced to lure it by transforming vector or matrix quantities into algebraic ones.
    An example is

    Mean = add(m[k]*x[k], k=1..K)

    where m[k] is the expectation of the kth component of this random vector.
    This implies using the procedure MVstat to "decode", for instance, what Mean returns and write it as a vector.

    MultivariateNormal.mw

    About the  statistics ths Statistics:-Distribution constructor recognizes:
    To get them one can do this (the Normal distribution seems to be the continuous one with the most exhaustive list os statistics):

    restart
    with(Statistics):
    X := RandomVariable(Normal(a, b)):
    attributes(X);
          protected, RandomVariable, _ProbabilityDistribution
    
    map(e -> printf("%a\n", e), [exports(attributes(X)[3])]):
    Conditions
    ParentName
    Parameters
    CharacteristicFunction
    CDF
    CGF
    HodgesLehmann
    Mean
    Median
    MGF
    Mode
    PDF
    RousseeuwCrouxSn
    StandardDeviation
    Support
    Variance
    CDFNumeric
    QuantileNumeric
    RandomSample
    RandomSampleSetup
    RandomVariate
    MaximumLikelihoodEstimate
    

    Unfortunately it happens that for some unknown reason a few statistics cannot be set by the user.
    This is for instance the case of Parameters serious consequences in certain situations.
    Among the other statistics that cannot be set by the user one finds:

    • ParentName,
    • QuantileNumeric  whose role is not very clear, at least for me, but which I suspect is a procedure which "inverts" the CDF to give a numerical estimation of a quantile given its probability.
      If it is so accessing  QuantileNumeric would be of great interest for distributions whose the quantiles have no closed form expressions.
    • CDFNumeric  (same remark as above)

    Finally, the statistics Conditions, which enables defining the conditions the elements of Parameters must verify are not at all suited for multivariate random variables.
    It is for instance impossible to declare that the variance matrix (or the correlation matrix) is a square symmetric positive definite matrix).

    A new feature has been released on Maple Learn called “collapsible sections”! This feature allows for users to hide content within sections on the canvas. You can create a section by highlighting the desired text and clicking this icon in the top toolbar:


    “Well, when can I actually use sections?” you may ask. Let me walk you through two quick scenarios so you can get an idea.


    For our first scenario, let’s say you’re an instructor. You just finished a lesson on the derivatives of trigonometric functions and you’re now going through practice problems. The question itself is not long enough to hide the answers, so you’re wondering how you can cover the two solutions below so that the students can try out the problem themselves first.




     

    Before, you might have considered hyperlinking a solution document or placing the solution lower down on the page. But now, collapsible sections have come to the rescue! Here’s how the document looks like now:  


     

    You can see that the solutions are now hidden, although the section title still indicates which solution it belongs to. Now, you can 1) keep both solutions hidden, 2) show one solution at a time, or 3) show solutions side-by side and compare them!

    Now for the second scenario, imagine you’re making a document which includes a detailed visualization such as in Johnson and Jackson’s proof of the Pythagorean theorem. You want the focus to be on the proof, not the visualizations commands that come along with the proof. What do you do?


    It’s an easy solution now that collapsible sections are available!


    Now, you can focus on the proof without being distracted by other information—although the visualization commands can still be accessed by expanding the section again.

    So, take inspiration and use sections to your advantage! We will be doing so as well. you may gradually notice some changes in existing documents in the Maple Learn Gallery as we update them to use collapsible sections. 

    Happy document-making!

    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). 

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