Applications, Examples and Libraries

Share your work here

The third edition of Getting Started with Maple was released by John Wiley & Sons in March 2009.

The author team for this edition is:

  • Douglas B. Meade (Univ of S. Carolina)
  • Mike May, S.J. (St. Louis Univ)
  • C-K. Cheung (Boston Univ)
  • G.E. Keogh (Boston Univ)

The 13-digit ISBN is 978-0-470-45554-8.

Great playwrights and poets are drummers – they craft the written word so that the rhythm and the cadence of their dialogue when spoken are a drumbeat, and combine with the meaning of the language to create emotion.  Shakespeare, for example, used syllables as his drumbeats (as did many other playwrights and poets).  Analyzing linguistic structure isn’t a common application for a math tool (and for a very good reason), but can Maple tell us more about Shakespeare’s favourite drumbeat?

We need to find some way of programmatically counting the number of syllables in a word. In an irregular language like English, this is a hit-and-miss affair.  Maple’s SyllableLength command, for example, tallies the number of vowel-consonant changes in a word to calculate the number of syllables (but increases the count by one if the word ends in a “y”.)  While this is a good start, for many words it’s merely an approximation. Conscious and serious, for example, have the same number of vowel-constant changes, but a different number of syllables when spoken.

I chose to modify the basic premise of SyllableLength with several empirical adjustments that give a more accurate tally of the number of syllables in a word.  This simply involves increasing or decreasing the calculated number of vowel-consonant changes if a word contains a particular letter structure.  For example, terrible has two vowel-consonant changes, but we increase this count by one (to calculate the number of syllables) because it ends in ble.

Although we can implement a number of these workarounds, this (admittedly very clumsy) approach is never going to account for the full irregularity of the English language, and we have to accept the results in that light.  The attached worksheet contains the chosen approach, and I’d appreciate feedback on more accurate ways of programmatically counting the number of syllables in a word.

So, let’s start by examining the monologue in Act 3 Scene 1 of Henry V.  Here’s the number of syllables per line as computed by the attached worksheet.

“Once more unto the breach, dear friends, once more;”
10 syllables

“Or close the wall up with our English dead”
10 syllables

“In peace there’s nothing so becomes a man”
10 syllables

“As modest stillness and humility”
10 syllables

“But when the blast of war blows in our ears,”
10 syllables

“Then imitate the action of the tiger”
11 syllables

So it looks like Shakespeare used ten beats, or syllables, per line, but placed an extra syllable in the final quoted line.  In fact, he often wrote monologues in a style called iambic pentameter, in which each line consists of five syllable-pairs (the first syllable in each pair being unstressed and the second stressed)

In much the same way that the darkening of a cinema is a visual cue that implies that a movie is about to begin, Shakespeare used iambic pentameter as an audio cue to signify emotionally resonant or particularly important dialogue, occasionally varying the number of syllables (or the number of polysyllabic words) per line to create a sense of discord, or a quickening or slowing of pace.

You might want to check out the following video – it’s Kenneth Brannagh’s version of the full speech in his 1989 film adaptation of Henry V.

Here’s another example from Romeo and Juliet (Act 3 Scene 5), together with the syllable counts given by Maple.

“Wilt thou be gone? It is not yet near day”
10 syllables

“It was the nightingale, and not the lark”
10 syllables

“That pierced the fearful hollow of thine ear”
11 syllables

“Nightly she sings on yond pomegranate tree”
11 syllables

“Believe me, love, it was the nightingale”
10 syllables

Again, Shakespeare shifts between 10 and 11 syllables per line to indicate emotionally resonant and poetic dialogue.

Shakespeare did not write entirely in verse with a defined metric structure.  He also wrote in free prose with no defined syllable structure, sometimes to indicate that the speaker was vulgar or mentally unbalanced, or in short question-answer dialogue.

Given the limitations of a purely programmatic approach, we’re never going to fully deconstruct the beauty of Shakespeare’s language.  Maple can, however, offer a small insight into how he controlled the rhythm and pace of his dialogue.

Download the attachment: Shakespeare.mw

The MapleSim Connectivity Toolbox is now available. With this toolbox, you can export MapleSim models to Simulink, including rotational, translational, and multibody mechanical systems, thermal models, and electric circuits. It creates Simulink S-Function blocks for fast execution within Simulink and real-time implementation through Real-Time Workshop.

For more information, see

I'm one of several technical writers at Maplesoft.  It's our job to craft the text in our brochures and user stories, and on our web site.  We all have differing styles, but we share a common goal; we want to write in a manner that’s technically compelling but simple to understand.

After recently exploring Maple’s string manipulation tools, I was surprised to find a command that measures the readability of a sample of English text.  It seems that as well as making you a better mathematician, Maple will poke and prod you into being a better writer.

StringTools[Readability] returns a measure of readability called the SMOG index (but, when asked, will also give the Flesch Reading Ease, Flesch-Kincaid Grade Level Formula, Automated Readability and the Coleman-Law indices).

These measures do not gauge the quality of the writing, its grammatical correctness, or account for specialized discipline-specific vocabulary. They simply use guidelines determined from in-the-field studies (largely conducted in the US) to quantify the degree of education or effort it takes to understand a sample of text.  Additionally, the calibration of the results against the required reading effort is only meaningful for readers whose native language is English, and whose schooling resembles that of the US system.

The SMOG index wins an award for the most amusing acronym of the month: Simple Measure of Gobbledegook. It's calculated with the following empirical formula.

 It returns the years of education (that is, the US grade level) required to completely understand a sample of text.  Typically, Newsweek has a SMOG index of 10 to 11, the New York Times 13 to 15, and the Harvard Law Review 17 to 18.

I was recently asked to describe MapleSim in less than 70 words; this was the result:

MapleSim is a tool for multi-domain physical modeling and control systems development.  Physical components and signal-flow blocks can be connected to create models that map onto the real system. It features an integrated environment in which the system equations can be automatically generated and analyzed, and new physical components created. It contains tools for optimized code generation, controls analysis and design documentation.

This has a SMOG index of 15.5, which implies the reader needs a university education for complete comprehension.  Since that’s the target audience, I guess I’m in the right ballpark.

As I write this post, I know I’m guilty of making many readability errors.  Are my fellow Maplesoft bloggers as guilty?

To answer this question, I used Maple to calculate the SMOG index for all the blog posts on Maplesoft.com (but first stripping out code snippets or URLs that would distort the score).  The top 10 and the bottom 10 scores are given below.

 

The Ten Most Readable Blog Posts

 

Rank

Title

Author

SMOG Index

1

Who Needs Math?

Fred Kern

10.2

2

China on my Mind

Fred Kern

10.8

3

Maple Goes Social (Networking)

Tom Lee

10.9

4

Top 10 things to evangelize about …

Tom Lee

11.0

5=

“Every time I walk into math class a little part of me dies”

Tom Lee

 

11.1

 

5=

India on my Mind

Fred Kern

11.1

7=

The Physics of Santa Claus

Stephanie Rozek

12.1

7=

Stringing Me Along

Samir Khan

12.1

9

A Better Tomorrow in Engineering Software

Samir Khan

12.2

10

Good Vibrations

Samir Khan

12.6

 

The Ten Least Readable Blog Posts

 

Rank

Title

Author

SMOG Index

30=

An Animated Discussion about Pendulums

Samir Khan

15.4

30=

Algebraic Surface Blending

Tom Lee

15.4

32

An Optimal Day

Tom Lee

15.5

33

Repaying Old Debts

Tom Lee

15.6

34

Taking the Lead

Tom Lee

15.8

36

Postcards from the road: Part 1 -- On rocket science

Tom Lee

 

16.0

35

Postcard from the road: Found in translation Part II

Tom Lee

16.3

37

Postcard from the road: Found in translation Part I

Tom Lee

16.5

38

Physical Modeling - Killer Application No. 2 for Symbolics

Laurent Bernardin

 

16.7

 

39

Let's Get Physical

Samir Khan

18.1

Well...it appears that I’ve written some of the most readable posts and the single least readable post.  The two least readable blog posts are those that explore abstract, high-level ideas (and hence demand more sophisticated writing), while the most readable blog posts are essentially opinion pieces.

Other than that, the only conclusion we can make is that good writers tend to write to the level of comprehension of the intended audience and the material; they don’t unnecessarily dumb down the sophistication of their writing to the lowest common denominator, or write to a level that’s beyond the scope of the material.

I’ve attached a Maple worksheet that helps you explore the readability of text using all of the measures in StringTools[Readability].  You may want to use it to write a more readable blog post than this one.

This is a follow-up to an earlier post about CovarianceMatrix.

There are several ways in which Statistics:-CorrelationMatrix can be improved.

CorrelationMatrix shares some inefficiencies with CovarianceMatrix, by computing correlations between the n columns, pairwise. But in doing so it also computes...

Some years ago, before the advent of the Statistics package, a colleague asked for a fast way to generate thousands of normally distributed random numbers in Maple. The suggestion that worked quickest and most easily (using existing, simple Maple Library routines) was to generate random deviates using the usual formula associated with the distribution. But the key was to replace the scalar values (representing the uniformly distributed input) with a whole Matrix of input values....

It is some time ago, that I was fighting with that model and how
to estimate the 3 parameters (until recognizing that one may want
restrictions for them).
Essentially one uses the statistics of the underlying data to get
a reasonable starting guess. 
For an estimation then one can use the Optimization package.
The gradients involved are best coded as a floating point library,
which here is done through a DLL (it should work on all Windows OS),
code in C is included for that.
Meanwhile all can be done using 'Compiler:-compile' or the Watcom
compiler delivered with Maple.
I left that older sheet as it is - in Maple 9 (may be one should
brush it up for concurrent Maple versions, they are grumbling a bit
about the code) and hope it is of interest despite of that.

Maple sheet: www.mapleprimes.com/files/102_Garch.mws
DLL + code:  www.mapleprimes.com/files/102_Garch.dll.zip
as a pdf:    www.mapleprimes.com/files/102_Garch.mws.pdf

 

Well, we've officially joined the web 2.0 revolution :) ... Maplesoft now has a page on Facebook.Come check it out and become a fan!

The Facebook page is intended to be a place for our “fans” to gather, share ideas and talk about their Maple experiences. The page will continue to be updated with interesting photos, videos (including a great one of some of our staff trying to work off the Christmas weight gain!...

A colleague of mine recently mentioned something to me about an article that circulates every year during the holiday season, entitled “The Physics of Santa Claus”. This was news to me, so I ran a few Google searches to find out what she was talking about.

 

It seemed that some enterprising person had taken the time to go through and explain just what is involved in Santa’s Christmas Eve trip around the world delivering presents. How many households does he have to visit? How much do all those presents really weigh? How fast do the reindeer need to fly in order to get it all done in a finite amount of time? There is much speculation as to the origins of this piece; the general consensus seems to be that it began life published in SPY magazine in the early 1990s. Whatever the true story, it’s still an entertaining read in 2008.

I’ve taken some time to update the original with more current data – for instance, it seems the world’s population has grown a bit in the last 20 years. According to the Population Reference Bureau, the world population in 2008 was approximately 6,705 billion; 28% of these are children (defined as being under 15):

In fact, making some assumptions about the percentage of these children that celebrate Christmas and the number of children per household, it turns out that Santa needs to visit close to 200 million homes in one night.

We assume he distributes gifts from 5 pm to midnight, or for 7 hours. Due to the Earth's rotation, there is an overall time difference of 24 hours between different time zones, so we can therefore say that Santa has 31 hours to finish his work (assuming he logically travels east to west). Visiting 200 million homes in 31 hours means that Santa has to visit approximately 1586 homes per second:

This gives him about 1/1600th of a second to do everything at each home, such as parking his sleigh, looking for the right gifts, climbing down the sleigh and chimney, binge on snacks, fill the stockings, come up again and rush to his next stop!

For the complete details of his annual trip, visit the Applications Center where I’ve posted the Maple document in which I’ve recreated the Santa calculations. Happy Holidays!!

We are happy to announce Maplesoft's latest solution for modeling and simulation is now available!  For those of you who are not familiar with the product, it is a high-performance multi-domain modeling and simulation tool which will revolutionize how you bring products to market.

To learn more about MapleSim follow this link.

Recently, I was reading about random.org again.  It is an online random number generating service that uses atmospheric noise gathered from radios tuned between stations as a source of randomness.  It has been running more or less continuously for about ten years.   On their analysis page there is a nice pair of bitmaps (scroll down past the Dilbert comic) that contrast their random bits with those from one version of the PHP rand() function. Basically this demonstrates how easy it is to create a pseudo-random number generator that is periodic with too small of a period.

I decided to take a look at Maple's random number generator in comparison.

 

The attached work sheet teaches you the fundamental concepts behind the antiderivative.

The examples in this worksheet are entirely done in an interactive video tutorial - follow the link below:

 (Ctrl+Click on the link to view the video)

Antiderivatives - Video Tutorial

 

Enjoy!

 

The attached worksheet is a wonderful introduction to the concept of obtaining the area under a curve.

You'll see how easy it is to learn how to find the limit of the sum of a series using Maple.

An interactive video tutorial that shows you how to do Riemann sums really fast is linked below:

(Ctrl+Click on the link to view the video)

Riemann Sums...

In this previous post, an example is shown that demonstrates the potential problems that can arise following symbolic conversions such as from sqrt(x^2)  to x^(1/2).

Here x is an unknown symbol. The difficulties include the fact that, while `sqrt` can be smart about simplifying numeric values (eg. integers, rationals) the `^` operator has no such opportunity. Once the conversion from `sqrt`...

The attached Maple worksheet gives an outline of the basics of Concavity, Points of Inflection and the Second Derivative Test, commonly encountered problems, and how to use Maple to solve them.

First 65 66 67 68 69 70 71 Page 67 of 71