Maplesoft Blog

The Maplesoft blog contains posts coming from the heart of Maplesoft. Find out what is coming next in the world of Maple, and get the best tips and tricks from the Maple experts.

This MaplePrimes guest blog post is from Dr. James Smith, an Assistant Lecturer in the Electrical Engineering and Computer Science Department of York University’s Lassonde School of Engineering. His team has been working with Maplesim to improve the design of assistive devices.

As we go through our everyday lives, we rarely give much thought to the complex motions and movements our bodies go through on a regular basis. Motions and movements that seem so simple on the surface require more strength and coordination to execute than we realize. And these are made far more difficult as we age or when our health is in decline. So what can be done to assist us with these functions?

In recent years, my research team and I have been working on developing more practical and streamlined devices to assist humans with everyday movements, such as standing and sitting. Our objective was to determine if energy could be regenerated in prosthetic devices during these movements, similar to the way in which hybrid electric vehicles recover waste heat from braking and convert it into useable energy.

People use – and potentially generate – more energy than they realize in carrying out common, everyday movements. Our research for this project focused on the leg joints, and investigated which of the three joints (ankle, knee or hip) was able to regenerate the most energy throughout a sitting or standing motion. We were confident that determining this would lead to the development of more efficient locomotive devices for people suffering from diseases or disabilities affecting the muscles around these joints.

In order to identify the point at which regenerative power is at its peak, we determined that MapleSim was the best tool to help us gather the desired data. We took biomechanical data from actual human trials and applied them to a robotic model that mimics human movements when transitioning between sitting and standing positions. We created models to measure unique movements and energy consumption at each joint throughout the identified movements to determine where the greatest regeneration occurred.

To successfully carry out our research, it was essential that we were able to model the complex chemical reactions that occur within the battery needed to power the assistive device. It is a challenge finding this feature in many engineering software programs and MapleSim’s battery modeling library saved our team a great deal of time and effort during the process, as we were able to use an existing MapleSim model and simply make adjustments to fit our project.

Using MapleSim, we developed a simplified model of the human leg with a foot firmly planted on the ground, followed by a more complex model with a realistic human foot that could be raised off the ground. The first model was used to create a simplified model-based motion controller that was then applied to the second model. The human trials we conducted produced the necessary data for input into a multi-domain MapleSim model that was used to accurately simulate the necessary motions to properly analyze battery autonomy.

The findings that resulted from our research have useful and substantial applications for prostheses and orthoses designs. If one is able to determine the most efficient battery autonomy, operation of these assistive devices can be prolonged, and smaller, lighter batteries can be used to power them. Ultimately, our simulations and the resulting data create the possibility of more efficient devices that can reduce joint loads during standing to sitting processes, and vice versa.

From October 19-21, the third installment of the Maple T.A. and Möbius User Summit took place. Making the move back to Europe this year, the three-day conference was held at the beautiful Vienna University of Technology in the heart of Vienna, Austria. The scope of this year’s event expanded to include Maplesoft’s newest product, Möbius, which is designed to help academic institutions move their STEM courses online.

This year’s Summit brought together participants from 20 countries, including Australia, the Czech Republic, Poland, China, Norway, India, Egypt, Japan, the Netherlands, and many others. Needless to say, there is great interest in learning more about how Maple T.A. and Möbius can play a role in shaping the educational landscape.

Video recordings of each presentation will be made public soon, so keep an eye out for them!

Conference attendees take in the sights on the veranda at TU Wien

Getting Down to Business

Presentations were divided into 5 overarching themes as they relate to Maple T.A. and Möbius: Shaping Curriculum; Content Creation; Experiences Using Möbius; Integrating with your Technology; and The Future of Online Education. Presentations were given by representatives from schools across Europe, including DTU (Denmark), TH Köln (Germany), Imperial College of London and University of Birmingham (UK), Vienna UT (Austria), KTH Royal Institute of Technology (Sweden), Université de Lausanne (Switzerland), and others.

Many talks showcased the impressive versatility of Maple T.A. and Möbius to have practical applications in all STEM subjects, from Nuclear Engineering to Operations Management and many subjects in between.

Perhaps the discussion that gave Maplesoft the most feedback was led by Steve Furino from the University of Waterloo, who divided attendees up into groups to formulate a wish list of what they’d like to see in a courseware authoring environment. The list had over 40 items.


Linda Simonsen, Country Manager in the Nordic, records a group’s wish list

Notable Quotables

Many thought-provoking statements and questions were posed, but the following few stood out above the rest:

  • “Wouldn’t it be wonderful if you could take the best course from the best instructor anywhere in the world?”
  • “With Maple T.A., we can divert resources away from grading and over to tutoring.”
  • “Möbius rescued us!”

Get the party started!

While each day was full of invigorating conference discussions, evenings provided ample opportunity to ditch the suit jacket and tie, and enjoy the lively Austrian atmosphere. The first evening at the Zwölf Apostelkeller was the perfect venue to break the ice while satisfying those taste buds longing for some traditional Viennese cuisine. Once Schnitzel, Käsespätzle (a delicious German version of Mac and Cheese), Strudel, Kaiserschmarren (shredded pancake), and a glass or two of wine hit the table, people soon forgot about the pouring rain outside.

The evening reception took place 3-4 levels under ground

Michael Pisapia, VP of Europe, serves digestifs to guests

It would have been hard to top the social in the Apostelkeller, but the next evening sure tried.

Day 2 finished with an impressive formal dining experience at the historic Gerstner Beletage in the Palace Todesco, built in 1864 and situated directly across from the Vienna State Opera House. The 500-room palace was home to Eduard Freiherr von Todesco, a well-known Viennese banker.

View from the palace of the Vienna State Opera House

Jonny Zivku, Maple T.A. Product Manager, gives opening remarks at the Gerstner Beletage im Palais Todesco

Jonathan Watkins from the University of Birmingham and Michael Pisapia - both dressed to impress

The skies finally cleared enough to take some photos, but only after most people had gone home. Thankfully Aron Pasieka, Möbius Project Manager, was still around to get some great shots of the city. Enjoy!


Before the skies cleared vs. after the skies cleared

From beginning to end, the entire Summit was very well received by everyone who attended.

We would be remiss if we did not thank our incredible hosts at the Vienna University of Technology. Stefanie Winkler, Professor Andreas Körner, and Professor Felix Breitenecker were beyond helpful in bringing many of the finer details together, as well as helping many people overcome the language barrier.

We can’t wait to do it all again in London, England in 2017, and hope to see just as many new faces as familiar ones.

 

Photo credits: A. Pasieka, A. French, H. Zunic, J. Cooper

This MaplePrimes guest blog post is from Ian VanderBurgh, the Director of the Center for Education in Mathematics and Computing (CEMC) and a Lecturer in the Faculty of Mathematics at the University of Waterloo. He has been overseeing a project to develop online, interactive mathematics curriculum for high school students, and has been integral in the development of Möbius, Maplesoft's online courseware environment.

Start with one part interest in online education, add one part increased functionality for developing online content, and mix with one part increased focus in the media and elsewhere on mathematics education.  What does this produce?  The perfect time to create high-quality online resources to support learning and teaching in mathematics.

The Centre for Education in Mathematics and Computing (CEMC) at the University of Waterloo aims to increase interest, enjoyment, confidence, and ability in mathematics and computer science among learners and educators in Canada and internationally.  For more than fifty years, we have been working with teachers to support the important work that they do in the classroom.  When online courses rose to prominence several years ago, we felt that this gave us the perfect opportunity to create materials to better support the curriculum being taught across Canada and around the world.

The content for what we now call “Phase One” was planned: Advanced Functions (Pre-Calculus) as well as Calculus & Vectors.  These materials would support the education of students in their final year of secondary school, and also provide materials to reinforce concepts for students in STEM programs at the post-secondary level.

After deciding on the content, we needed a platform.  We knew that we needed one with exceptional mathematical capabilities.  Thus, we have been working hand-in-hand with Maplesoft ever since.

With content and platform established, the style began to take shape.  It is based around what one of my colleagues calls “the five Es”: Exposition (onscreen text with synchronized audio), Experimentation (worksheets where users can manipulate mathematical objects), Evaluation (re-generating quiz questions), Exercises (with answers and solutions), and Enrichment (application and extension problems and solutions).  Have a look at the materials and watch a video about the courseware.  After less than two years of “public life”, Phase One has received more than 2 million page views and usage is accelerating.

But why stop there?  Through the development of Phase One, all of the stakeholders realized that, while what we created was great, we needed better and more efficient development tools.  Thus, Möbius was born.  (In the meantime, the CEMC separately launched Phase Two of this ambitious initiative: resources in computer science to support the teaching and learning of programming concepts.)

Now, using the full capabilities of Möbius, we are developing Phase Three, a parallel set of resources to Phase One that will support mathematics at the Grade 7/8 level.  Why Grade 7/8?  We believe that these are very important years in education, that it is vital to future success in STEM disciplines that students flourish in these years, and that we should do whatever we can to support this.

What comes next?  Time will tell.  But, the CEMC will be there supporting mathematics and STEM education.  STEM disciplines will drive almost everything in the twenty-first century, and we have an obligation to do whatever we can to give young people every possible chance for success.

As mentioned a few weeks back, we have been working on an update to MaplePrimes designed to dramatically curtail the amount of spam we have been receiving. I'm happy to say that we implemented these features earlier today, and in the hour or so since publication, they have already helped prevent multiple messages from being posted.

Using content posted to MaplePrimes over the past few months as a baseline, this new feature is successfully able to detect 90% of spam, while maintaining a false positive (i.e., incorrectly identifying a legitimate question or post) rate of 1%.

If a message is detected as spam, it is immediately quarantined and not publicly posted. Importantly, any user who posts a message seen as spam is immediately informed, and is provided with a simple mechanism to let us know so that their post can be reinstated (if it is in fact legimate.)

We will be closely monitoring these services to ensure that they are working as intended. In the meantime, I am very hopeful that they help improve the experience for our members, and require much less effort from our dedicated group of spam fighters.

Today we have published an update to MaplePrimes that includes a variety of improvements. Many of these changes are a direct result of member feedback and suggestions, and I am very appreciative for that!

What follows is a brief summary of the changes. As always, we remain very interested in your thoughts and feedback, and look forward to your further suggestions.

Also, a note that, as mentioned in a previous post, we have already begun working on a further update to address the influx of spam we have been receiving. This update will be published within the next 2-3 weeks.

Updated Look and feel
The most obvious change is the updated interface. With a few exceptions, the previous layout and functionality has been maintained, but with a cleaner, more responsive, and more appealing look.

New message editor
This update includes a new text editor called CKEditor. This editor provides a simpler, cleaner experience for posting your messages and also aligns MaplePrimes more closely with the Maplesoft product suite.

Notifications
You will notice a new flag icon in the upper right hand corner of the interface. This is the new MaplePrimes Notification feature, and it provides similar functionality to what we have become accustomed to on other social media sites. The icon is displayed in an orange color when you have notifications, and then when opened, your new notifications are highlighted in blue. Clicking on a notification will take you directly to the item being referenced.

Improved flow for removing spam messages
As any MaplePrimes moderator could tell you, removing spam on MaplePrimes was a cumbersome process taking 4 clicks. In this update, this process has been streamlined to 2 clicks, which will make the process considerably faster for our legion of spam fighters. In addition, the ability to remove spam is now available on all message types – comments, replies, etc.

Identification Badges
There are now 3 identification badges that are used throughout MaplePrimes wherever member information is displayed. These include:

 Denotes a member who works at Maplesoft

 Site moderators are the heart and soul of MaplePrimes, and are now identified by this new badge

 A member who also particpates in the Maple Ambassador Program

Other fixes and improvements
In addition to the changes mentioned above, several other minor fixes and improvements were made.

Students using Maple often have different needs than non-students. Students need more than just a final answer; they are looking to gain an understanding of the mathematical concepts behind the problems they are asked to solve and to learn how to solve problems. They need an environment that allows them to explore the concepts and break problems down into smaller steps.

The Student packages in Maple offer focused learning environments in which students can explore and reinforce fundamental concepts for courses in Precalculus, Calculus, Linear Algebra, Statistics, and more. For example, Maple includes step-by-step tutors that allow students to practice integration, differentiation, the finding of limits, and more. The Integration Tutor, shown below, lets a student evaluate an integral by selecting an applicable rule at each step. Maple will also offer hints or show the next step, if asked.  The tutor doesn't only demonstrate how to obtain the result, but is designed for practicing and learning.

For this blog post, I’d like to focus in on an area of great interest to students: showing step-by-step solutions for a variety of problems in Maple.

Several commands in the Student packages can show solution steps as either output or inline in an interactive pop-up window. The first few examples return the solution steps as output.

Precalculus problems:

The Student:-Basics sub-package provides a collection of commands to help students and teachers explore fundamental mathematical concepts that are core to many disciplines. It features two commands, both of which return step-by-step solutions as output.

The ExpandSteps command accepts a product of polynomials and displays the steps required to expand the expression:

with(Student:-Basics):
ExpandSteps( (a^2-1)/(a/3+1/3) );

The LinearSolveSteps command accepts an equation in one variable and displays the steps required to solve for that variable.

with(Student:-Basics):
LinearSolveSteps( (x+1)/y = 4*y^2 + 3*x, x );

This command also accepts some nonlinear equations that can be reduced down to linear equations.

Calculus problems:

The Student:-Calculus1 sub-package is designed to cover the basic material of a standard first course in single-variable calculus. Several commands in this package provide interactive tutors where you can step through computations and step-by-step solutions can be returned as standard worksheet output.

Tools like the integration, differentiation, and limit method tutors are interactive interfaces that allow for exploration. For example, similar to the integration-methods tutor above, the differentiation-methods tutor lets a student obtain a derivative by selecting the appropriate rule that applies at each step or by requesting a complete solution all at once. When done, pressing “Close” prints out to the Maple worksheet an annotated solution containing all of the steps.

For example, try entering the following into Maple:

with(Student:-Calculus1):
x*sin(x);

Next, right click on the Matrix and choose “Student Calculus1 -> Tutors -> Differentiation Methods…

The Student:-Calculus1 sub-package is not alone in offering this kind of step-by-step solution finding. Other commands in other Student packages are also capable of returning solutions.

Linear Algebra Problems:

The Student:-LinearAlgebra sub-package is designed to cover the basic material of a standard first course in linear algebra. This sub-package features similar tutors to those found in the Calculus1 sub-package. Commands such as the Gaussian EliminationGauss-Jordan Elimination, Matrix Inverse, Eigenvalues or Eigenvectors tutors show step-by-step solutions for linear algebra problems in interactive pop-up tutor windows. Of these tutors, a personal favourite has to be the Gauss-Jordan Elimination tutor, which were I still a student, would have saved me a lot of time and effort searching for simple arithmetic errors while row-reducing matrices.

For example, try entering the following into Maple:

with(Student:-LinearAlgebra):
M:=<<77,9,31>|<-50,-80,43>|<25,94,12>|<20,-61,-48>>;

Next, right click on the Matrix and choose “Student Linear Algebra -> Tutors -> Gauss-Jordan Elimination Tutor

This tutor makes it possible to step through row-reducing a matrix by using the controls on the right side of the pop-up window. If you are unsure where to go next, the “Next Step” button can be used to move forward one-step. Pressing “All Steps” returns all of the steps required to row reduce this matrix.

When this tutor is closed, it does not return results to the Maple worksheet, however it is still possible to use the Maple interface to step through performing elementary row operations and to capture the output in the Maple worksheet. By loading the Student:-LinearAlgebra package, you can simply use the right-click context menu to apply elementary row operations to a Matrix in order to step through the operations, capturing all of your steps along the way!

An interactive application for showing steps for some problems:

While working on this blog post, it struck me that we did not have any online interactive applications that could show solution steps, so using the commands that I’ve discussed above, I authored an application that can expand, solve linear problems, integrate, differentiate, or find limits. You can interact with this application here, but note that this application is a work in progress, so feel free to email me (maplepm (at) Maplesoft.com) any strange bugs that you may encounter with it.

More detail on each of these commands can be found in Maple’s help pages.

 

The Saturday edition of our local newspaper (Waterloo Region Record) carries, as part of The PUZZLE Corner column, a weekly puzzle "STICKELERS" by Terry Stickels. Back on December 13, 2014, the puzzle was:

What number comes next?

1   4   18   96   600   4320   ?

The solution given was the number 35280, obtained by setting k = 1 in the general term k⋅k!.

On September 5, 2015, the column contained the puzzle:

What number comes next?

2  3  3  5  10  13  39  43  172  177  ?

The proposed solution was the number 885, obtained as a10 from the recursion

where a0 =2.

As a youngster, one of my uncles delighted in teasing me with a similar question for the sequence 36, 9, 50, 55, 62, 71, 79, 18, 20. Ignoring the fact that there is a missing entry between 9 and 50, the next member of the sequence is "Bay Parkway," which is what 22nd Avenue is actually called in the Brooklyn neighborhood of my youth. These are subway stops on what was then called the West End line of the subway that went out to Stillwell Avenue in Coney Island.

Armed with the skepticism inspired by this provincial chestnut, I looked at both of these puzzles with the attitude that the "next number" could be anything I chose it to be. After all, a sequence is a mapping from the (nonnegative) integers to the reals, and unless the mapping is completely specified, the function values are not well defined.

Indeed, for the first puzzle, the polynomial f(x) interpolating the points


(0, 1), (1, 4), (2, 18), (3, 93), (4, 600), (5, 4320)

reproduces the first six members of the given sequence, and gives 18593 (not 35280) for f(7). In other words, the pattern k⋅k! is not a unique representation of the sequence, given just the first six members. The worksheet NextNumber derives the interpolating polynomial f and establishes that f(n) is an integer for every nonzero integer n.

Likewise, for the second puzzle, the polynomial g(x) interpolating the points

(1, 2) ,(2, 3) ,(3, 3) ,(4, 5) ,(5, 10) ,(6, 13) ,(7, 39) ,(8, 43), (9, 172) ,(10, 177)

reproduces the first ten members of the given sequence, and gives -7331(not 885) for g(11). Once again, the pattern proposed as the "solution" is not unique, given that the worksheet NextNumber contains both g(x) and a proof that for integer n, all values of g(n) are integers.

The upshot of these observations is that without some guarantee of uniqueness, questions like "what is the next number" are meaningless. It would be far better to pose such challenges with the words "Find a pattern for the given members of the following sequence" and warn that the function capturing that pattern might not be unique.

I leave it to the interested reader to prove or disprove the following conjecture: Interpolate the first n terms of either sequence. The interpolating polynomial p will reproduce these n terms, but for k>n, p(k) will differ from the corresponding member of the sequence determined by the stated patterns. (Results of limited numerical experiments are consistent with the truth of this conjecture.)

Attached: NextNumber.mw

Bruce Jenkins is President of Ora Research, an engineering research and advisory service. Maplesoft commissioned him to examine how systems-driven engineering practices are being integrated into the early stages of product development, the results of which are available in a free whitepaper entitled System-Level Physical Modeling and Simulation. In the coming weeks, Mr. Jenkins will discuss the results of his research in a series of blog posts.

This is the first entry in the series.

Discussions of how to bring simulation to bear starting in the early stages of product development have become commonplace today. Driving these discussions, I believe, is growing recognition that engineering design in general, and conceptual and preliminary engineering in particular, face unprecedented pressures to move beyond the intuition-based, guess-and-correct methods that have long dominated product development practices in discrete manufacturing. To continue meeting their enterprises’ strategic business imperatives, engineering organizations must move more deeply into applying all the capabilities for systematic, rational, rapid design development, exploration and optimization available from today’s simulation software technologies.

Unfortunately, discussions of how to simulate early still fixate all too often on 3D CAE methods such as finite element analysis and computational fluid dynamics. This reveals a widespread dearth of awareness and understanding—compounded by some fear, intimidation and avoidance—of system-level physical modeling and simulation software. This technology empowers engineers and engineering teams to begin studying, exploring and optimizing designs in the beginning stages of projects—when product geometry is seldom available for 3D CAE, but when informed engineering decision-making can have its strongest impact and leverage on product development outcomes. Then, properly applied, systems modeling tools can help engineering teams maintain visibility and control at the subsystems, systems and whole-product levels as the design evolves through development, integration, optimization and validation.

As part of my ongoing research and reporting intended to help remedy the low awareness and substantial under-utilization of system-level physical modeling software in too many manufacturing industries today, earlier this year I produced a white paper, “System-Level Physical Modeling and Simulation: Strategies for Accelerating the Move to Simulation-Led, Systems-Driven Engineering in Off-Highway Equipment and Mining Machinery.” The project that resulted in this white paper originated during a technology briefing I received in late 2015 from Maplesoft. The company had noticed my commentary in industry and trade publications expressing the views set out above, and approached me to explore what they saw as shared perspectives.

From these discussions, I proposed that Maplesoft commission me to further investigate these issues through primary research among expert practitioners and engineering management, with emphasis on the off-highway equipment and mining machinery industries. In this research, focused not on software-brand-specific factors but instead on industry-wide issues, I interviewed users of a broad range of systems modeling software products including Dassault Systèmes’ Dymola, Maplesoft’s MapleSim, The MathWorks’ Simulink, Siemens PLM’s LMS Imagine.Lab Amesim, and the Modelica tools and libraries from various providers. Interviewees were drawn from manufacturers of off-highway equipment and mining machinery as well as some makers of materials handling machinery.

At the outset, I worked with Maplesoft to define the project methodology. My firm, Ora Research, then executed the interviews, analyzed the findings and developed the white paper independently of input from Maplesoft. That said, I believe the findings of this project strongly support and validate Maplesoft’s vision and strategy for what it calls model-driven innovation. You can download the white paper here.

Bruce Jenkins, Ora Research
oraresearch.com

In a recent blog post, I found a single rotation that was equivalent to a sequence of Givens rotations, the underlying message being that teaching, learning, and doing mathematics is more effective and efficient when implemented with a tool like Maple. This post has the same message, but the medium is now the Householder reflection.

Given the vector x = , the Householder matrix H = I - 2 uuT reflects x to y = Hx, where I is the appropriate identity matrix, u = (x - y) / ||x - y|| is a unit normal for the plane (or hyperplane) across which x is reflected, and y necessarily has the same norm as x. The matrix H is orthogonal but its determinant is -1, making it a reflection instead of a rotation.

Starting with x and uH can be constructed and the reflection y calculated. Starting with x and yu and H can be determined. But what does any of this look like? Besides, when the Householder matrix is introduced as a tool for upper triangularizing a matrix, or for putting it into upper Hessenberg form, a recipe such as the one stated in Table 1 is the starting point.

In other words, the recipe in Table 1 reflects x to a vector y in which all entries below the kth are zero. Again, can any of this be visualized and rendered more concrete? (The chair who hired me into my first job averred that there are students who can learn from the general to the particular. Maybe some of my classmates in graduate school could, but in 40 years of teaching, I've never met one such student. Could that be because all things are known through the eyes of the beholder?)

In the attached worksheet, Householder matrices that reflect x = <5, -2, 1> to vectors y along the coordinate axes are constructed. These vectors and the reflecting planes are drawn, along with the appropriate normals u. In addition, the recipe in Table 1 is implemented, and the recipe itself examined. If you look at the worksheet, I believe you will agree that without Maple, the explorations shown would have been exceedingly difficult to carry out by hand.

Attached: RHR.mw

This post describes how Maple was used to investigate the Givens rotation matrix, and to answer a simple question about its behavior. The "Givens" part is the medium, but the message is that it really is better to teach, learn, and do mathematics with a tool like Maple.

The question: If Givens rotations are used to take the vector Y = <5, -2, 1> to Y2 = , about what axis and through what angle will a single rotation accomplish the same thing?

The Givens matrix G21 takes Y to the vector Y1 =, and the Givens matrix G31 takes Y1 to Y2. Graphing the vectors Y, Y1, and Y2 reveals that Y1 lies in the xz-plane and that Y2 is parallel to the x-axis. (These geometrical observations should have been obvious, but the typical usage of the Givens technique to "zero-out" elements in a vector or matrix obscured this, at least for me.)

The matrix G = G31 G21 rotates Y directly to Y2; is the axis of rotation the vector W = Y x Y2, and is the angle of rotation the angle  between Y and Y2? To test these hypotheses, I used the RotationMatrix command in the Student LinearAlgebra package to build the corresponding rotation matrix R. But R did not agree with G. I had either the axis or the angle (actually both) incorrect.

The individual Givens rotation matrices are orthogonal, so G, their product is also orthogonal. It will have 1 as its single real eigenvalue, and the corresponding eigenvector V is actually the direction of the axis of the rotation. The vector W is a multiple of <0, 1, 2> but V = <a, b, 1>, where . Clearly, W  V.

The rotation matrix that rotates about the axis V through the angle  isn't the matrix G either. The correct angle of rotation about V turns out to be

the angle between the projections of Y and Y2 onto the plane orthogonal to V. That came as a great surprise, one that required a significant adjustment of my intuition about spatial rotations. So again, the message is that teaching, learning, and doing mathematics is so much more effective and efficient when done with a tool like Maple.

A discussion of the Givens rotation, and a summary of the actual computations described above are available in the attached worksheet, What Gives with Givens.mw.

Run the following command in Maple:

Explore(plot(x^k), k = 1 .. 3);

 

Once you’ve run the command, move the slider from side to side. Neat, isn’t it?

With this single line of code, you have built an interactive application that shows the graph of x to the power of various exponent powers.

 

The Explore command is an application builder. More specifically, the Explore command can programmatically generate interactive content in Maple worksheets.

Programmatically generated content is inserted into a Maple worksheet by executing Maple commands. For example, when you run the Explore command on an expression, it inserts a collection of input and output controllers, called Embedded Components, into your Maple worksheet. In the preceding example, the Explore command inserts a table containing:

  • a Slider component, which corresponds to the value for the exponent k
  • a Plot component, which shows the graph of x raised to the power for k

Together these components form an interactive application that can be used to visualize the effect of changing parameter values.

Explore can be viewed as an easy application creator that generates simple applications with input and output components. Recently added packages for programmatic content generation broaden Maple’s application authoring abilities to form a full development framework for creating customized interactive content in a Maple worksheet. The DocumentTools package contains many of these new tools. Components and Layout are two sub-packages that generate XML using function calls that represents GUI elements, such as embedded components, tables, input, or output. For example, the DocumentTools:-Components:-Plot command creates a new Plot component. These key pieces of functionality provide all of the building blocks needed to create customizable interfaces inside of the Maple worksheet. For me, this new functionality has completely altered my approach to building Maple worksheets and made it much easier to create new applications that can explore hundreds of data sets, visualize mathematical functions, and more.

I would go so far as to say that the ability to programmatically generate content is one of the most important new sources of functionality over the past few years, and is something that has the potential to significantly alter the way in which we all use Maple. Programmatic content generation allows you to create applications with hundreds of interactive components in a very short period of time when compared to building them manually using embedded components. As an illustration of this, I will show you how I easily created a table with over 180 embedded components—and the logic to control them.

 

Building an interface for exploring data sets:

In my previous blog post on working with data sets in Maple, I demonstrated a simple customized interface for exploring country data sets. That post only hinted at the much bigger story of how the Maple programming language was used to author the application. What follows is the method that I used, and a couple of lessons that I learned along the way.

When I started building an application to explore the country data sets, I began with an approach that I had used to build several MathApps in the past. I started with a blank Maple worksheet and manually added embedded components for controlling input and output. This included checkbox components for each of the world’s countries, drop down boxes for available data sets, and a couple of control buttons for retrieving data to complete my application.

This manual, piece-by-piece method seemed like the most direct approach, but building my application by hand proved time-consuming, given that I needed to create 180 checkboxes to house all available countries with data. What I really needed was a quicker, more scriptable way to build my interface.

 

So jumping right into it, you can view the code that I wrote to create the country data application here:PECCode.txt

Note that you can download a copy of the associated Maple worksheet at the bottom of this page.

 

I won’t go into too much detail on how to write this code, but the first thing to note is the length of the code; in fewer than 70 lines, this code generates an interface with all of the required underlying code to drive interaction for 180+ checkboxes, 2 buttons and a plot. In fact, if you open up the application, you’ll see that every check box has several lines of code behind it. If you tried to do this by hand, the amount of effort would be multiplied several times over.

This is really the key benefit to the world of programmatic content generation. You can easily build and rebuild any kind of interactive application that you need using the Maple programming language. The possibilities are endless.

 

Some tips and tricks:

There are a few pitfalls to be aware of when you learn to create content with Maple code. One of the first lessons I learned was that it is always important to consider embedded component name collision and name resolution.

For those that have experimented with embedded components, you may have noticed that Maple’s GUI gives unique names to components that are copied (or added) in a Maple worksheet. For example, the first TextArea component that you add to a worksheet usually has the default name TextArea0. If you next add another TextArea, this new TextArea gets the name TextArea1, so as to not collide with the first component. Similar behaviour can be observed with any other component and even within some component properties such as ‘group’ name.

Many of the options for commands in the DocumentTools sub-packages can have “action code”, or code that is run when the component is interacted with. When building action code for a generated component, the action code is specified using a long string that encapsulates all of the code. Due to this code being provided as a long string, one trick that I quickly picked up is that it is important to separate out the names for any components into sub-strings inside of a longer cat statement.

For example, here is a line that is contained within a longer cat statement in the preceding code:

cat( "DocumentTools:-SetProperty( \"", "ComboBox_0", "\", 'value', \"Internet Users\" );\n" )

It is necessary to enclose “ComboBox_0” in quotes, as well as to add in escaped quotes in order to have the resulting action code look like (also note the added new line at the end):

“DocumentTools:-SetProperty( “ComboBox_0”, ‘value’, “Internet Users” );”

Doing so ensures that when the components are created, the names are not hard-coded to always just look for a given name. This means that the GUI can scrape through the code and update any newly generated components with a new name when needed. This is important if “ComboBox_0” already exists so that the GUI can instead create “ComboBox_1”.

 

Another challenge for coding applications is adding a component state. One of the most common problems encountered with running any interactive content in Maple is that if state is not persistent, errors can occur when, for example, a play button is clicked but the required procedures have not been run. This is a very challenging problem, which often require solutions like the use of auto-executing start-up code or more involved component programming. Some features in Maple 2016 have started working to address this, but state is still something that usually needs to be considered on an application by application basis.

In my example, I needed to save the state of a table containing country names so that the interface retains the information for check box state (checked or unchecked) after restart. That is, if I saved the application with two countries selected, I wanted to ensure that when I opened the file again those same two countries would still be selected, both in the interface as well as in the table that is used to generate the plot. Now accomplishing this was a more interesting task: my hack was to insert a DataTable component, which stored my table as an entry of a 1x1 Matrix rtable. Since the rtable that underlies a DataTable is loaded into memory on Maple load, this gave me a way to ensure that the checked country table was loaded on open.

Here, for example, is the initial creation of this table:

"if not eval( :-_SelectedCountries )::Matrix then\n",
"    :-_SelectedCountries := Matrix(1,1,[table([])]):\n",
"end if;\n",

For more details, just look for the term: “:-_SelectedCountries” in the preceding code.

I could easily devote separate posts to discussing in detail each of these two quick tips. Similarly, there’s much more that can be discussed with respect to authoring an interface using programmatic tools from the DocumentTools packages, but I found the best way to learn more about a command is to try it out yourself. Once you do, you’ll find that there are an endless number of combinations for the kinds of interfaces that can be quickly built using programmatic content generation. Several commands in Maple have already started down the path of inserting customized content for their output (see DataSets:-InsertSearchBox and AudioTools:-Preview as a couple of examples) and I can only see this trend growing.

Finally, I would like to say that getting started with programmatic content generation was intimidating at first, but with a little bit of experimentation, it was a rewarding experience that has changed the way in which I work in Maple. In many cases, I now view output as something that can be customized for any command. More often than not, I turn to commands like ‘Explore’ to create an interface to see how sweeping through parameters effects my results, and any time I want to perform a more complex analysis or visualization for my data, I write code to create interfaces that can more easily be customized and re-used for other applications.

If you are interested in learning more about this topic, some good examples to get started with are the examples page for programmatic content generation as well as the help pages for the DocumentTools:-Components and DocumentTools:-Layout sub-packages.

To download a copy of the worksheet used in this post, click here (note that the code can be found in the start-up code of this worksheet): CountryDataPEC.mw To create the datasets interface, simply run the CountrySelection(); command.

We've added a collection of thermal engineering applications to the Application Center. You could think of it as an e-book.

This collection has a few features that I think are pretty neat

  • The applications are collected together in a Workbook; a single file gives you access to 30 applications
  • You can navigate the contents using the Navigator or a hyperlinked table of contents
  • You can change working fluids and operating conditions, while still using accurate thermophysical data

If you don't have Maple 2016, you can view and navigate the applications (and interactive with a few) using the free Player.

The collection includes these applications.

  • Psychrometric Modeling
    • Swamp Cooler
    • Adiabatic Mixing of Air
    • Human Comfort Zone
    • Dew Point and Wet Bulb Temperature
    • Interactive Psychrometric Chart
  • Thermodynamic Cycles
    • Ideal Brayton Cycle
    • Optimize a Rankine Cycle
    • Efficiency of a Rankine Cycle
    • Turbine Analysis
    • Organic Rankine Cycle
    • Isothermal Compression of Methane
    • Adiabatic Compression of Methane
  • Refrigeration
    • COP of a Refrigeration Cycle
    • Flow Through an Expansion Valve
    • Food Refrigeration
    • Rate of Refrigerant Boiling
    • Refrigeration Cycle Analysis 1
    • Refrigeration Cycle Analysis 2
  • Miscellaneous
    • Measurement Error in a Manometer
    • Particle Falling Through Air
    • Saturation Temperature of Fluids
    • Water Fountain
    • Water in Piston
  • Heat Transfer
    • Dittus-Boelter Correlation
    • Double Pipe Heat Exchanger
    • Energy Needed to Vaporize Ethanol
    • Heat Transfer Coefficient Across a Flat Plate
  • Vapor-Liquid Equilibria
    • Water-Ethanol

I have a few ideas for more themed Maple application collections. Data analysis, anyone?

Maple T.A. MAA Placement Test Suite  2016 is now available. It leverages all the improvements found in Maple T.A. 2016, including:

  • A redesigned authoring workflow that makes it faster and easier to create and modify questions and assignments
  • A new content repository that makes it substantially easier to manage and search for content
  • New built-in connectivity options for integration with course management systems

To learn more, visit What’s New in Maple T.A. MAA Placement Test Suite 2016.

Jonny
Maplesoft Product Manager, Online Education Products

A few people have asked me how I created the sections in the Maple application in this video: https://youtu.be/voohdmfTRn0?t=572

Here's the worksheet (Maple 2016 only). As you can see, the “sections” look different what you would normally expect (I often like to experiment with small changes in presentation!)

These aren't, however, sections in the traditional Maple sense; they're a demonstration of Maple 2016's new tools for programmatically changing the properties of a table (including the visibility of its rows and columns). @dskoog gets the credit for showing me the technique.

Each "section" consists of a table with two rows.

  • The table has a name, specified in its properties.
  • The first row (colored blue) contains (1) a toggle button and (2) the title of each section (with the text in white)
  • The second row (colored white) is visible or invisible based upon the state of the toggle button, and contains the content of my section.

Each toggle button has

  • a name, specified in its properties
  • + and - images associated with its on and off states (with the image background color matching the color of the first table row)
  • Click action code that enables or disables the visibility of the second row

The Click action code for the toggle button in the "Pure Fluid Properties" section is, for example,

tableName:="PureFluidProperties_tb":
buttonName:="PureFluidProperties_tbt":
if DocumentTools:-GetProperty(buttonName, 'value') = "false" then   
     DocumentTools:-SetProperty([tableName, 'visible[2..]', true]);
else
     DocumentTools:-SetProperty([tableName, 'visible[2..]', false]);
end if;

As I said at the start, I often try to make worksheets look different to the out-of-the-box defaults. Programmatic table properties have simply given me one more option to play about with.

Disclaimer: This blog post has been contributed by Prof. Nicola Wilkin, Head of Teaching Innovation (Science), College of Engineering and Physical Sciences and Jonathan Watkins from the University of Birmingham Maple T.A. user group*. 

Written for Maple T.A. 2016. For Maple T.A. 10 users, this question can be written using the queston designer.

 

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