Thanks to another reader, I found out that Dan's bug only shows up in a certain situation (defining the range of a continuous variable in terms of a multiple-valued constant). The program manifesting this problem is shown here: http://www.mrob.com/users/dasimov/20101114-grapher-2.png After some investigation (see http://www.mrob.com/users/dasimov/20101114-grapher-2b.pngand http://www.mrob.com/users/dasimov/20101114-grapher-2c.png) I determined that the discrete-valued variables (which control the plotting of multiple curves in a family) are evaluated in advance, and the array index thereto is post-incremented BEFORE the evaluation of each curve, which includes setting the end range(s) for the continuous variable (which controls the range over which each curve is plotted). Thus, in Dan's original bug the curve for u=0.5 is plotted with t over the range 0..1/(2*0.6) because the u value has already been post-incremented to 0.6 when it is used to define the end range of the continuous variable t. In the other two examples the discretes are set up in a different order to illustrate the principle. An unappealing work-around is shown here: http://www.mrob.com/users/dasimov/20101114-grapher-3.png and I won't discuss it further, it is clearly not acceptable. A "real" solution is to use static ranges for all variables and use the conditional evaluation clause to control when the curve is plotted. That is shown here: http://www.mrob.com/users/dasimov/20101114-grapher-4.png The conditional evaluation clause is the element that has a single curly brace on the left, with multiple expressions and a condition for each. We only need one condition, t<1/2u. Typed out, the equation for the parametrized curve looks kind of like this : [x y] = { [(1-u) o] + u[(cos pi t) (sin pi t)] , when t<1/2u except that the things in [] are two-element vectors, and ",when" is not typed or displayed. This method is far more flexible, because it allows plotting multiple discontinuous ranges, as shown here: http://www.mrob.com/users/dasimov/20101114-grapher-5.png Therefore, I believe it is probably how the designers of the software intended for this particular type of curve to be plotted. - Robert Munafo On Sat, Nov 13, 2010 at 15:16, Dan Asimov <dasimov@earthlink.net> wrote:
Does any other math-funnik use the Mac Grapher utility?
It can do so many things to create a 2D or 3D image . . . BUT it is buggy as hell. At least the version that came with my Mac -- among the very last with a Motorola chip -- plus all Apple updates to my software.
It was, I think, created in a story that is now legendary among programmers: < http://www.pacifict.com/Story/ >.
But I sure wish they would debug the *&^%$@ thing.
Case in point: Just now I wanted to draw a family of plane curves with a simple parametric equation depending on one additional parameter . . . for six values of that parameter. Grapher supposedly has a syntax for doing this: just stick the additional parameter in curly brackets, and either explicitly write all parameter values, or the first two and the last one.
In my case, according to the examples and the (very sparse) Help file, that should appear as either
{0.5, 0.6, 0.7, 0.8, 0.9, 1.0}
or
{0.5, 0.6...1.0},
respectively. But neither one works.
Boiled down: Using either {1.0} or {0.5} my tiny Grapher program draws the correct curve. But using {0.5, 1.0} instead, it draws two curves that are both wrong!
Has anyone figured how to get around stupid bugs like this?
--Dan
Those who sleep faster get more rest.
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
-- Robert Munafo -- mrob.com Follow me at: mrob27.wordpress.com - twitter.com/mrob_27 - youtube.com/user/mrob143 - rilybot.blogspot.com