|
From: Michel T. <ta...@lp...> - 2020-03-23 13:21:10
|
Le 23/03/2020 à 05:59, Gunter Königsmann a écrit : > On 22.03.20 21:41, Richard Fateman wrote: >> This is probably not going to solve this particular problem, >> but the general problem of making sure that plots don't lie >> because of numerical errors can be addressed by interval >> arithmetic, at least sometimes. google search for "honest plotting". >> Not that Maxima has any seriously implemented interval arithmetic. >> RJF >> > Interval arithmetic is easy to implement for anything which is both > continuous and monotonous - and can be extended to such functions with > more than input (for example multiplications). For machine-float > periodic functions like sin(x) and tan(x) we could perhaps get info > about the periodicity for large x. > > The question is if this is enough for this case or if we would need an > interval arithmetics for find_root - which is impossible for more than > trivial problems. I have looked at other examples and draw2d(implicit(...)) always fails to plot correctly the branches near a singular point of f(x,y)=0. I have taken a look at the way it is programmed, basically the square is subdivided into a grid of finally spaced points, then f is computed at each point, if for some point |f| becomes < 1e-06 it is considered that f=0 and this point is drawn on the plot. This obviously works well in general. However, close to the singular point (0,0), f is given by powers >=2 of x and y, so is much smaller than the typical value of f in the square. Hence the epsilon=1e-06 which is appropriate for the typical case is no more relevant. It should be renormalized by the typical value of f near the singular point. Second, the derivatives of f at (0,0) vanish by definition, so f doesn't vary much between nearby points in the grid. So the selection of which point is considered a zero of f becomes fuzzy. Third there are several curves which converge to (0,0), also by definition, hence they are spaced thinner and thinner as one approaches the singular point. Sufficiently close they are thinner than the grid, so the computation cannot work. Only an adaptive grid could overcome this problem. As a consequence it seems to me that only a far more complicated program could plot correctly this situation. I don't see in what way so-called "interval arithmetic" could be of any help. -- Michel Talon |