On Jan 9, 2010, at 7:51 PM, Marshall Hampton wrote:
I could be wrong but that problem might relate to the fact that
plotting is often done in floats, which can't handle quantities like
15^1024. Other types in Sage can handle such things, so you might
have to work around that limitation by plotting the log of the
function or something similar.
Alternatively, if you have a function f(x) where the floating point
range isn't sufficient, you can do
ff = lambda x: f(RR(x))
which will force mpfr real numbers to be used inside of f.
- Robert
On Jan 9, 4:11 pm, zieglerk <konstantin.zieg...@gmail.com> wrote:
Thanks, indeed this solved the problem in the example.
Unfortunately, there is still a problem, if the degree of both
polynomials U and V increases to, say d = 1024. Note that the degree
of the rational function P = U/V is still 0 and both poles (0 and 1)
are far enough outside of the range where I want to plot.
d = 1024
R = PolynomialRing(ZZ, x)
U = x^d + R.random_element(d-1)
V = x^d - x^(d-1)
U = expand(U)
V = expand(V)
P = U/V
G = P.plot(2, 15)
G.show()
returns
verbose 0 (2999: plot.py, generate_plot_points) WARNING: When
plotting, failed to evaluate function at 5 points.
verbose 0 (2999: plot.py, generate_plot_points) Last error message:
''
as error message. And even the option plot_points=5 does not change
that, although computing several values for P on the interval goes
smoothely.
Perhaps the problem is, that plot stores the values of P as fractions
with quite large numerator and denominator, although it would suffice
to store a numerical approximation -- which is someplace around 1?
Any ideas?
Konstantin
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org
--
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org