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
  • At 3:00 PM EST on Thursday, December 15, Maplesoft hosted a momentous hour in my life, my "retirement party" ending my career at Maplesoft. It was a day I had planned some four years ago when I dropped to a lighter schedule, and a day my wife has been awaiting for six years.

    Jim Cooper, CEO at Maplesoft, presented a very brief sketch of some milestones in my life, including my high school graduation in 1958, BA in 1963, MS in 1966, PhD in 1970, jobs at the University of Nebraska-Lincoln, Memorial University of Newfoundland, and the Rose-Hulman Institute of Technology. There was a picture of me taken from my high school graduation yearbook. There was a cake. There were kind words about my contributions to Maple, including "Clickable Calculus," the term and its meaning.

    I was handed the microphone - I knew what I wanted to say. My wife was present in the gathering. I pointed to her and said that all the congratulations should go to her who had waited so patiently for my retirement for six years. I thanked Maplesoft and all its employees for nearly 14 of the best years of my life, for I have thoroughly enjoyed my return to Canada and my work (more like play) at Maplesoft. 

    It's been a great opportunity to be part of the Maple experience, and now it's time for new ones. There'll be more woodworking in my basement woodshop where I make mostly noise and sawdust, some extra travel, more exercise and fresh air, long-delayed household projects, and whatever else my mate of 49 years asks.

    But the best part of all is that I'll still have a connection to Maplesoft - I'll continue doing two webinars a month, will maintain and update much of the content I've created for Maple while at Maplesoft, and contribute additional content of relevance to the Maple community. 

    Is this a bug?

    hypergeom([1, -1, 1/2], [-12,-3], 1);
    Error, (in hypergeom/check_parameters) function doesn't exist: missing appropriate negative integers in the first list of parameters to compensate the negatives integer(s): [-3], found in the second list.
     

    Yet this hypergeometric series terminates and Maple should be able to handle it, at least according to the Maple help page (the second rule below applies, yet the numerator has a smaller absolute value, so the first rule below applies).

    If some   n[i] is a non-positive integer, the series is finite (that is,   F(n, d, z)  is a polynomial in    z).
    If some  d[j]  is a non-positive integer, the function is undefined for all non-zero  z, unless there is also a negative upper parameter of smaller absolute value, in which case the previous rule applies.
     

     

    Interestingly, the Wolfram Mathematica app can evaluate this to 311/312.

     

     

    One way is coloring a surface on both sides. We build equidistant surface with very small radius and stain the equidistant surface in color different from the color of the original surface.
    Examples coloring of surfaces on both sides.  Radius equal to abs (0.0001).
    x3-0.5*exp(sin(x1+2.5*x2+x3))=0;
    (x1^2+x2^2-0.4)^2+(x3+sin(x1*x2+x3))^4-0.1=0;

    2_COLORS.mw


    Hi. Wanting a procedure, but not wanting to reinvent the wheel, I did a search on mapleprimes for "Shoelace" (formula). I got the response below indicating a hit. But clicking on the hypertext, i get to page 41 of Kitonums replies, but not the actual thing i wanted. I go to "find on this page" in my browser firefox and input "Shoelace"...nothing. enter "thU"...nothing. Do I really have to go through all of his replies on the page?

     
    Kitonum - Replies
    ... ThU. You are right. Shoelace's formula is a wonderful formula! It ... ThU. You
    are right. Shoelace's formula is a wonderful formula! It ...

    Let us consider

    restart; Digits := 20; evalf(Int(abs(cos(1/t)), t = 0 .. 0.1e-1), 3);
       -0.639e-2

    Pay your attention to the minus sign. Simply no words. Mma produces 0.006377.

    evalf@Int.mw

    Ian Thompson has written a new book, Understanding Maple.

    I've been browsing through the book and am quite pleased with what I've read so far. As a small format paperback of just over 200 pages it packs in a considerable amount of useful information aimed at the new Maple user. It says, "At the time of writing the current version is Maple 2016."

    The general scope and approach of the book is explained in its introduction, which can currently be previewed from the book's page on amazon.com. (Click on the image of the book's cover, to "Look inside", and then select "First Pages" in the "Book sections" tab in the left-panel.)

    While not intended as a substitute for the Maple manuals (which, together, are naturally larger and more comprehensive) the book describes some of the big landscape of Maple, which I expect to help the new user. But it also explains how Maple is working at a lower level. Here are two phrases that stuck out: "This book takes a command driven, or programmatic, approach to Maple, with the focus on the language rather than the interface", followed closely by, "...the simple building blocks that make up the Maple language can be assembled to solve complex problems in an efficient way."

     

     

     

    A population p(t) governed by the logistic equation with a constant rate of harvesting satisfies the initial value problem diff(p(t), t) = (2/5)*p(t)*(1-(1/100)*p(t))-h, p(0) = a. This model is typically analyzed by setting the derivative equal to zero and finding the two equilibrium solutions p = 50+`&+-`(5*sqrt(100-10*h)). A sketch of solutions p(t) for different values of a suggests that the larger equilibrium is stable; the smaller, unstable.

     

    When a is less that the unstable equilibrium, p(t) becomes zero at a time t[e], and the population becomes extinct. If p(t) is not interpreted as pertaining to a population, its graph exists beyond t[e], and actually has a vertical asymptote between the two branches of its graph.

     

    In the worksheet "Logistic Model with Harvesting", two questions are investigated, namely,

     

    1. How does the location of this vertical asymptote depend on on a and h?
    2. How does the extinction time t[e], the time at which p(t) = 0, depend on a and h?

    To answer the second question, an explicit solution p = p(a, h, t), readily provided by Maple, is set equal to zero and solved for t[e] = t[e](a, h). It turns out to be difficult both to graph the surface t[e](a, h) and to obtain a contour map of the level sets of this function. Instead, we solve for a = a(t[e], h) and obtain a graph of a(h) with t[e] as a slider-controlled parameter.

     

    To answer the first question, the explicit solution, which has the form alpha*tan(phi(a, h, t))*beta(h)+50, exhibits its vertical asymptote when phi(a, h, t) = -(1/2)*Pi. Solving this equation for t[a] = t[a](a, h) gives the time at which the vertical asymptote is located, a function that is as difficult to graph as t[e]. Again the remedy is to solve for, and graph, a = a(h), with t[a] as a slider-controlled parameter.

     

    Download the worksheet: Logistic_with_Harvesting.mw

    Ever needed to measure something and all you had was a piece of paper?  This leads us to how we can use maple to figure out what we can measure using a sheet of standard 8-1/2" x 11" paper.

    Can we measure 6" with a sheet of paper?

    > eq := (17/2)*x+11*y = 6;
                                      17             
                                eq := -- x + 11 y = 6
                                      2              
    > eq2 := isolve(eq, a);
                       eq2 := {x = -20 - 22 a, y = 16 + 17 a}
    > subs(a = 0, b = 0, eq2);
                                  {x = -20, y = 16}
    

    So that is the simplest case, stacking up 16 pieces on the long side and subtracting 20 on the short side.  A total of toppling the piece of paper over 36 times.  That's a high percentage of of error. 

    But wait!  haha.   Wouldn't a fold make it simpler?  Sure!  Fold the 8.5" across and we now have 2.5" to work with.

    > eq := (17/2)*x+11*y+(5/2)*z = 6;
                                   17            5      
                             eq := -- x + 11 y + - z = 6
                                   2             2      
    > eq2 := isolve(eq, {a, b});
               eq2 := {x = a, y = 1 + 4 a + 5 b, z = -2 - 21 a - 22 b}
    > subs(a = 0, b = 0, eq2);
                               {x = 0, y = 1, z = -2}
    

    Less toppling of pieces of paper and much less error. 

     

     

    Last week Michael Pisapia, Maplesoft European VP, attended the opening reception of Mathematics: The Winton Gallery at the Science Museum in London. Ahead of being open to the public on 8th December, contributors and donors were invited to take a look behind the scenes of the new gallery, which explores how mathematicians, their tools and ideas have helped to shape the modern world over the last four hundred years.

    The gallery is a spectacular space, designed by the world-renowned Zaha Hadid Architects, housing over a hundred artefacts of mathematical origin or significance. It is divided up into disciplines ranging from navigation to risk assessment, and gambling to architecture. Inspired by the Handley Page aircraft, the largest object on display, and suspended as the centrepiece, the gallery is laid out using principles of mathematics and physics. It follows the lines of airflow around it in a stunning display of imagined aerodynamics, brought to life using light and sculpture. You can learn more about its design in this video.

    Guests at the reception enjoyed a specially commissioned piece of music from the Royal College of Music titled ‘Gugnunc’, named after the aircraft and inspired by the rhythms of Morse code and mathematical and mechanical processes, and performed at the centre of the gallery.

    Of course any exhibit celebrating all things maths is of great interest to us here at Maplesoft, but this one especially so, since Mathematics: The Winton Gallery showcases the earliest available version of Maple.

    A copy of Maple V, from 1997, sits in ‘The Power of Computers’ section of the Winton Gallery, in an exhibit which tells the story of the significant role played by mathematical software in improving the quality of mathematics education and research. Other objects in the section include a Calculating Machine from the Scientific Service circa 1939, a PDP-8 minicomputer from the 1960s, and part of Charles Babbage’s mid-19th century analytical engine, intended as a high-powered mathematical calculator.

    As many of you will remember, Maple V was a major milestone in the history of Maple, providing unparalleled interactivity, powerful symbolics and creative visualization in mathematical computation and modeling. For a walk down memory lane, check out Maple V: The Future of Mathematics (ca. 1994) on YouTube.

    Seeing this copy of Maple finally in place in the exhibit marks the end of a long journey – and not just in the miles it travelled to arrive at the museum from its home in Canada. When we were first approached by the Science Museum for a donation of Maple, we launched a hunt to find not just the right copy of Maple with its box and manuals, but also artefacts that showcased the origin and history of Maple. It was a journey down memory lane for the inventors of Maple as well as the first few employees as they dug out old correspondences, photos, posters and other memorabilia that could be showcased. Today they can be proud of their contribution to this display at the Science Museum. 

    Although the case of historic software packages is visually less impressive than many of the other items in the gallery, it certainly attracted plenty of attention as guests made their way in for the first time. 

    For fans of Maple V - and there are many - it’s reassuring that the Science Museum are now entrusted with preserving not only the iconic packaging, but with telling the story of Maple’s history and marking its place in the evolution of mathematics and technology.

    To learn more about Mathematics: The Winton Gallery, its highlights and architecture, visit http://www.sciencemuseum.org.uk/mathematics

    To see the timeline of Maple’s evolution over the years, visit:  http://www.maplesoft.com/25anniversary/

    Let us consider 

    Student[Precalculus]:-LimitTutor(sqrt(x), x = 2);

    One expects a nice illustration of the result sqrt(2). But instead of that one reads "f(x) approaches 1.41 as x approaches 2". This is simply ignorant and forms a wrong understanding of limits. It should also be noticed that all the entries (left, 2-sided, and right) produce the same animation. The same issue with other limits I tried, e.g.

    Student[Precalculus]:-LimitTutor(sqrt(x), x = 1);

    . I think this command should be completely rewritten or excluded from Maple. 

    A number of MaplePrimers have asked how one might use the section and subsections of a Maple worksheet to structure the source code of an extended Maple package.  The usual answer is that it cannot be done; a module-based Maple package must be assigned in a single input region in a worksheet.  A recommended alternative is to write the source in text files and use either command line tools or the Maple read command from a worksheet to assign the package.  Because the read command handles Maple preprocessor macros, specifically the $include macro, the source can be conveniently split into smaller files.

    I prefer this file-based method for development because text files are generally more robust than Maple worksheets, can be edited with the user's preferred editor, can be put under version control, and can be searched and modified by standard Unix-based tools.  However, not everyone is familiar with this method of development.  With that in mind, I wrote a small Maple package, CodeBuilder, that permits splitting the source of a Maple package (or any Maple code) into separate code edit regions in a standard Maple worksheet, using $include macros to include the source of other regions.  To build the package, the code edit regions are written to external files, using the names of the regions as the local file name relative to a temporary directory.

    The package includes a method to run mint on the source code.  The result can be either printed in the worksheet or displayed in a pop-up maplet that allows selecting the infolevel and the region to check.

    CodeBuilder includes help pages and a simple example (referenced from the top-level help page) demonstrating the usage.  To install the package, unzip the attached zip file and follow the directions in the README file.

    CodeBuilder-1-0-3.zip

    Errata Just noticed that a last minute change broke some of the code.  Do not bother with the 1-0-1 version; I'll upload a new version shortly.  The latest version (1-0-3) is now available.

    Let us look in RealDomain and then in the RealDomain:-solve command. One is addressed to the usual solve command. The commands of the RealDomain package are not still documented since Maple 7 when the package was introduced. There is a general description only 

    • By default, Maple performs computations under the assumption that the underlying number system is the complex field. The RealDomain package provides an environment in which computations are performed under the assumption that the basic underlying number system is the field of real numbers.
    • Results returned by procedures are postprocessed by discarding values containing any detectable non-real answers or replacing them with undefined where appropriate.

    The above is not enough. Here is an example which confuses me: 

    RealDomain:-solve(exp(I*x) = -1, AllSolutions);
    NULL

    though 

    solve(exp(I*x) = -1, AllSolutions);
                             Pi (2 _Z1 + 1)
    

    and 

    RealDomain:-solve(exp(I*x) = -1);
                                   Pi
    

    I lie awake thinking about that. Maplesoft staff help me!

    The DFT windowing functions in the SignalProcessing package seem to be inconsistent in the type of data they will accept, and the type they return.

    BartlettHannWindow,  BlackmanHarrisWindow, BlackmanNuttallWindow,   BohmanWindow, CauchyWindow, CosineWindow, ExponentialWindow, FlatTopWindow,  GaussianWindow, HannPoissonWindow, ParzenWindow, PoissonWindow,  RectangleWindow, ReiszWindow, RiemannWindow, TaperedCosineWindow, TriangleWindow, TukeyWindow

    accept Arrays, containing almost any data type (haven't tried them all!) as input. and always return a Vector[row].

    But

    BartlettWindow, BlackmanWindow, HammingWindow, HannWindow, KaiserWindow

    require that the option datatype=float[8] be set in the Array() constructor, which is used as input and always return an hfarray.

    Thus, for example

    with(SignalProcessing);
    sig:= Array( -50..50,
                            fill=1
                        ):
    BartlettHannWindow(sig); # this works
    BartlettWindow(sig);# this fails with datatype unsupported error

    Very confusing!!!!

    Let us consider 

    Statistics:-Mode(Binomial(n, p));
                            floor((1 + n) p)
    

    Up to Wiki, the output is not correct. Simply no words.

    The copy paste and snip tool used to work.  I can no longer use either to paste in mapleprimes.

    2 3 4 5 6 7 8 Last Page 4 of 249