Product Tips & Techniques

Tips and Tricks on how to get the most about Maple and MapleSim

A user would like to know if it is possible to specify a data set say, x:=[1,2,3,4,5,6] and then extract a random sample from that data set, i.e. xsample:=[3,2,4] for a bootstrapping-type calculation.

We suggested they use something like the following:

restart; with(Statistics); my_data := [1, 2, 4, 5.5, 5.5, 6]; X := RandomVariable(EmpiricalDistribution(my_data)); s := Sample(X, 10); Bootstrap(Mean, X, samplesize = 4, replications = 10000)

HFloat(3.9984625)

(1)

NULL

Download array-random-sample.mw

A user wonders if there is a straightforward way to show US states with names using the WorldMap Data Set in Maple

We suggest something like the attached: map-of-us-with-states.mw

 

restart; with(DataSets:-Builtin); r := Reference("GeoNames"); states := r[[Country = "United States", Type = "first-order administrative division"]]; w := WorldMap(); w:-AddPoints(w, states); Display(w, mapdata = fine, style = polygonoutline, size = [2000, 1500])

 

 

Although not mentioned in the documentation, the flexible beam component of MapleSim allows for simulation of large deflections.  

In the animation, a flexible beam is loaded with a moment (red arrow) at its free end. Assuming an Euler-Bernoulli beam and slow loading (i.e., no dynamic forces), the beam should deform to an arc of constant radiusNot only the deformation of the beam can be described analytically, also the path (red trace) of the free end follows an analytical curve.

 

I used this test case to get a better understanding of nonlinearities observed in an oscillating system using flexible beams. The system required tuning of the structure to develop mode coupling. This could not be explained by linear theory. It was unclear whether the large deflections (nonlinear kinematics of the beam) themselves or the implementation of the flexible beam component were responsible for that.  

 

What I have learned so far with the test case using only default settings: 

  • For moderate deflections there is no difference to textbook formulas.
  • Up to 15 degrees rotation of the end frame, the difference between observed displacement and the Bernoulli beam stays bellow 5%.  
  • Up to 30 degrees rotation of the end frame (as in the mode coupling example) the trace of the end frame conforms well with the analytical path.
  • To simulate very large deflections beyond 45 degrees rotation, the beam needs to be segmented to closely follow the analytical path.  

For those that are unsure about the fidelity of their models, I can suggest increasing the numbers of flexible beam components and to compare. I did this in the case of the mode coupling example and noticed no difference. So, the component was not responsible for the nonlinearities. It were the kinematics.

It's unclear whether this good performance in large deflections was intended or is a byproduct of the sophisticated multibody dynamics under the hood.  Maybe an expert can tell more.

Overall, to what I have seen the (static) performance was very satisfying. Judging dynamic performance is much more difficult. Has anyone experience to share with that?

Flexible_beams_const_moment_curve_MP.mw

Flexible_beams_const_Moment_single_beam_MP.msim

Flexible_beams_const_Moment_7_beams_MP.msim

is what I have used.

We’ve been busy! We have just released the 2021.2 updates for Maple, Maple Flow, and MapleSim. Here’s a quick overview. These updates are freely available to all customers who have the 2021 version of these products.

Maple

The Maple update includes a variety of corrections and improvements to the math engine and interface. It is available through Tools>Check for Updates in Maple, and is also available from the Maple 2021 download page, where you can also find more details.

In particular, this update includes fixes to the bug in the combine command when working with double summations, and the problems when performing context menu operations on values with units while in Document mode, both of which were reported on MaplePrimes. As always, we appreciate the feedback!

Maple Flow

The Maple Flow 2021.2 update offers a richer range of formatting features for creating professional-looking engineering documents, which have been requested by customers. Highlights include sections, controlling the display of commands, annotating images, and disabling automatic evaluation while making a series of changes.  This update is available from the Maple Flow 2021.2 download page, which also contains more details.

MapleSim

Lots of good stuff here that makes it easier to build and analyze models, including productivity features that speed up the creation of models that use hydraulics, support for the latest CAD file formats in the MapleSim CAD toolbox, the ability to model drift conditions with the MapleSim Tire Library, tools for simulating 3-D winding effects with the MapleSim Ropes and Pulleys Library, and a new MapleSim Web Handling Library add-on (which, I am sad to say, has nothing to do with Spiderman). See What’s New in MapleSim for details, and the MapleSim 2021.2 download page for instruction on how to obtain your update.

One of the things I love most about my job is working and collaborating with math teachers across the globe. Every discussion leads to additional insights into the challenges facing teachers today, and new ideas on how to make Maple and Maple Learn better. And sometimes, I even learn some math I thought I already knew!

A few months ago, I introduced Maple Learn to a friend of mine who teaches high school math in Kingston, Ontario. I showed her how she could use Maple Learn to teach many concepts during our call, including Completing the Square. I walked her through Maple Learn’s free-form canvas and explained how her students could work through a problem line-by-line just as they would in their notebooks. I highlighted the live plot window and showed how her students could graphically verify that their solution was equivalent to the initial expression. And, I demonstrated the power of Maple Learn’s intelligent context panel and how her students could check their answers algebraically. I thought I had done a good job, until she said: “Karishma, that’s not how we teach Completing the Square anymore!”. Huh! I was floored. What I had shown was the way I had learned the concept so many years ago. I was surprised to learn that there was a new way.

My friend then introduced me to Algebra Tiles and how she used it to teach Completing the Square. Once we went through a few examples, I realized that I had never fully appreciated what I was doing when I completed the square. I had memorized a series of steps without really understanding what I was trying to do. The progression of our discussion naturally led to the inevitable question: “Karishma, does Maple Learn include Algebra tiles? Because that would be a game-changer for my students. Currently, we use physical tiles, but with remote learning, we need something digital.” At that time, my answer was ‘not yet’; however, with the introduction of image support last week, I’m happy to announce that Maple Learn can support algebra tiles and other interactive supports.

Here is the Maple Learn document I created on Completing the Square using Algebra Tiles.

Feel free to change the expressions listed in the document and share it with your students. To see algebra tiles in action inside Maple Learn, take a look at the short video that I created.  If you have any suggestions for improving this application, please feel free to let me know.

 


 

This is my second try---my previous post about the Maple Conference  https://www.maplesoft.com/mapleconference/2021/ seems to have vanished into thin electrons.

Anyway!  The conference opens tomorrow!  There are many really interesting prerecorded talks, three live plenaries, two excellent panels, and registration is free!  See the above link.

I look forward to "seeing" you tomorrow.

Rob Corless, co-Chair of the Program Committee

on behalf of the organizers

Dear all,

The November issue of Maple Transactions is now up (we will be adding a few more items to that issue over the course of the month).  See https://mapletransactions.org/index.php/maple/index for the articles.

More importantly, Maple Primes seems to have a great many interesting posts, some of which could well be worked up into a paper (or a video).  Maple Transactions accepts worksheets (documents, workbooks) for publication, as well, although we want a high standard of readability for that.  I invite you to contribute.

The next issue of Maple Transactions will be the Special Issue that is the Proceedings of the Maple Conference 2021 (see my previous post :)

-r

From a tweet by Tamás Görbe : plotting Chebyshev polynomials in polar coordinates leads to some interesting pictures.  Screenshot here, link to the worksheet (and some perhaps interesting puzzles) at the end.

 

ChebyshevRose.mw

Calling all fans of customizable documents! What am I saying, we’re all fans of customizable documents here. Well, we’re all in luck, then, because with our latest updates to Maple Learn you can tailor even more details of your documents to your exact specifications. Read on to see what’s new!

As we all know, graphs are not merely a method of communicating mathematical concepts, but are of course an art form that can be used to display both mathematical and aesthetic beauty. But sometimes, you may find a little something getting in the way of that beauty… those darn gridlines. Even the most elegant of graphs can be tarnished by this faint, criss-crossing lines. But have no fear! With our latest updates, you can fix this problem with the click of a button. Simply select “Plot Settings” from the graph controls to the right of the plot window, and set Axes to “None”. Finally, your graph is pristine. What’s more, that’s not the only new feature we’ve added to the Plot Settings menu. You can also set the axes to “Boxed”, allowing you to see the gridline labels no matter how from the origin you are on the graph. You can also manually set the boundaries of your axes! No more scrolling and zooming to get the perspective just right.

As if that wasn’t enough, we’ve also added another exciting feature that will help make your graphs look exactly as you want them. By clicking the small graph icon to the left of your expression, you can customize the colour of your plot! You can choose from a wide variety of pre-set colours, or you can use our colour selector to get the exact shade you want. Any custom colours will be temporarily added to the bottom of the colour palette, so you can be sure that your graphs are consistent. At last, you can rest assured that your Maple Learn graphs won’t clash with your outfit.

What’s more, if you’re a fan of graph customizability, then this is the set of updates for you. We’ve added two more features that will help make your graphs both pretty and easy to understand. Tired of trying to draw shapes, only to have each side be a different colour? Well, no more! We’ve adjusted the Segment command to accept as many coordinates as you’d like, allowing you to create polygons (or just funky zigzags) to your heart’s content! As well, we’ve introduced a new command: the Label command. Now you can add text right onto the plot window and label your graph as you see fit. Or maybe you could use the Maple Learn plot window to start drafting a best-selling novel. The possibilities are endless!

We also wanted to take a moment to highlight our Example Gallery. We’ve made some changes to make it easier to find the examples you’re looking for. And with over 400 documents and counting, we’re sure to have what you want! But, on the off-chance we don’t, let us know! We’d love to hear about what you’d like to see. And as always, that goes for both the Example Gallery and for any features you’d like in Maple Learn itself! We appreciate your feedback.

Dear all,

Reversion of series---computing a series for the functional inverse of a function---has been in Maple since forever, but many people are not aware of how easy it is.  Here's an example, where we are looking for "self-reverting" series---which I called "ambiverts".  Anyway have fun.

 

https://maple.cloud/app/5974582695821312/Series+Reversion%3A+Looking+for+ambiverts

PS There looks to be some "code rot" in the branch point series for Lambert W in Maple, which we encounter in that worksheet.  Or, I may simply have not coded it very well in the first place (yeah, that was mine, once upon a time).  Checking now.  But there is a workaround (albeit an ugly one) shown in that worksheet.

 

 

Dear all,

Recently we learned that the idea of "anti-secularity" in perturbation methods was known to Mathieu already by 1868, predating Lindstedt by several years.  The Maple worksheet linked below recapitulates Mathieu's computations:

https://github.com/rcorless/MathieuPerturbationMethod

Nic Fillion and I wrote a more general introduction to perturbation methods using Maple and you can find that paper at 

https://arxiv.org/abs/1609.01321

and the supporting Maple code in a workbook at 

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

For instance, one of the problems solved is the lengthening pendulum and when we do so taking proper account of anti-secularity (we use renormalization for that one, I seem to remember) we get an error curve that is bounded over time.

 

 

Hope that some of you find this useful.

Welcome to Maplesoft Orientation Week!  We know what a difference math software can make when it comes to enhancing student learning, but we also know that everyone is very busy at the beginning of the school year! So our goal for this week is to make it easier for high school and university students to select the best math tool for their needs, and help them get on track for a great math year.  The week’s activities include free training on Maple and Maple Learn, discounts on Student Maple, live events with some of your favorite math TikTok personalities, and even the chance to win an iPad Air!  Check out all the activities now, and plan your week or tell your students.

Orientation week runs Mon. Sept. 20 – Fri. Sept. 24.

Hi everyone! It's been a remarkably long time since I posted on MaplePrimes -- I should probably briefly reintroduce myself to the community here. My name is Erik Postma. I manage the mathematical software group at Maplesoft: the team that writes most of the Maple-language code in the Maple product, also known as the math library. You can find a longer introduction at this link.

One of my tasks at Maplesoft is the following. When a request for tech support comes in, our tech support team can usually answer the request by themselves. But no single person can know everything, and when specialized knowledge of Maple's mathematical library is needed, they ask my team for help. I screen such requests, answer what I can by myself, and send the even more specialized requests to the experts responsible for the appropriate part of the library.

Yesterday I received a request from a user asking how to unwrap angles occurring in an expression. This is the general idea of taking the fact that sin(phi) = 'sin'(phi + 2*Pi), and similarly for the other trig functions; and using it to modify an expression of the form sin(phi) to make it look "nicer" by adding or subtracting a multiple of 2*Pi to the angle. For a constant, real value of phi you would simply make the result be as close to 0 as possible; this is discussed in e.g. this MaplePrimes question, but the expressions that this user was interested in had arguments for the trig functions that involved variables, too.

In such cases, the easiest solution is usually to write a small piece of custom code that the user can use. You might think that we should just add all these bits and pieces to the Maple product, so that everyone can use them -- but there are several reasons why that's not usually a good idea:

  • Such code is often too specialized for general use.
  • Sometimes it is reliable enough to use if we can communicate a particular caveat to the user -- "this will not work if condition XYZ occurs" -- but if it's part of the Maple library, an unsuspecting user might try it under condition XYZ and maybe get a wrong answer.
  • This type of code code generally doesn't undergo the careful interface design, the testing process, and the documentation effort that we apply to the code that we ship as part of the product; to bring it up to the standards required for shipping it as part of Maple might increase the time spent from, say, 15 minutes, to several days.

That said, I thought this case was interesting enough to post on MaplePrimes, so that the community can take a look - maybe there is something here that can help you with your own code.

So here is the concrete question from the user. They have expressions coming from an inverse Laplace transform, such as:

with(inttrans):
F := -0.3000*(-1 + exp(-s))*s/(0.0500*s^2 + 0.1*s + 125);
f := invlaplace(F, s, t)*u(t);
# result: (.1680672269e-1*exp(1.-1.*t)*Heaviside(t-1.)*(7.141428429*sin(49.98999900*t-
#         49.98999900)-357.*cos(49.98999900*t-49.98999900))+.1680672269e-1*(-7.141428429*sin
#         (49.98999900*t)+357.*cos(49.98999900*t))*exp(-1.*t))*u(t)

I interpreted their request for unwrapping these angles as replacing the expressions of the form sin(c1 * t + c0) with versions where the constant term was unwrapped. Thinking a bit about how to be safe if unexpected expressions show up, I came up with the following solution:

unwrap_trig_functions := module()
local ModuleApply := proc(expr :: algebraic, $)
  return evalindets(expr, ':-trig', process_trig);
end proc;

local process_trig := proc(expr :: trig, $)
  local terms := convert(op(expr), ':-list', ':-`+`');
  local const, nonconst;
  const, nonconst := selectremove(type, terms, ':-complexcons');
  const := add(const);
  local result := add(nonconst) + (
    if is(const = 0) then
      0;
    else
      const := evalf(const);
      if type(const, ':-float') then
        frem(const, 2.*Pi);
      else
        frem(Re(const), 2.*Pi) + I*Im(const);
      end if;
    end if);
  return op(0, expr)(result);
end proc;
end module;

# To use this, with f defined as above:
f2 := unwrap_trig_functions(f);
# result: (.1680672269e-1*exp(1.-1.*t)*Heaviside(t-1.)*(7.141428429*sin(49.98999900*t+
#         .27548346)-357.*cos(49.98999900*t+.27548346))+.1680672269e-1*(-7.141428429*sin(
#         49.98999900*t)+357.*cos(49.98999900*t))*exp(-1.*t))*u(t)

Exercise for the reader, in case you expect to encounter very large constant terms: replace the calls to frem above with the code that Alec Mihailovs wrote in the question linked above!

Another series of updates to Maple Learn? It’s almost like we’re constantly working on Maple Learn to add more features and improve based on your feedback! Wild, right? Anyways, here’s some of the latest features we’ve added to Maple Learn.

First, we’re very excited to present our new Example Gallery. Not only does it have a shiny new design, but there are now over 400 example documents in just about every area of mathematics you can think of.  These documents are perfect for seeing how Maple Learn can be used to teach and explore concepts, and you can easily modify them to suit your own needs. We’re still working hard on improving the Example Gallery and its content, so let us know what you want to see!

We’ve also got some shiny new features in Maple Learn itself. Do you ever look at a graph and think, “Wow, this is great and all, but I sure would love if it had fewer straight lines and more circles?” I know I do. Luckily for both of us, Maple Learn now supports polar coordinates! Just click the round globe icon to see your plots transformed to the circular form you’ve always wanted them to be.

Looking to enhance the text portion of your documents, rather than the graphs? We’ve got just the thing for you—Maple Learn now supports bullet lists! Take your pick of numerical lists, alphabetical, or your traditional bullet point. If you’re looking to augment your document with a step-by-step process, a list of your favourite mathematical expressions, or you’re just feeling tired of using pen and paper for grocery lists, Maple Learn now has what you need.

Speaking of improving the layout of your documents, we now have an option for horizontal tables. The vertical tables can get a bit a long, especially for a short document, but with horizontal tables you can keep all your documents cozy and compact.

And as always, this is just a taste of what we’ve been up to. We’ve also improved a variety of features (including our new steps feature!) and fixed an assortment of bugs. And remember, we couldn’t do this without you! Please continue to let us know what you’d like to see in Maple Learn, and someday it could be your request featured in our post!

Maple Learn is a great tool for checking the answer to your math problems, but what happens when your answer is wrong and you don’t know why? Knowing there’s a mistake doesn’t actually tell you what that mistake is. Luckily for you, Maple Learn’s newest feature is here to help you out: steps! Now, with the click of a button, you can see full, step-by-step solutions to a wide variety of problems. Instead of endlessly pouring over your work to find that one misplaced negative sign, you can check the steps to quickly and easily spot where you went wrong. Plus, if you’re having trouble figuring out how to approach a problem, you can sneak a peek at the first few steps to get the ball rolling. Full solutions are an invaluable learning tool, and we’re excited to be able to share them with our users.

A screenshot of Maple Learn showing the derivative of an equation. Next to the derivative is a button labeled Steps, with a graphic of a pair of footsteps.

Getting the steps is simple. When you perform an operation using the Context Panel, you’ll see a “Steps” button appear next to the solution when steps are available. Just click this button! This will take you to a new Maple Learn document showing you a full, detailed solution. Plus, if you want to bring the steps into another document, you can then click the “Copy to Clipboard” button. Checking your solution has never been easier!

What sorts of problems do we have steps for, you might ask? Good question! The answer is a resounding “most of them”. Are you a high schooler? We’ve got steps for factoring, expansion, and solving both equations and linear systems. Doing calculus? Derivatives, integrals, limits, and even solving differential equations all have full solutions available. How about linear algebra? Absolutely! We provide steps for Gauss-Jordan elimination, matrix inversion, finding eigenvalues and eigenvectors, and calculating the determinant! And that’s just a taste of what Maple Learn can do. We’re working constantly to expand our roster of steps, so let us know what you want to see!

I hear what some of you must be thinking: “But what about when I don’t have my computer with me? I never know when I’m going to need a step-by-step solution to a math problem!” If that’s you, then check out the Maple Calculator! The Maple Calculator provides full solutions just like Maple Learn, and you can carry it around in your pocket for math-on-the-go. With Maple Learn and the Maple Calculator on your side, no math problem can stop you now.

First 7 8 9 10 11 12 13 Last Page 9 of 66