aoanla
December 26th, 2008, 06:44 PM
Hello everyone.
Wanting to do some coding involving non-trivial mathematical functions, I installed the Python mpmath package from the repositories.
However, there's something confusing about how it works:
Trying
from mpmath import *
mp.dps = 15
print besselj(2, 1000)
should return
-0.024777229528606
instead, it returns a complaint about "name 'besselj' is not defined", which suggests that mpmath isn't properly importing all the elements in the namespace (mp.dps works...)
This example is actually in the current documentation:
http://mpmath.googlecode.com/svn/trunk/doc/build/functions/hypergeometric.html#bessel-functions-besselj-bessely
and I rather assume that it should work for non-svn builds.
Is it just that the version of mpmath in the repos is old enough (0.8 vs the current 0.10) that the available documentation doesn't apply to it? If so, does anyone know what I'm supposed to do to access the relevant parts of the package?
(In a related note, the package that installs matplotlib is also a bit broken - it doesn't appear to contain a valid matplotlibrc, and therefore doesn't do much useful until you provide one yourself...)
Wanting to do some coding involving non-trivial mathematical functions, I installed the Python mpmath package from the repositories.
However, there's something confusing about how it works:
Trying
from mpmath import *
mp.dps = 15
print besselj(2, 1000)
should return
-0.024777229528606
instead, it returns a complaint about "name 'besselj' is not defined", which suggests that mpmath isn't properly importing all the elements in the namespace (mp.dps works...)
This example is actually in the current documentation:
http://mpmath.googlecode.com/svn/trunk/doc/build/functions/hypergeometric.html#bessel-functions-besselj-bessely
and I rather assume that it should work for non-svn builds.
Is it just that the version of mpmath in the repos is old enough (0.8 vs the current 0.10) that the available documentation doesn't apply to it? If so, does anyone know what I'm supposed to do to access the relevant parts of the package?
(In a related note, the package that installs matplotlib is also a bit broken - it doesn't appear to contain a valid matplotlibrc, and therefore doesn't do much useful until you provide one yourself...)