Error when running updated nl_homogeneous.txt
As said in the closed issue https://gitlab.tudelft.nl/sync-lab/sentient/-/issues/25 , I had to change some parameters in nl_homogeneous.txt. In particular, I put order_approx=4 and precision_deltas=1e-6 (as I had to the original file I sent to @ivanstraalen , back in June), to get better accuracy in approximating the manifolds.
Back then, it ran smoothly, with no errors. But now, I get the following error:
Computing symbolic expression for the approximation of isochronous manifolds (this might take some time)...
Traceback (most recent call last):
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/core/cache.py", line 72, in wrapper
retval = cfunc(*args, **kwargs)
TypeError: unhashable type: 'MutableDenseMatrix'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/core/cache.py", line 72, in wrapper
retval = cfunc(*args, **kwargs)
TypeError: unhashable type: 'MutableDenseMatrix'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/gdelimpaltadak/Desktop/Material/Code/Python/Sentient/etc2traffic.py", line 72, in <module>
traffic = construct_nonlinearETC_traffic_from_file(input_file)
File "/Users/gdelimpaltadak/Desktop/Material/Code/Python/Sentient/sentient/util/construct_from_file_nonlinearETC.py", line 259, in construct_nonlinearETC_traffic_from_file
traffic.create_abstraction()
File "/Users/gdelimpaltadak/Desktop/Material/Code/Python/Sentient/sentient/Abstractions/NonlinearETC/TrafficModelNonlinearETC.py", line 241, in create_abstraction
r = self.regions
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/functools.py", line 967, in __get__
val = self.func(instance)
File "/Users/gdelimpaltadak/Desktop/Material/Code/Python/Sentient/sentient/Abstractions/NonlinearETC/TrafficModelNonlinearETC.py", line 251, in regions
self._build_regions()
File "/Users/gdelimpaltadak/Desktop/Material/Code/Python/Sentient/sentient/Abstractions/NonlinearETC/TrafficModelNonlinearETC.py", line 317, in _build_regions
ret = self.create_regions_manifold(self.Manifolds_Times, self.nr_cones_small_angles,
File "/Users/gdelimpaltadak/Desktop/Material/Code/Python/Sentient/sentient/Abstractions/NonlinearETC/TrafficModelNonlinearETC.py", line 874, in create_regions_manifold
self.mu = self.compute_mu()
File "/Users/gdelimpaltadak/Desktop/Material/Code/Python/Sentient/sentient/Abstractions/NonlinearETC/TrafficModelNonlinearETC.py", line 1081, in compute_mu
exponential = sympy.exp(
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/core/cache.py", line 74, in wrapper
retval = func(*args, **kwargs)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/core/function.py", line 473, in __new__
result = super().__new__(cls, *args, **options)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/core/cache.py", line 74, in wrapper
retval = func(*args, **kwargs)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/core/function.py", line 285, in __new__
evaluated = cls.eval(*args)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/functions/elementary/exponential.py", line 273, in eval
return arg.exp()
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/matrices/matrices.py", line 1630, in exp
ret = P.multiply(eJ, dotprodsimp=None).multiply(P.inv(), dotprodsimp=None)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/matrices/matrices.py", line 2199, in inv
return _inv(self, method=method, iszerofunc=iszerofunc,
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/matrices/inverse.py", line 459, in _inv
rv = M.inverse_GE(iszerofunc=iszerofunc)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/matrices/matrices.py", line 2184, in inverse_GE
return _inv_GE(self, iszerofunc=iszerofunc)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/matrices/inverse.py", line 242, in _inv_GE
red = big.rref(iszerofunc=iszerofunc, simplify=True)[0]
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/matrices/matrices.py", line 170, in rref
return _rref(self, iszerofunc=iszerofunc, simplify=simplify,
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/matrices/reductions.py", line 305, in _rref
mat, pivot_cols, _ = _row_reduce(M, iszerofunc, simpfunc,
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/matrices/reductions.py", line 127, in _row_reduce
mat, pivot_cols, swaps = _row_reduce_list(list(M), M.rows, M.cols, M.one,
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/matrices/reductions.py", line 118, in _row_reduce_list
mat[p] = isimp(mat[p] / pivot_val)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/simplify/simplify.py", line 2161, in dotprodsimp
expr3 = cancel(expr2)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/polytools.py", line 6737, in cancel
c, (P, Q) = 1, F.cancel(G)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/rings.py", line 2220, in cancel
_, p, q = f.cofactors(g)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/rings.py", line 2136, in cofactors
h, cff, cfg = f._gcd(g)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/rings.py", line 2171, in _gcd
return ring.dmp_inner_gcd(f, g)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/compatibility.py", line 656, in dmp_inner_gcd
H, F, G = dmp_inner_gcd(self.to_dense(f), self.to_dense(g), self.ngens-1, self.domain)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/euclidtools.py", line 1584, in dmp_inner_gcd
h, cff, cfg = _dmp_inner_gcd(f, g, u, K)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/euclidtools.py", line 1549, in _dmp_inner_gcd
return dmp_ff_prs_gcd(f, g, u, K)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/euclidtools.py", line 1111, in dmp_ff_prs_gcd
fc, F = dmp_primitive(f, u, K)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/euclidtools.py", line 1818, in dmp_primitive
cont, v = dmp_content(f, u, K), u - 1
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/euclidtools.py", line 1793, in dmp_content
cont = dmp_gcd(cont, c, v, K)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/euclidtools.py", line 1625, in dmp_gcd
return dmp_inner_gcd(f, g, u, K)[0]
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/euclidtools.py", line 1584, in dmp_inner_gcd
h, cff, cfg = _dmp_inner_gcd(f, g, u, K)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/euclidtools.py", line 1549, in _dmp_inner_gcd
return dmp_ff_prs_gcd(f, g, u, K)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/euclidtools.py", line 1106, in dmp_ff_prs_gcd
result = _dmp_ff_trivial_gcd(f, g, u, K)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/euclidtools.py", line 932, in _dmp_ff_trivial_gcd
return _dmp_simplify_gcd(f, g, u, K)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/euclidtools.py", line 957, in _dmp_simplify_gcd
h = dmp_gcd(F, G, v, K)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/euclidtools.py", line 1625, in dmp_gcd
return dmp_inner_gcd(f, g, u, K)[0]
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/euclidtools.py", line 1584, in dmp_inner_gcd
h, cff, cfg = _dmp_inner_gcd(f, g, u, K)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/euclidtools.py", line 1549, in _dmp_inner_gcd
return dmp_ff_prs_gcd(f, g, u, K)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/euclidtools.py", line 1111, in dmp_ff_prs_gcd
fc, F = dmp_primitive(f, u, K)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/euclidtools.py", line 1823, in dmp_primitive
return cont, [ dmp_quo(c, cont, v, K) for c in f ]
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/euclidtools.py", line 1823, in <listcomp>
return cont, [ dmp_quo(c, cont, v, K) for c in f ]
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/densearith.py", line 1671, in dmp_quo
return dmp_div(f, g, u, K)[0]
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/densearith.py", line 1627, in dmp_div
return dmp_ff_div(f, g, u, K)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/densearith.py", line 1477, in dmp_ff_div
return dup_ff_div(f, g, K)
File "/Users/gdelimpaltadak/opt/anaconda3/envs/Sentient/lib/python3.8/site-packages/sympy/polys/densearith.py", line 1457, in dup_ff_div
raise PolynomialDivisionFailed(f, g, K)
sympy.polys.polyerrors.PolynomialDivisionFailed: couldn't reduce degree in a polynomial division algorithm when dividing [EX(-1970.66012598651 + 3413.28346265873*I)] by [EX(1.00000000000000)]. This can happen when it's not possible to detect zero in the coefficient domain. The domain of computation is EX. You may want to use a different simplification algorithm. Note that in general it's not possible to guarantee to detect zero in this domain.
This seems to be a problem with sympy.exp; it wasnt a problem in June, which might imply that a previous version of sympy could handle the given expression.