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
  • We have just released a new version of MapleSim.  The MapleSim 2018 family of products offers new tools for developing digital twins, greater connectivity with other modeling tools, and expanded modeling scope. Improvements include:

    • New tools for creating motion profiles
    • FMI  import for FMI 2.0 Fixed-Step Co-Simulation
    • Optimized handling of large models
    • Inclusion of temperature effects in the MapleSim Hydraulics Library from Modelon and MapleSim Pneumatics Library from Modelon
    • Heat transfer through air and water with the MapleSim Heat Transfer Library from CYBERNET

    See What’s New in MapleSim 2018 for more information about these and other improvements.

    Who should be considered an 'expert'? How does one achieve expert status? In this guest MaplePrimes blog post, 'Understanding Maple' author Ian Thompson discusses his view of what makes an expert, his journey of becoming an expert in Maple, and the process of putting together and perfecting this resource for Maple users.

     

    In days of 8-bit computers, one would sometimes encounter individuals who knew everything about a particular device or piece of software. Single programmers wrote entire applications or games, and some could debug their work by looking directly at a core dump (a printout of the numbers stored in the computer’s memory). Some even managed to take computers beyond their specifications by exploiting design loopholes that the manufacturers hadn’t foreseen or intended. It would be fair to classify such individuals as ‘experts’.

    Fast forward twenty five years, and the picture is far less clear. The complexity of computers and software has grown to such an extent that even relatively small smartphone applications are created by teams of developers, and nobody understands every aspect of a CPU chip, much less an entire PC or tablet. Who now should be classified as an expert? One possibility is that an expert is a person who may sometimes need to look up the details of a rarely used command or feature, but who is never confused or frustrated by the behavior of the system or software in question (except where there is a bug), and never needs help from anyone, except perhaps on rare occasions from its creators.

    This rather stringent definition makes me an expert in only two areas of computing: the Fortran programming language, and the mathematical computation system Maple. An argument could be made for the typesetting system LATEX, but whilst this has a large number of expert users, there is also a much smaller group of more exalted experts, who maintain the system and develop new packages and extensions. It would be fair to say that I fall into the first category, but not the second.*

    How does one achieve expert status? Some software actively prevents this, by hiding its workings to such an extent that fully understanding its behavior is impossible. Where it is possible to gain expert status, I have experienced two very different routes, both starting during my time as a research student, when it became clear that Fortran and Maple would be useful in my work. There were several parallels. I knew a little about both, having used them for basic tasks as an undergraduate. However, working out why things went wrong and how to fix them was time-consuming and unrewarding, since it often relied on magic recipes obtained from unreliable sources, and in many cases I didn’t really understand why these worked, any more than I understood why my own attempts had not. I realized then that knowing a little was at the root of these problems. Partial knowledge, supplemented by contradictory, outdated and even downright bad advice from websites and well-meaning individuals (some of whom invariably labor under false pretences of their own expert status) is not an efficient way to approach scientific computing. In fact it’s just a recipe for frustration. In the case of Fortran, fixing this turned out to be easy, because there are lots of good books on the subject. Reading one of these eliminated all of my problems with the language at a stroke. I can’t claim that I remembered every command and its syntax, nor do I know them all now. This is hardly surprising — the Fortran Language Standard (a very terse document that sets out everything the language provides) now extends to more than 600 pages. Instead, the book provided a general picture of how things work in Fortran, and showed the right way to go about tackling a problem. This investment in time has since paid itself back hundreds of times over.

    The route to expert status in Maple was far more challenging. Its own help pages give a very comprehensive description of individual commands, but they are intended as a reference guide, and if it’s possible to become an expert using these alone, then I never discovered the correct order in which to read them. I found a number of books on Maple in the university library, but most were too basic to be useful, and others focused on particular applications. None seemed likely to give me the general picture — the feel for how things work — that would make Maple into the time-saving resource it was intended to be.

    The picture became clearer after I taught Maple to students in three different courses. Nothing encourages learning better than the necessity to teach someone else! Investigating the problems that students experienced gave me new opportunities to properly understand Maple, and eventually the few remaining gaps were filled in by the Programming Guide. This is a complex document, similar in length to the Fortran Language Standard, but with more examples. Personally I would only recommend it to readers with experience of programming language specifications. Students now started to ask how I came to know so much about Maple, and whether there was a book that would teach them the same. Since no such book existed, I decided to write one myself. As the old adage goes, if you want something doing properly, do it yourself. The project soon began to evolve as I tried to set down everything that the majority of Maple users need to know. I’ve always hated books that skirt around important but difficult topics, so where before I might have used a dirty trick to circumnavigate a problem, now I felt compelled to research exactly what was going on, and to try to explain it in a simple, concise way. When the first draft was complete, I approached Cambridge University Press (CUP). The editor arranged for reviews by four anonymous referees**, and by Maplesoft’s own programming team. This led to several major improvements. My colleague, Dr Martyn Hughes, also deserves a mention for his efforts in reading and commenting on four different drafts. Meanwhile, Maplesoft continued to release new editions of their software, and the drafts had to be revised to keep up with these. The cover was created by one of CUP’s designers, with instructions that it should not look too ‘treeish’ — one might be surprised by the number of books that have been written about Maple syrup, and it would be a shame for Understanding Maple to be mixed up with these by potential readers browsing the internet. Then there were the minor details: how wide should the pages be? What font should be used? Should disk be spelled with a ‘c’ or a ‘k’? Could quotes from other sources be used without the threat of legal action over copyright infringement? One rights holder laughably tried to charge $200 for a fragment of text from one of their books. Needless to say, no greenbacks were forthcoming.

    The resulting book is concise, with all the key concepts needed to gain an understanding of Maple, alongside numerous examples, packed into a mere 228 pages. It gives new users a solid introduction, and doesn’t avoid difficult topics. It isn’t perfect (in fact I have already started to list revisions that will be made if a second edition is published in the future) but I’ve seen very few problems that can’t be solved with the material it contains. Only time will tell if Understanding Maple will it create new experts. At the very least, I would certainly like to think it will make Maple far easier to grasp, and help new users to avoid some of the traps that caught me out many years ago.

     

    Learn more about Understanding Maple, which is published by Cambridge University Press.

    There are many questions that complain about Latex conversion in Maple.

    I'd like to again request that Maplesoft improves Latex output of its expressions. If Maple can just fix how it generates fractions, that will good enough for now.

    I am willing to send Maplesoft a personal check of the amount of one month salary for one of your developers to do this fix if you are willing to do it. It should not take more than one month to do this simple fix in your code. It might even take one day if someone knows the code.

    The problem comes when there is a fraction in the expression. the Latex output instead of using proper latex code using "\frac{}{}", it instead uses "/" which makes the output terrible.

    Another case, where Maple generate (expression)^{-1} instead of \frac{1}{expression}.

    It can't be that hard to fix these 2 issues, which can go a long way towards making the latex generated by Maple much better. Here is an example

    eq:=-(1/2)*1/y = (1/3)*x^3+z:
    sol:=solve(eq,y);

    latex(sol);
    -3/2\, \left( {x}^{3}+3\,z \right) ^{-1}

    Which renders as

    Which is terrible. The screen output is much better.

    Compare this to Mathematica

    eq = -(1/2)*(1/y) == (1/3)*x^3 + z;
    sol = y /. First@Solve[eq, y];
    TeXForm[sol]
    
       -\frac{3}{2 \left(x^3+3 z\right)}

    Which renders in Latex as

    If Maplesoft does not think Latex is improtant, then they are completely wrong. CAS support in Latex is very important. Ignoring Latex means you will lose customers who want good Latex support of the math output of Maple. After all, Math and Latex go togother. And Maple is supposed to be all about Mathematics.

    Any chance of Maplesoft taking some time to fix these issues in Latex? Maple has not had any improvement in Latex for years and years. I keep buying Maple each year, and nothing changes in its Latex export.

    thank you

    vv if you could please help adjust your code.  I've adjusted the start of the eurocup code to match the world cup however I haven't decoded your coding and probably won't be able to have time before the world cup starts.  I've got as far as adding the teams, flags and ratings of each team.

    Let me just say while copying and pasting the flag bytes to the code, Maple became a bitch to work worth (pardon my language) but I became so frustated because my laptop locked up twice.  The more I worked with Maple the slower it got, until it froze right up.  Copying and pasting large data in maple is almost to near IMPOSSIBLE.  .. perhaps this could be a side conversation.

    Here's the world cup file so far.

    2018_World_Cup.mw

    **edit added**
    Fixed flag sizes, couple of other fixes in other stats and added some additional stats
    2018_World_Cup7.mw

     

    ANIMATED image of cascade of opening matryoshkas

    E.R. Ibragimova

     

     

    ИбрагимоваЭ.Р_03_Казань_Матрёшки.mws

    Murtazin Shamil, 6th grade

    Simulation of the animated image "Flask with bubbles"

     

    FLASC_Murtazin_S.A..mw

    In as much as the embedded component suite is a brilliant tool for the custom design of online educational programs, student tests, etc, my purposes are orientated around encouraging and assisting of self directed investigation, with the utilization of the packages of maple, but in a manner that allows the user to neglect the requirement to have any knowledge of maple code itself, allowing them to focus entirely on their discipline of choice. 

    So because the content the user will enter into the interface I am designing is naturally going to be quite variant from individual to individual, one of the  necessary properties that does not exist is for the math containers to have the option of being resizeable at the discretion of the user.

    At the moment, I have added buttons that allow the user to resize the window by pressing one of four buttons entitled "increase height". "decrease height", "increase width" and "decrease height". This will suffice for my first working prototype but i just feel that it would be much neater if it were possible to resize the math component directly, and some option of the neighbouring embedded components to either shift their position accordingly, or maintain rectilinear alignment with the greater proportion of other components by all embedded components shifting accordingly when one math container is resized.

     

    I just feel that if at least one person less experienced than me reads this it will be a worth while post, because it will help them avoid things that eluded me when I was younger.


     

    The omitted function definitions are not relevant to the reason for which I decided to post about this. I would like the maple user to simply observe how many variables are involved in the relation's (R) three equalities in the consideration of the output.

     

    The reason I believe this is important, is that it is sometimes very easy to believe induction is sufficient proof of the truth value of a relation over the superset of a subset that has been enumerated, much like the example of the coefficients of the
    "105^(th) cyclotomic polynomial if one were to inductively reason statements about the coeffiecents of the previous 104 polynomials."

     

     

    A[n, k, M] = abs(C[0](n, k, M))/abs(C[1](n, k, M)); B[n, k, M] = abs(C[0](n, k, M))/abs(C[2](n, k, M)); E[n, k, M] = abs(C[1](n, k, M))/abs(C[2](n, k, M))

    R

    "`𝓃`(A[n,k,M])=`𝓃`(B[n,k,M]), `𝓃`(E[n,k,M])=`𝒹`(A[n,k,M]),`𝒹`(B[n,k,M])=`𝒹`(E[n,k,M])]"

    for t to 7 do R(t, 2, 30) end do

    [1 = 1, 1 = 1, 1 = 1]

     

    [1 = 1, 1 = 1, 1 = 1]

     

    [1 = 1, 1 = 1, 1 = 1]

     

    [1 = 1, 1 = 1, 1 = 1]

     

    [1 = 1, 1 = 1, 1 = 1]

     

    [1 = 1, 1 = 1, 1 = 1]

     

    [1 = 11^(1/2)*7^(1/2), 11^(1/2)*7^(1/2) = 1, 7 = 7]

    (1)


     

    Download INDUCTION_IS_NOT_YOUR_FREN.mw

    Up to swMATH   Maple is referenced in 4183 articles   in zbMATH   and

    up to swMATH Mathematica is referenced in 4654 articles  in zbMATH.

    These numbers are sure unexpected to me. I think the ratio of the prices of academic editions MMA/Maple (which approximately equals 2 ) truly reflects their capabilities.

     

    At a recent undegraduate competition the students had to compute the following limit

     

    Limit( n * Diff( (exp(x)-1)/x, x$n), n=infinity ) assuming x<>0;

    Limit(n*(Diff((exp(x)-1)/x, `$`(x, n))), n = infinity)

    (1)

     

    Maple is able to compute the symbolic n-fold derivative and I hoped that the limit will be computed at once.

    Unfortunately it is not so easy.
    Maybe someone finds a more more straightforward way.

     

    restart;

    f := n * diff( (exp(x)-1)/x, x$n );

    n*(-1/x)^n*(-GAMMA(n+1)+GAMMA(n+1, -x))/x

    (2)

    limit(%, n=infinity);

    limit(n*(-1/x)^n*(-GAMMA(n+1)+GAMMA(n+1, -x))/x, n = infinity)

    (3)

    simplify(%) assuming x>0;

    limit(-(-1)^n*x^(-n-1)*n*(GAMMA(n+1)-GAMMA(n+1, -x)), n = infinity)

    (4)

     

    So, Maple cannot compute directly the limit.

     

    convert(f, Int) assuming n::posint;

    -n*(-1/x)^n*(-x)^(n+1)*GAMMA(2+n)*(Int(exp(_t1*x)*_t1^n, _t1 = 0 .. 1))/((n+1)*(Int(_k1^n*exp(-_k1), _k1 = 0 .. infinity))*x)

    (5)

    J:=simplify(%)  assuming n::posint;

    n*(Int(exp(x*_k1)*_k1^n, _k1 = 0 .. 1))*GAMMA(n+1)/(Int(_k1^n*exp(-_k1), _k1 = 0 .. infinity))

    (6)

    L:=convert(J, Int) assuming n::posint;

    n*(Int(exp(x*_k1)*_k1^n, _k1 = 0 .. 1))

    (7)

    L:=subs(_k1=u, L);

    n*(Int(exp(x*u)*u^n, u = 0 .. 1))

    (8)

     

    Now it should be easy, but Maple needs help.

     

    with(IntegrationTools):

    L1:=Change(L, u^n = t, t) assuming n::posint;

    Int(exp((x*t^(1/n)*n+ln(t))/n), t = 0 .. 1)

    (9)

    limit(L1, n=infinity);  # OK

    exp(x)

    (10)

    ####################################################################

    Note that the limit can also be computed using an integration by parts, but Maple refuses to finalize:

    Parts(L, exp(u*x)) assuming n::posint;

    n*(exp(x)/(n+1)-(Int(u^(n+1)*x*exp(x*u)/(n+1), u = 0 .. 1)))

    (11)

    simplify(%);

    n*(-x*(Int(u^(n+1)*exp(x*u), u = 0 .. 1))+exp(x))/(n+1)

    (12)

    limit(%, n=infinity);

    limit(n*(-x*(Int(u^(n+1)*exp(x*u), u = 0 .. 1))+exp(x))/(n+1), n = infinity)

    (13)

    value(%);  # we are almost back!

    limit(n*((-x)^(-n)*(-(n+1)*n*GAMMA(n)/x-(-x)^n*(x-n-1)*exp(x)/x+(n+1)*n*GAMMA(n, -x)/x)+exp(x))/(n+1), n = infinity)

    (14)

     

    Typically, we publish a “Meet Your Developers” profile, where you can get an inside look at the lives of our developers. Today, we’re excited to bring you something a little different, a glimpse into the life of Maple Product Manager, Samir Khan.

    Let's get right to it.

    1. What do you do at Maplesoft?

    I’m 50% of the product management team for Maple. I act as an interface between our developers, mathematicians, marketing, sales, and users.

    I spend a lot of time speaking to current and potential customers – this is the most important part of my job.

    At the beginning of each development cycle, I work with the developers to put together a list of proposed features. Then, during the year, I try to keep development on track to meet the proposed goals and provide continual feedback.

    I also develop applications that demonstrate Maple’s functionality in new and different ways (most are on the Application Center).

    2. What did you study in school?

    I studied Chemical Engineering.

    3. What area(s) of Maple are you currently focusing on in your development?

    While I don’t do any direct development of Maple features, I sometimes prototype code as a proof of concept. The developers then look at me with a sense of disdain, tear my prototype apart, and rewrite my code from the ground up.

    4. What’s the coolest feature of Maple that you’ve had a hand in developing?

    While I generally don’t develop any production code, I’ve been responsible for driving the ThermophysicalData package forward

    5. What do you like most about working at Maplesoft? How long have you worked here?

    I’ve worked at Maplesoft since 2008. It’s a cliché, but I like the people first and foremost.

    I also like the flexibility of my role. Within reason, I can devote part of my time doing things that I think will benefit the company. For example, I get to write lots of applications about subjects that interest me (usually thermodynamics or chemistry).

    6. Favourite hobby?

    I gave up all my hobbies when kids appeared on the scene. Before that, I wrote spreadsheets for financial modeling

    Now, I like to do home science experiments with my son. Yesterday, I mixed yeast with hydrogen peroxide to demonstrate an exothermic reaction.

    7. What do you like on your pizza?

    Pineapple and mushrooms.

    8. What’s your favourite movie?

    I don’t really have a single favourite movie, but these movies that have the greatest impact on me over the last few years

    • Interstellar
    • Annihilation
    • Dunkirk
    • The Witch
    • Frozen (yes, really)

    9. What skill would you love to learn? (That you haven’t already) Why?

    I want to learn how to juggle to amuse my kids. However, I don’t have the hand-eye coordination to be any good

    10. Who’s your favourite mathematician?

    That’s a really dreary question.

    Instead, I’ll answer two completely different questions.

    • My favorite kids TV show is Ben and Holly’s Little Kingdom
    • I usually listen to Slayer on the drive into work

     

    Thanks Samir!

    It post can be called a continuation of the theme “Determination of the angles of the manipulator with the help of its mathematical model. Inverse  problem”.
    Consider  the use of manipulators as multi-axis CNC machines.
    Three-link manipulator with 5 degrees of freedom. In these examples  one of the restrictions on the movement of the manipulator links is that the position of the last link coincides with the normal to the surface along the entire trajectory of the working point movement.
    That is, we, as it were, mathematically transform a system with many degrees of freedom to an analog of a lever mechanism with one degree of freedom, so that we can do the necessary work in a convenient to us way.
    It seems that this approach is fully applicable directly to multi-axis CNC machines.

    (In the texts of the programs, the normalization is carried out with respect to the coordinates of the last point, in order that the lengths of the integration interval coincide with the path length.)
    MAN_3_5_for_MP.mw

    MAN_3_5_for_MP_TR.mw

    I like to use Maple debugger to help me debug and I am sure many do.

    It is good that Maple comes with a debugger. I type "stopat(proc_name);" and then the debugger comes up when proc_name is called.

    But the Maple debugger is hard to use. It appears to be primitive compared to other commerical debuggers that come with other known developments systems.

    For example, the output of "enter a debugger command" is displayed back into the same screen where the code is listed. This makes hard to see. There is only one window. It is also hard to see where one is in the source code is. So I have to keep clicking on the "list" button to display the lines again and look for the small "*" on the left.

    Basically, it is good to have the debugger, but it seems Maplesoft is not doing any improvements to make it easier to use. It is so 1980 looking compared to other easy and powerful to use debuggers, such as Matlab debugger, Visual studio, and others.

    Could Maplesoft please make some improvements to the debugger? At least make separate side window for output of debugger commands, and improve the code listing issue? It will also be nice to have a call stack view, and variable view window, and to see where one is in the call chain.

    Is this the only debugger available for Maple? 

    add, floats, and Kahan sum

     

    I found an intresting fact about the Maple command add for floating point values.
    It seems that add in this case uses a summation algorithm in order to reduce the numerical error.
    It is probably the Kahan summation algorithm (see wiki), but I wonder why this fact is not documented.

    Here is a simple Maple procedure describing and implementing the algorithm.

     

     

    restart;

    Digits:=15;

    15

    (1)

    KahanSum := proc(f::procedure, ab::range)  
    local S,c,y,t, i;      # https://en.wikipedia.org/wiki/Kahan_summation_algorithm
    S := 0.0;              # S = result (final sum: add(f(n), n=a..b))
    c := 0.0;              # c = compensation for lost low-order bits.
    for i from lhs(ab) to rhs(ab) do
        y := f(i) - c;     
        t := S + y;              
        c := (t - S) - y;        
        S := t;                  
    od;                         
    return S
    end proc:

     

    Now, a numerical example.

     

     

    f:= n ->  evalf(1/(n+1/n^3+1) - 1/(n+1+1/(n+1)^3+1));

    proc (n) options operator, arrow; evalf(1/(n+1/n^3+1)-1/(n+2+1/(n+1)^3)) end proc

    (2)

    n := 50000;
    K := KahanSum(f, 1..n);

    50000

     

    .333313334133301

    (3)

    A := add(f(k),k=1..n);

    .333313334133302

    (4)

    s:=0.0:  for i to n do s:=s+f(i) od:
    's' = s;

    s = .333313334133413

    (5)

    exact:=( 1/3 - 1/(n+1+1/(n+1)^3+1) );

    6250249999999900000/18751875067501050009

    (6)

    evalf( [errK = K-exact, errA = A-exact, err_for=s-exact] );

    [errK = 0., errA = 0.1e-14, err_for = 0.112e-12]

    (7)

    evalf[20]( [errK = K-exact, errA = A-exact, err_for=s-exact] );

    [errK = -0.33461e-15, errA = 0.66539e-15, err_for = 0.11166539e-12]

    (8)

     


    Download KahanSum.mw

    At Maplesoft, we are excited to be celebrating our 30th year of incorporation. This anniversary is a tremendous milestone for us. As a leading provider of mathematics-based software solutions for science, technology, engineering and mathematics (STEM), this longevity attests to our ability to grow along with changing market conditions, to continually enhance the quality of our offerings and strengthen our partnerships with industry leaders.

    As a company, it is our goal to actively connect and partner with our users and industry leaders to advance STEM education and continue to revolutionize engineering design processes. When it comes to academics, we believe our partnerships and outreach initiatives help improve STEM education, develop and enhance digital learning tools and foster online education. To that end, Maplesoft is an Affiliate Member of the Fields Institute, Educational Outreach Champion of Perimeter Institute, and Technology Partner of the American Math Society’s “Who Wants to be a Mathematician” student competition. On the commercial side, we work closely with our commercial partners to seamlessly integrate our technology with complementary tools. Our relationships with prominent companies such as Rockwell Automation, B&R, Altair and more, allow us to continue leading this charge.

    At Maplesoft, we work continuously to improve our technology offerings by developing new products and enhancing our existing technology. Maple 2018, the newest version of our flagship product Maple, offers new and improved features to benefit all users, no matter what they use Maple for. It provides an environment where students and instructors can enrich the classroom experience, researchers can accelerate their projects and engineers can refine their calculation management processes. Möbius, our online courseware platform, enables instructors to author rich content, explore important STEM concepts using engaging, interactive applications, visualize problems and solutions, and test students’ understanding by answering questions that are graded instantly.

    On the engineering side, we are revolutionizing the engineering design process using Digital Twins, which are virtual machine designs created in MapleSim, Maplesoft’s modeling and simulation software. By taking a virtual approach to machine-level system integration, engineers can commission faster, earlier, and with less risk.

    Maplesoft has come a long way since our humble beginnings as a research project at the University of Waterloo. Our website features a timeline that provides insights and information on our incredible journey. The company was built on a foundation of creativity and passion for mathematics and we have worked hard to preserve that legacy. The growth experienced over the past 30 years, along with the drive of our global employee and partner base, will ensure Maplesoft continues to be a driving force in the world of online education and design engineering long into the future.

    We invite you to join us as we continue our journey towards new and exciting developments and innovations.

    First 37 38 39 40 41 42 43 Last Page 39 of 297