pchin

Dr. Paulina Chin

1441 Reputation

13 Badges

20 years, 305 days
Maplesoft
Senior Architect
Waterloo, Ontario, Canada

MaplePrimes Activity


These are replies submitted by pchin

I can confirm that the plot command is not reentrant. You can't pass a procedure to the plot command that itself calls the plot command.

Paulina

I can confirm that the plot command is not reentrant. You can't pass a procedure to the plot command that itself calls the plot command.

Paulina

@Christopher2222 The earliest release containing this fix would probably be the next full release, though there is a possiiblity it may be put into a dot release.

Paulina

@Christopher2222 The earliest release containing this fix would probably be the next full release, though there is a possiiblity it may be put into a dot release.

Paulina

@stefanv Thanks for the historical info, Stefan, and confirming that the plot code has its silver anniversary next year. I remember talking to some of the students working on Maple back in the mid-80s at U of Waterloo. A very enthusiastic bunch they were.

Paulina

@Oliver K Very fitting for a Maple anniversary! Thanks.

Paulina

I'm not a big Rush fan (Leonard Cohen is more my style), but my husband took my 15-year-old daughter to the Rush concert in Toronto this past Saturday. Now we have two generations of fans in my house.

Here's another Rush anecdote. Last fall, my husband and I attended a show at the Toronto International Film Festival. Before the movie started, we engaged in small talk with a friendly guy sitting next to us. He told us he saw Penelope Cruz at a film premiere the day before. Just then, the guy spots a friend walking by who shouts to him, “Guess who I just saw? Geddy Lee!” My husband and the guy both said almost simultaneously, “Wow, that’s WAY better than seeing Penelope Cruz!”

Paulina

Thanks for posting the workaround, acer. Yes, there seems to be a bug in NLPSolve in this particular situation (operator form, with failure of codegen automatic differentiation routines). Providing your own gradient routine is a good workaround.

Paulina

@Robert Israel: Nice! I'm impressed.

What Robert says is correct. The plots:-display command accepts plot structures that have already been created. It does not cause the plots to be regenerated with new sample points.

The other thing to keep in mind is that Maple uses a default range of -10..10 when there is no other information given. To get a plot that is sufficiently smooth, it's a good idea to give Maple as much information as you can. If you know that the region of interest is -1..2, then it's best to specify that in the initial plot calls.

By the way, in Maple 14, you can create the plots in these examples with one command. See this post.

Paulina

Robert, I don't think your example is a bug:

> NLPSolve(int(exp(sin(c*x)), x=0..1));

In this situation, the optimization variables are not specified, so NLPSolve thinks they are 'x' and 'c'. It tries to evaluate the expression at x=1.0, thus generating an error when int is called. The solution is to add the variables option:

> NLPSolve(int(exp(sin(c*x)), x=0..1), variables=[c]);

Paulina

Robert, I don't think your example is a bug:

> NLPSolve(int(exp(sin(c*x)), x=0..1));

In this situation, the optimization variables are not specified, so NLPSolve thinks they are 'x' and 'c'. It tries to evaluate the expression at x=1.0, thus generating an error when int is called. The solution is to add the variables option:

> NLPSolve(int(exp(sin(c*x)), x=0..1), variables=[c]);

Paulina

Thanks for the suggestion, acer. Indeed, I was rather hasty with my reply. I meant to explain that the backslash character has a different meaning in 2-d math, but we will look at the situation to see if can be improved in any way. I haven't had the chance to test this out thoroughly, but in some cases (e.g. when output in Maple with the line continuation character is copied and pasted back into an input line), the input is parsed as expected. The backslash, entered directly, has a different meaning in 2-d math from 1-d math, and that is unlikely to change, but you are right that some of the copy-paste situations might be fixable.

Paulina

A correction to my previous post: 

# valid in 1D but not in 2D
x := 12.34567\
89012345;

This is not a bug. In 2-d math, the backslash is not used as a line continuation character but it is used as the set minus operator. This is one of the situations where there is an intended difference between the two parsers. I'll add a note to the documentation if it's not already mentioned in the help pages.

Paulina
 

We'll definitely consider your comments, acer, and we'll review the current design for parsing m!=n to see if it's reasonable. Can't promise anything, though. Changing the interpretation will have some consequences, so we'll have to think it over carefully.

Paulina

1 2 3 4 5 6 7 Page 3 of 8