pchin

Dr. Paulina Chin

1096 Reputation

10 Badges

15 years, 179 days
Maplesoft
Software Architect
Waterloo, Ontario, Canada

MaplePrimes Activity


These are Posts that have been published by pchin

In a recent post, a Maple user misunderstood what an assignment to f(x) meant. Since this is a common source of confusion, I thought it would be worthwhile to say more about this subject.

What is f(x)?
First, f(x) is a "function application" in Maple. It is f applied to the argument x. It is not really the same as what one thinks of as a function in mathematics. Consider a mathematical function such as sin(x+y). In Maple, this can be represented by an expression sin(x+y) or a procedure proc(x, y) sin(x+y) end proc (which can also be written in "operator form" as (x, y)->sin(x+y)). The expression or the procedure can then be assigned to a name such as g. The mathematical function is then represented by g in Maple, and not by g(x, y). Instead, if g is a procedure, then g(x, y) means "the procedure g called with arguments x and y". The "function" help page explains these concepts in more detail.

What is f(x):=x^2 in 1-d math?
Now let's move on to what f(x) := x^2 means. In 1-d math, this means, "Create a remember table entry for procedure f." This stores the expression x^2 so that when you enter f(x), that expression is automatically retrieved, and you avoid the expense of executing the body of the procedure . Similarly, if you enter f(1) := 5, then the value 5 is automatically returned when you enter f(1). Note that if you subsequently enter f(y), you won't get y^2 returned, unless f was already defined to return y^2 with input y. Remember tables are very useful and are heavily used by some Maple library procedures. However, the majority of Maple users do not need to worry about this feature and can do very useful things in Maple without ever knowing about it.

It's been a while since I've updated my blog, but the recent Maple 12 release gives me a good opportunity to talk about some of the features I'd been working on for the past months. A few people on MaplePrimes had asked for more details about Maple 12, so I'll start by saying a bit about the new polar axes. A lot of this work was done by my colleagues in the GUI Group and they may have additional interesting things to say about the feature.

In previous versions of Maple, you could draw polar plots using the plots[polarplot] command or with the coords=polar option, but these were always displayed with Cartesian axes. In Maple 12, polar axes are displayed by default, as seen here.

plots[polarplot](1+cos(theta), theta=0..2*Pi, axis[radial]=[tickmarks=5])

plots[polarplot](1+cos(theta), theta=0..2*Pi, axis[radial]=[tickmarks=5])

 A number of new options were added to the polarplot command so that you can customize the axes.  The most useful ones are the axis[radial] and axis[angular] options. These work like the axis[1], axis[2] and axis[3] options available for general plots, and you can use them to control color, tickmarks and other properties of the radial and angular axes.

Typeset math on plots had been introduced in Maple 11, and now we can take advantage of this with nice axis labels, in multiples of Pi, on the angular axis. These labels appear by default, but of course, they can be customized with the axis options. The plot/typesetting help page provides information on how to add typeset math to plots through the command line. There are also interactive ways to do this, using the context menu.

You can add polar axes to plots created by commands other than plots[polarplot], by using the axiscoordinates=polar option. However, not all the options offered by plots[polarplot] are available generally. Here is an example using plots[implicitplot].

plots[implicitplot]([x^2+2*y^2 = 1, x^2+1.5*y^2 = 1], color = ["Blue", "Green"], x = -1 .. 1, y = -1 .. 1, axiscoordinates = polar);

plots[implicitplot]([x^2+2*y^2 = 1, x^2+1.5*y^2 = 1], color = ["Blue", "Green"], x = -1 .. 1, y = -1 .. 1, axiscoordinates = polar)

It is also possible to get the pre-Maple 12 Cartesian axes back with polar plots, by adding the axiscoordinates=cartesian option.

Some of you might have wondered what we Maplesoft employees do in our spare time. Well, in a couple of weeks, we will be starting our 7th annual in-house Scrabble tournament. Scrabble (trademark of Hasbro, Inc.) is the popular board game in which words are formed from letter tiles. The tournament attracts participants from all parts of our company, though it is particularly popular among the R&D members. The tournament goes over a month, with each participant playing a total of 5 games. The top players then continue on to play-off rounds. Most people play over the lunch hour in our common area, and the games frequently attract spectators. This is not an official National Scrabble Association (NSA) tournament, but we follow most of the NSA rules, using clocks and dictionaries for challenges.
I had the pleasure of visiting Oxford while on vacation in England. I regret that I did not get a chance to visit the NAG headquarters there, but that thought gave me the idea for this next blog entry. The Optimization package for local optimization uses as its underlying engine the NAG E04 optimization suite. It is possible to use the Optimization package without knowing the internal workings of the commands. However, for those of you who are interested in such details, it is possible to get more information. If you set infolevel[Optimization] to 2 or higher, the names of the NAG routines (e.g. E04UCA) are displayed. It is useful to set the infolevel value in any case, as the messages provide valuable information about how the computation is proceeding.
On Monday, Aug. 13, I will be at a big optimization conference at McMaster University in Hamilton, Ontario. It's the joint International Conference on Continuous Optimization (ICCOPT) and Modeling and Optimization: Theory and Applications (MOPTA) conference. I'll be running a session with three Maple-related talks given by Jan Bakus of Maplesoft, Andrew Curtis of the University of Western Ontario, and myself. If any of you are attending the conference (and I
1 2 3 4 5 Page 3 of 5