t = var('t')
plot(bessel_J(1, t), (t, 1, 10))
and I get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/dan/.sage/sage_notebook/worksheets/admin/1/code/27.py",
line 8, in <module>
plot(bessel_J(Integer(1), t), (t, Integer(1), Integer(10)))
File "/Applications/sage/local/lib/python2.5/site-packages/SQLAlchemy-0.4.6-py2.5.egg/",
line 1, in <module>
File "/Applications/sage/local/lib/python2.5/site-packages/sage/functions/special.py",
line 527, in bessel_J
b = K(nu.besselj(z))
File "real_mpfr.pyx", line 352, in
sage.rings.real_mpfr.RealField.__call__ (sage/rings/real_mpfr.c:4046)
File "real_mpfr.pyx", line 819, in
sage.rings.real_mpfr.RealNumber._set (sage/rings/real_mpfr.c:6834)
TypeError: Unable to convert x
(='1-1/8*t^2+1/192*t^4-1/9216*t^6+1/737280*t^8-1/88473600*t^10+1/14863564800*t^12-1/3329438515200*t^14+1/958878292377600*t^16+O(t^17)')
to real number.
This is with Sage 3.1.1 on OS X. I have no trouble evaluating
bessel_J, so why can't it plot the function?
Dan
--
--- Dan Drake <dr...@mathsci.kaist.ac.kr>
----- KAIST Department of Mathematical Sciences
------- http://math.kaist.ac.kr/~drake
sage: list_plot([(t,bessel_J(1,1+9*t/100)) for t in range(100)],
plotjoined=True)
plot(lambda t:bessel_J(1, t), (1, 10))
so (1) a one-variable function is reequired, and the lambda
construction creates such a function from the2-variable bessel_J, and
(2) the range is a tuple (xmin,xmax) .
John Cremona
2008/9/11 Dan Drake <dr...@mathsci.kaist.ac.kr>:
John
2008/9/11 Jason Merrill <jwme...@gmail.com>:
That's very helpful, thanks!