MaplePrimes Commons General Technical Discussions

The primary forum for technical discussions.

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.

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.

The first update to the Maple 2018 Physics, Differential Equations and Mathematical Functions packages is available. As has been the case since 2013, this update contains fixes, enhancements to existing functionality, and new developments in the three areas.

To install the update: open Maple and click the Cloud icon (upper-right corner), select "Packages" and search for "Physics Updates". Then, in the corresponding "Actions" column, click the third icon (install pop-up).

NOTE May/1: the "Updates" icon of the MapleCloud toolbar (that opens when you click the upper-right icon within a Maple document / worksheet), now works fine, after having installed the Physics Updates version 32 or higher.

For many people, today is just another day in March. It’s not like the release of a new version of a software product is a world-shaking event. But for us here at Maplesoft, these first few days after the latest version of Maple is released are always a bit more special. There’s always a nervous energy whenever we release Maple and everyone else gets to see what we’ve been pouring our efforts into for the past year.

I’m not going to start this post by calling the latest version of Maple “game-changing” or “cutting edge” or any other marketing friendly platitude. I’m well aware that the latest version of Maple isn’t going to change the world.

What I would say though is that with every new release of software comes an opportunity. Every new software release is an opportunity to re-evaluate how that software has evolved to better suit your needs and requirements. So… if you've been sitting on the sidelines and watching version after version go by, assuming that it won't affect you, that's wrong! There's a lot that you could be missing out on.

The way that these release announcements usually work is that we try to amaze and astound you with a long list of features. Don’t worry, I’ll get into that in a bit. But first I wanted to walk through a simple exercise of release arithmetic.

I’ll start with one of those basic truths that has always been hiding in plain sight. The build number # for Maple 2018 is 1298750. Here at Maplesoft, every time our developers make a change to Maple this build number goes up by 1. These changes are sometimes small and sometimes very big; they can be as small as fixing a documentation typo or they can constitute implementing a major feature spread across numerous files in our source tree.

I have come to look at these build numbers in a slightly different way. I look at build numbers as representing all of the small to large sized steps our developers take to get you from one version to the next (or put another way, how many steps behind you are if you are using the older versions). With that in mind, let’s do some quick math:

If you are using Maple 2017 (2017.0 was build # 1231047), there have been 1298750 – 1231047 = 67703 steps since that release (these numerous "steps" are what built the "long list" of features below). If you’re using Maple 2016 (#1113130) this number grows to 185620. And so it goes… Maple 2015 (#1022128) = 276622 steps, Maple 18 (#922027) = 376723, Maple 17 (#813473) = 485277, you get the idea. If you’re using a really old version of Maple – there’s a good chance that we have fixed up a bunch of stuff or added something that you might find interesting in the time since your last upgrade!

Every new release of Maple adds functionality that pushes Maple into new domains, rounds out existing packages, fills gaps, and addresses common user requests. Let's explore some additions:

Clickable Math - a.k.a. math that looks like math and can be interacted with using your mouse - has evolved. What was once a collection of operations found in the right-click or main menu items or in interactive smart-popups or in many additional dialogs, has been brought together and enhanced to form the new Context Panel.

We can summarize the Context Panel as follows: Enter an expression and relevant operations that you can apply to that expression appear in a panel on the right side of your screen. Easy, right? It's a great change that unlocks a large part of the Maple library for you.

The addition of the Context Panel is important. It represents a shift in the interaction model for Maple – you’ll see more and more interaction being driven through the context panel in future releases. Already, the changes for the Context Panel permeate through to various other parts of Maple too. You’ll see an example in the Units section below and here’s another for coding applications.

The Context Panel also gives you access to embedded component properties – this makes it much easier to modify parts of your application.

There’s much more we can say about the Context Panel but in the interest of keeping this post (somewhat) concise I’ll stop there. If you are interested and want to see more examples, watch this video.

Coding in Maple - For many of us, using the Maple coding language is fundamental; it's just what we do. Whether you write a lot of procedures, or modify the start-up code for your worksheet, or put a sequence of commands in a code edit region, or include a button or slider in your application, you’ll find yourself using Maple’s code editing tools.

For Code Edit Regions and the Maple Code Editor, there’s automatic command completion for packages, commands, and even file paths.

maplemint has been integrated into the Code Editor, providing code analysis while you write your code.

mint and maplemint have been unified and upgraded. If you’ve never heard of these before, these are tools for analysing your Maple code. They provide information on procedures, giving parameter naming conflicts, unreachable code, unused parameters or variables, and more. Mint is available for use with external text files and maplemint runs directly inside of Maple.

For many engineers and scientists, units are intrinsically linked with calculations. Here's something else in Maple 2018 that will improve your everyday experience – units are now supported in many core routines such as in numeric equation solving, integration, and optimization.

Here’s a quick example of using units in the int command with some thermophysical data:

We define an expression that gives the pressure of methane as a function of the specific volume V.

Near and dear to my heart, data analysts also have some occasion to rejoice. Maple 2018 finally adds an Interpolate command that supports irregular data! This is one of those items that users have been requesting for a long time and I'm very happy to say that it's finally here.

I’ll also mention some updates to the Maple language – items that the readers of this forum will likely find useful.

Dates and Times – Maple 2018 adds new data structures that represent dates and times. There are numerous functions that work with dates and times, including fundamental operations such as date arithmetic and more advanced functionality for working with Calendars.

today := Date();

Year( today ), DayOfMonth( today ), Month( today );

Date arithmetic:

One_year_ago := today - 365*Unit(d);

Until - An optional until clause has been added to Maple's loop control structure.

Here's an example, the following code finds the next prime number after 37 and then terminates the loop.

n := 37;

do n := n+1 until

isprime(n):

n;

As always with these posts, we can't cover everything. This post is really just the beginning of the story. I would love to spend another couple of pages describing the inner-workings of every single improvement to Maple 2018 for you; however I'd rather you just try these features yourself, so go ahead, get out there and try out Maple 2018 today. You won't be disappointed that you did.

The Joint Mathematics Meetings are taking place this week (January 10 – 13) in San Diego, California, U.S.A. This will be the 101th annual winter meeting of the Mathematical Association of America (MAA) and the 124nd annual meeting of the American Mathematical Society (AMS).

Maplesoft will be exhibiting at booth #505 as well as in the networking area. Please stop by our booth or the networking area to chat with me and other members of the Maplesoft team, as well as to pick up some free Maplesoft swag or win some prizes.

There are also several interesting Maple-related talks and events happening this week - I would definitely not miss the talk by our own Paulina Chin on grading sketch graphs.

In Quantum Mechanics, in the coordinates representation, the component of the momentum operator along the x axis is given by the differential operator

The purpose of the exercises below is thus to derive the commutation rules, in the coordinates representation, between an arbitrary function of the coordinates and the related momentum, departing from the differential representation

These two exercises illustrate how to have full control of the computational process by using different elements of the Maple language, including inert representations of abstract vectorial differential operators, Hermitian operators, algebra rules, etc.

These exercises also illustrate a new feature of the Physics package, introduced in Maple 2017, that is getting refined (the computation below requires the Maplesoft updates of the Physics package) which is the ability to perform computations algebraically, using the product operator, but with differential operators, and transform the products into the application of the operators only when we want that, as we do with paper and pencil.

>

Start setting the problem:

–

all of are Hermitian operators

–

all of commute between each other

–

tell the system only that the operators are the differentiation variables of the corresponding (differential) operators but do not tell what is the form of the operators

>

(1.1)

Assuming is a smooth function, the idea is to apply the commutator to an arbitrary ket of the Hilbert space , perform the operation explicitly after setting a differential operator representation for , and from there get the commutation rule between and .

Start introducing the commutator, to proceed with full control of the operations we use the inert form %Commutator

>

>

(1.2)

>

(1.3)

For illustration purposes only (not necessary), expand this commutator

>

(1.4)

Note that , and the ket are operands in the products above and that they do not commute: we indicated that the coordinates are the differentiation variables of . This emulates what we do when computing with these operators with paper and pencil, where we represent the application of a differential operator as a product operation.

This representation can be transformed into the (traditional in computer algebra) application of the differential operator when desired, as follows:

>

(1.5)

Note that, in , the application of is not expanded: at this point nothing is known about , it is not necessarily a linear operator. In the Quantum Mechanics problem at hands, however, it is. So give now the operator an explicit representation as a linear vectorial differential operator (we use the inert form %Nabla, , to be able to proceed with full control one step at a time)

>

(1.6)

The expression (1.5) becomes

>

(1.7)

Activate now the inert operator and simplify taking into account the algebra rules for the coordinate operators

>

(1.8)

To make explicit the gradient in disguise on the right-hand side, factor out the arbitrary ket

>

(1.9)

Combine now the expanded gradient into its inert (not-expanded) form

>

(1.10)

Since (1.10) is true for all, this ket can be removed from both sides of the equation. One can do that either taking coefficients (see Coefficients) or multiplying by the "formal inverse" of this ket, arriving at the (expected) form of the commutation rule between and

>

(1.11)

Tensor notation,

The computation rule for position and momentum, this time in tensor notation, is performed in the same way, just that, additionally, specify that the space indices to be used are lowercase latin letters, and set the relationship between the differential operators and the coordinates directly using tensor notation.

You can also specify that the metric is Euclidean, but that is not necessary: the default metric of the Physics package, a Minkowski spacetime, includes a 3D subspace that is Euclidean, and the default signature, (- - - +), is not a problem regarding this computation.

>

>

(2.1)

Define now the tensor

>

(2.2)

Introduce now the Commutator, this time in active form, to show how to reobtain the non-expanded form at the end by resorting the operands in products

>

(2.3)

Expand first (not necessary) to see how the operator is going to be applied

>

(2.4)

Now expand and directly apply in one ago the differential operator

>

(2.5)

Introducing the explicit differential operator representation for , here again using the inert to keep control of the computations step by step

>

(2.6)

The expanded and applied commutator (2.5) becomes

>

(2.7)

Activate now the inert operators and simplify taking into account Einstein's rule for repeated indices

>

(2.8)

Since the ket is arbitrary, we can take coefficients (or multiply by the formal Inverse of this ket as done in the previous section). For illustration purposes, we use Coefficients and note hwo it automatically expands the commutator

>

(2.9)

One can undo this (frequently undesired) expansion of the commutator by sorting the products on the left-hand side using the commutator between and

>

(2.10)

And that is the result we wanted to compute.

Additionally, to see this rule in matrix form,

>

(2.11)

In the above, we use equation (2.10) multiplied by -1 to avoid a minus sign in all the elements of (2.11), due to having worked with the default signature (- - - +); this minus sign is not necessary if in the Setup at the beginning one also sets

For display purposes, to see this matrix expressed in terms of the geometrical components of the momentum , redefine the tensor explicitly indicating its Cartesian components

>

(2.12)

>

(2.13)

Finally, in a typical situation, these commutation rules are to be taken into account in further computations, and for that purpose they can be added to the setup via

>

(2.14)

For example, from herein computations are performed taking into account that

We’ve just released a major new version of MapleSim. The MapleSim 2017 family of products provides new and improved model development and analysis tools, expands modeling scope, introduces new deployment options, and strengthens toolchain connectivity. Here are some highlights:

The new Initialization Diagnostics App further simplifies the initialization task by helping you determine how your initial values are computed and what you need to do to adjust them.

The new Modal Analysis App helps you explore and understand the natural vibration modes of your mechanism, so you can determine how to reduce the vibration in the final product.

Over 100 new components include expansions to the Electrical and Magnetic libraries.

A new Modelica® code editor makes it easier to create Modelica-based custom components.

The MapleSim Heat Transfer Library from CYBERNET, a new add-on component library, provides a comprehensive view into heat transfer effects in your model, enabling you to refine your design to improve performance and avoid overheating.

The new MapleSim Explorer product provides a cost-effective deployment solution that allows you to make MapleSim models available to more people in your organization.

Try More/GeneratePDF in the menu under a post/question. See screen_26.09.17.docx as an example of a result. Also Adobe Acrobat Reader fails with it. That was submitted to MaplePrimes staff through the Contact button at the bottom of this page. I obtained no feedback from them.

The "analysis" of maple's capabilities are presented as somewhat limited in comparison to mathematica's - I wonder if this is a simple bias/misinformation of the author, or if his conclusions are correct.

I have received a congratulations from a Mapleprime user for my post (on Finite Element Analysis - Basics) posted two years earlier. I did not touch that subject for two years for obvious reasons. Now that a motivation has come, I have decided to post my second application using embedded components. This I was working for the past two years and with the support from Maplesoft technical support team and Dr.RobertLopez. I thank them here for this workbook has come out well to my satisfaction and has given me confidence to post it public.

About the workbook

I have tried to improve the performance of a 2-Stroke gasoline engine to match that of a four stroke engine by using exhaust gas recirculation. Orifice concept is new and by changing the orifice diameter and varying the % of EGR, performance was monitored and data stored in Excel workbook. These data can be imported to Maple workbook by you as you want for each performance characteristic. The data are only my experimental and not authentic for any commercial use.

This Maple workbook generates curves from data for various experiments conducted by modifying the field variables namely Orifice diameter, % Exhaust gas Recirculation and Heat Exchanger Cooling. Hence optimum design selection is possible for best performance.

Thanks for commenting, congratulating or critisising!! All for my learning and improving my Maple understanding!!

A new code based on higher derivative method has been implemented in Maple. A sample code is given below and explained. Because of the symbolic nature of Maple, this method works very well for a wide range of BVP problems.

The code solves BVPs written in the first order form dy/dx = f (Maple’s dsolve numeric converts general BVPs to this form and solves).

The code can handle unknown parameters in the model if sufficient boundary conditions are provided.

This code has been tested from Maple 8 to Maple 2017. For Digits:=15 or less, this code works in all of the Maple versions tested.

Most problems can be solved with Digits:=15 with atol = 1e-10 or so. This code can be used to get a tolerance value of 1e-20 or any high precision as needed by changing the number of Digits accordingly. This may be needed if the original variables are not properly sacled. With arbitrarily high Digits, the code fails in Maple 18 or later version, etc because Maple does not support SparseDirect Solver at high precision in some of the versions (hopefuly this bug can be removed in the future versions).

For simple problems, Maple’s dsolve/numeric is superior to the code developed as it is implemented in hardware floats. For large scale problems and stiff problems, the method developed is much more superior to Maple and comparable to (and often times better than) state of the art codes for BVPs - bvp4c (MATLAB), COLSYS,TWPBVP, etc.

The code, as written, cannot be used for problems with a singularity at end points (doable in the future). In addition, mixed boundary conditions are not supported in this version of the code (for example, y1(1)=y2(0)). Future updates will include the application of this approach for DAE-BVPs, currently not supported by Maple’s dsolve/numeric command.

A paper has been submitted to JCAM. I welcome feedback on the code and solicit input from Mapleprimes members if they are able to test (and break this code) for any BVP.

Troesch's problemThis is an inherently unstable, difficult, nonlinear, two-point BVP formulated by Weibel and Troesch that describes the confinement of a place column by radiation pressure. Increasing epsilon increases the stiffness of the ODE. 1. E.S. Weibel, On the confinement of a plasma by magnetostatic fields, Phys. Fluids. 2 (1959) 52-56.2. B. Troesch, A simple approach to a sensitive two-point boundary value problem, J. Comput. Phys. 21 (1976) 279-290.

IntroductionThe package HDM solves boundary value problems (BVPs) using higher derivative methods (HDM) in Maple®. We explain how to solve BVPs using this package. HDM can numerically solve BVPs of ordinary differential equations (ODEs) of the form shown is the fowllowing example.

Define the left boundary condition (bc1), and the right boundary condition (bc2). One should collect all the terms in one side.

>

bc1:=evalf([y1(x)]);

(3)

>

bc2:=evalf([y1(x)-1]);

(4)

>

Define the range (bc1 to bc2) of this BVP.

>

Range:=[0.,1.];

(5)

>

List any known parameters in the list.

>

pars:=[epsilon=2];

(6)

>

List any unknown parameters in the list. When there is no unknown parameter, use [ ].

>

unknownpars:=[];

(7)

>

Define the initial derivative in nder (default is 5 for 10th order) and the number of the nodes in nele (default is 10 and distributed evenly across the range provided by the user). The code adapts to increase the order. For many problems, 10th order method with 10 elements are sufficient.

>

nder:=5;nele:=10;

(8)

>

Define the absolute and relative tolerance for the local error. The error calculation is done based on the norm of both the 9th and 10th order simulation results.

>

atol:=1e-6;rtol:=atol/100;

(9)

>

Call HDMadapt procedure, input all the information entered above and save the solution in sol. HDMadapt procedure does not need the initial guess for the mesh.

Was just pondering this idea and posted this in the post topic for discussion.

Each Maple finished version of Maple may still have certain bugs that will not be updated for that version, so I am suggesting (I think anyone could implement it) that if there is a workaround, one could wrap it up in something I would call a patch package updateable by us users we could update here on mapleprimes. It would be good for people who haven't upgraded or can't upgrade due to costs etc...

For example, there was recent issue with pdsolve that was fixed quite quickly in the seperate updateable Physics package. Things could be done similarily that might work with other workarounds using this patch package idea.

If anyone thinks this is good or even viable idea then lets implement it. I envisioned it with just this one rule to follow - the name of the patch package would reflect the version we are patching (ie. with(patch12) or with(patch2016) for Maple 12 and Maple 2016 respectively etc...) We could make these patch packages available in this post or start another.