mpmath

TypeError: cannot create mpf from x

TypeError: cannot create mpf from x Question: I’ve checked multiple other answers for this error, but can’t figure out why this is occuring. from sympy.solvers import nsolve from sympy import Symbol, log x = Symbol(‘x’) u = nsolve(log(x/0.06) / (x-0.06) – 8,x) print(u) Traceback (most recent call last): File "C:UserscyjacPycharmProjectspharmacomescrap.py", line 5, in <module> u …

Total answers: 1

Laplace transform using numerical integration in Python has very poor precision

Laplace transform using numerical integration in Python has very poor precision Question: I have written a function to compute the Laplace transform of a function using scipy.integrate.quad. It is not a very sophisticated function and currently performs poorly on the probability density function of an Erlang distribution. I have included all my work below. I …

Total answers: 1

How to properly cast mpmath matrix to numpy ndarray ( and mpmath.mpf to float)

How to properly cast mpmath matrix to numpy ndarray ( and mpmath.mpf to float) Question: I’m working with mpmath python library to gain precision during some computations, but i need to cast the result in a numpy native type. More precisely i need to cast an mpmath matrix (that contains mpf object types) in an …

Total answers: 2