From: Andrzej B. <andrzej.brozi@p.lodz.pl> - 2011-03-23 14:22:57
|
Hallo I have a strange problem with draw2d(explicit(... . It took some time but I boiled down the problem to the following: When I issue command similar to the following one: wxdraw2d( explicit(321.4567,x,0,1) ); (it doesn't matter if it's "draw2d" or "wxdraw2d") it may produce plot (straight line in this case) or practically hang Maxima (I mean Maxima uses one processor core fully and when left on its own for half an hour it doesn't produce plot). This behavior depends on the value: for 321.4, 321.456, 321.45678 it works fine - producing plot under a second, for 321.45, 321.4567, 321.456789 it 'hangs' Maxima. Something similar may be found for other numbers - originally I stumbled on it trying to plot a variable being the right-hand side of an equation which happened to be a constant (equal to 399.3). Same situation on two computers, one with Windows XP Pro SP3 and the other one with Windows 7 Professional. I've tested it on Maxima 5.23.2 and 5.22.1 - same behavior. I asked someone to try it on a Linux computer (Maxima 5.22.1 with wxMaxima 0.8.7) - again same problem. I've repeated this using XMaxima (on Windows 7 Professional) - again same problem. "wxplot2d" works fine on all cases. It seems to me that it is a (surprising) bug, and it probably concerns the "draw" package. Best regards Andrzej Brozi |
From: Raymond T. <toy...@gm...> - 2011-03-23 22:46:13
|
On 3/23/11 10:22 AM, Andrzej Brozi wrote: > Hallo > > I have a strange problem with draw2d(explicit(... . > > It took some time but I boiled down the problem to the > following: > > When I issue command similar to the following one: > > wxdraw2d( > explicit(321.4567,x,0,1) > ); > > (it doesn't matter if it's "draw2d" or "wxdraw2d") > > it may produce plot (straight line in this case) or practically hang > Maxima (I mean Maxima uses one processor core fully and when left on > its own for half an hour it doesn't produce plot). > > This behavior depends on the value: > > for 321.4, 321.456, 321.45678 it works fine - producing plot under a > second, > > for 321.45, 321.4567, 321.456789 it 'hangs' Maxima. Interesting! These all appear to be caused by the adaptive plotter. It's getting stuck because it thinks the curve is not smooth enough, which, I think, is caused by some roundoff. This can be fixed by changing the threshold to be a bit bigger. Not sure why we need the adaptive plotter if we're plotting explicit points. Maybe we should also change the adaptive-plot depth to 1 instead of the default of 5 or so? Ray |
From: Mario R. <bio...@te...> - 2011-03-24 19:36:52
|
> These all appear to be caused by the adaptive plotter. It's getting > stuck because it thinks the curve is not smooth enough, which, I think, > is caused by some roundoff. This can be fixed by changing the threshold > to be a bit bigger. > > Not sure why we need the adaptive plotter if we're plotting explicit > points. Maybe we should also change the adaptive-plot depth to 1 > instead of the default of 5 or so? Hello, This change can be applied with option 'adapt_depth': draw2d(adapt_depth = 1, explicit(321.4567,x,0,1)); In the following simulation, variable 'tempos' stores execution times for 'adapt_depth' equal to 1 thru 7: tempos: [0.528033, 1.012063, 2.128133, 4.592288, 10.476654, 26.369647, 76.280767] $ draw2d(points_joined=true, points(tempos)) $ -- Mario |