Hello!
I have a problem in Maple 11 when I try to plot some functions in log log scales. It seems that maple doesn't calculate enough points for low x values because it draws curves with elbows even if they are differentiable. And the curves have very weird comportement for a sum of exponential... I tried to do it mannually (takin the log of the function and replace x by 10^x) but it's no better. It would certainly be clearer if you could see what I am talking about: is there a way I could attach my workwheet (or a screen shot) to the message?
Thanks
log log plot
Use the green up arrow to upload your file (preferably a worksheet) and insert a link to it.
The behaviour you described used to be a problem, but I think it has improved considerably in recent releases. You might be running into numerical problems, but I can't be sure without a look at the actual code.
link to file
I thank you for trying to help me!
here are the links to my file that I just uploaded:
View 9432_radioactivity.mw on MapleNet or Download 9432_radioactivity.mw
View file details
hope you'll be able to help me with that!
Thanks
Raphael
log log plot
It all looks fine to me (except that you really should define, e.g., r1 rather than r1(t)). I think the Maple plots are correct.
What do you think is wrong with them?
log log plot
Well, they're not: this link shows the good plots: http://www.mapleprimes.com/files/9432_Image%201.jpg
But I figured out what the problem was and it is stupid... I forgot the * sign between the (lambda2-lambda1) in the denominator of r3... I don't know what mapple thought it was...
Still, I was wondering if it is possible to make these curves smoother in particular for low t values?
Thanks for your help though!
Sampling
I had a look at the plots and while the straight sections of the graphs look odd, they do actually represent the functions as calculated. You can check this by using the menus to change the plot style to "Point". That will draw a symbol everywhere Maple has calculated a value for the graph. The points are dense enough that the graph is accurate (unless your function fluctuates very quickly). I'm unable to comment on the correctness of the functions.
David Clayworth Maplesoft GUI Developer
number of points
Hi,
Thanks for your help but I am still wondering if there is a way to increase the number of points maple calculates in the range between 1 and 10^5 because as you can see on the corrected file (link below), only two are evaluated and I think it really impacts the graph smoothness: (ther shouldn't be such an elbow...)
View 9432_radioactivitycorrected.mw on MapleNet or Download 9432_radioactivitycorrected.mw
View file details
Thanks
Maple 12 vs 11
Ah, the problem is that it is Maple 11. In Maple 12 there are many points plotted in this range. Here is the plot in "point" style
and in "line" style
maple 12
OK... that seems much better indeed! Unfortunately I won't throw away my version and buy maple 12 just for that!
Thanks
Use the sample option
As Robert had observed, there was indeed a change to the log plotting commands in Maple 12 that resulted in better sampling. I would still encourage you to upgrade to Maple 12 as there are a number of other plotting improvements (e.g. polar axes, dual-axis plots) that you may find useful. However, there is a workaround in Maple 11. You can use the 'sample' option with the plot command to specify a list of points at which you want the function sampled. If you want only those points sampled and no additional ones, then also add the adaptive=false option. These options are described on the plot/options help page.
Paulina Chin
Maplesoft
Classic
Strangely enough, the Classic and Standard interfaces use different versions of loglogplot, and in this respect the Classic version is better in Maple 11. If you prefer Standard, you still have access to the Classic version: try
> `plots/loglogplot`({r1, r2, r3}, 1 .. 10^8, style=point);Unfortunately, the Standard interface messes up the y axis labels on this plot (which is probably why it was given a different version of loglogplot).
Log plots in Classic and Standard
I'll try to explain the differences between Standard and Classic without getting overly technical. Users just interested in using the log plotting commands without knowing about the underlying structures can ignore this.
In Maple 11, we introduced the new 'axis' option to allow better control of the axes, but this is available only for the Standard interface. The 'axis' option has a 'mode' option that allows one to specify a log axis. The log axis is created by the GUI renderer based on the data sent to it from the math library routines.
We'd updated the log plotting commands to use the new way of creating a log axis. The problem with the sampling was simply an oversight that occurred when the code was being updated, and we corrected this in Maple 12.
Unfortunately, because Classic interface does not support the new 'axis' option, it still uses the older log plotting code. The results (apart from the sampling in Maple 11) are not ideal. The older log plotting code created the axis and its associated labels in the math library routines, which meant that the result had to be independent of the plotting device. This meant that a plot might have nice looking tickmarks and labels with one device but look awful with another. The heuristics used to create the labels were not particularly strong and improving them was difficult.. The current solution leads to much improved plots.
As Robert suggests, you can indeed use `plots/loglogplot` to get the older-style log plot in Standard with Maple 11. However, `plots/loglogplot` is an internal routine. We don't prevent users from calling internal routines but we do try to discourage it. We try very hard to maintain backward compatibility for all documented routines, but we can't guarantee that we'll never change the behaviour or calling sequence of an undocumented internal routine.
Paulina Chin
Maplesoft