mpmath

sympy installed, however sympy.mpmath not found

倾然丶 夕夏残阳落幕 提交于 2021-01-27 06:02:16
问题 I want to use the jacobDN function in sympy, so I download it and python setup.py install it, successfully. When I want to use it as in the documentation does: >>> from sympy.mpmath import * Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named mpmath >>> Import everything from sympy is successful: >>> from sympy import * >>> Then I installed mpmath individually, then I can use the ellipfun from mpmath. However an annoying mpf is shown: >>> from

sympy installed, however sympy.mpmath not found

喜夏-厌秋 提交于 2021-01-27 06:00:40
问题 I want to use the jacobDN function in sympy, so I download it and python setup.py install it, successfully. When I want to use it as in the documentation does: >>> from sympy.mpmath import * Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named mpmath >>> Import everything from sympy is successful: >>> from sympy import * >>> Then I installed mpmath individually, then I can use the ellipfun from mpmath. However an annoying mpf is shown: >>> from

Relation between mpmath and scipy: Type Error

烈酒焚心 提交于 2020-03-05 02:34:14
问题 Scipy have a lot of special functions, in particular Bessel functions jn (always denoted by uppercase letter J_n(x)) and spherical Bessel functions spherical_jn (denoted by lowercase letter j_n(x)). On the other hand mpmath have quadosc , a special method for integrate rapidly oscillating functions, like jn and spherical_jn . The problem I had obtained is that seems that quadosc from mpmath not support, e.g, jn from scipy as an input to make this integral . I means, if I use quad imported

Is there a scaled complementary error function in python available?

戏子无情 提交于 2019-12-30 17:57:36
问题 In matlab there is a special function which is not available in any of the collections for the Python I know (numpy, scipy, mpmath, ...). Probably there are other places where functions like this one may be found? UPD For all who think that the question is trivial, please try to compute this function for argument ~30 first. UPD2 Arbitrary precision is a nice workaround, but if possible I would prefer to avoid it. I need a "standard" machine precision (no more no less) and maximum speed

Laplace inverse in Python with mpmath

久未见 提交于 2019-12-24 01:17:55
问题 I want to use "DE HOOG" algorithm for numerical Laplace inverse transform. I want to use the "mpmath" package and I installed it from the link: https://github.com/klkuhlm/mpmath Lets say I need to find the inverse Laplace transform of the below function at t=1: f = 1/(s-1) The inverse Laplace transform of f is : e^(t) At t=1 the result is expected to be = e import mpmath as mp import numpy as np def f(s): return 1 / (s-1) t = np.linspace(0.01,0.5,10) G = [] for i in range(0,4): G.append(mp

alternatives or speedups for mpmath matrix inversion

帅比萌擦擦* 提交于 2019-12-22 13:31:39
问题 I'm writing some code in python that requires frequently inverting large square matrices (100-200 rows/colums). I'm hitting the limits of machine precision so have started trying to use mpmath to do arbitrary precision matrix inversion but it is very slow, even using gmpy . Inverting random matrices of size 20, 30, 60 at precision 30 (decimal) takes ~ 0.19, 0.60, and 4.61 seconds whereas the same operations in mathematica take 0.0084, 0.015, and 0.055 seconds. This is using python3 and mpmath

alternatives or speedups for mpmath matrix inversion

末鹿安然 提交于 2019-12-22 13:31:14
问题 I'm writing some code in python that requires frequently inverting large square matrices (100-200 rows/colums). I'm hitting the limits of machine precision so have started trying to use mpmath to do arbitrary precision matrix inversion but it is very slow, even using gmpy . Inverting random matrices of size 20, 30, 60 at precision 30 (decimal) takes ~ 0.19, 0.60, and 4.61 seconds whereas the same operations in mathematica take 0.0084, 0.015, and 0.055 seconds. This is using python3 and mpmath