Subject: plotting problem with trigonometric functions
From: Stavros Macrakis
Date: Thu, 15 Mar 2012 13:07:25 -0400
I agree with Ray -- it would be a bad idea to have Maxima arbitrarily limit
the precision of numbers passed to the plotting program. From time to
time, it really is useful to plot down to the last bit to understand the
details of the behavior of a numerical algorithm. For example, I remember
plotting the old PDP-10 cos routine and finding that it was not smooth
around 0 -- it jittered a bit in the last bit or two, which caused problems
in some calculations.
-s
On Thu, Mar 15, 2012 at 12:02, Raymond Toy <toy.raymond at gmail.com> wrote:
>
>
> On Wed, Mar 14, 2012 at 12:46 PM, Jaime Villate <villate at fe.up.pt> wrote:
>
>> On 03/14/2012 04:50 PM, Raymond Toy wrote:
>>
>>> Hmm. I see a similar thing, but it's not maxima. Maxima returns almost
>>> instantly, but gnuplot is sucking up 100% cpu plotting a (mostly) constant.
>>> Not sure why that is because plot2d(1,[x,-1,1]) brings up a plot instantly.
>>>
>>> So it's not a maxima problem per se.
>>>
>> Right.
>> plot2d(sec(x)*cos(x),[x,-1,1],**[plot_format,xmaxima]) works fine.
>>
>> But even being a Gnuplot issue, this suggests that we could use something
>> such as fpprintprec: 14
>> when creating the data file for Gnuplot. In any case no graphic display
>> will be able to use more than 14 digits for a plot (I think!).
>>
>
> That's true, but consider this particular example. sec(x)*cos(x) isn't
> always exactly 1 because of numerical issues in computing sec and cos.
> Sometimes it's nice to be able to see that in a plot. If you make maxima
> only print 14 digits, this difference goes a way. (Yes, it might be better
> to plot sec(x)*cos(x)-1, but that adds yet another round-off.)
>
>
>>
>> Is anyone against that I go ahead and do such change in plot2d?
>>
>
> So, I guess I'm (slightly) opposed to this change. It's definitely not a
> maxima problem, and we should let the gnuplot folks know about it. Or
> recommend a version of gnuplot that doesn't seem to have this problem (if
> possible).
>
> Ray
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>