numerical-computing

Numeric calculation of nullspace with Sympy is slow

Numeric calculation of nullspace with Sympy is slow Question: I want to obtain the bases for kernel (nullspace) of a matrix using the Row Reduced Echelon Form (RREF). Although scipy has the function to calculate nullspace, it does not give me sparse vectors because it uses singular value decomposition (SVD). #make an example import random …

Total answers: 1

Rounding errors in python

Rounding errors in python Question: why the order of multiplications can impact the results? Consider the following code a=47.215419672114173 b=-0.45000000000000007 c=-0.91006620964286644 result1=a*b*c temp=b*c result2=a*temp result1==result2 We all know that result1 should be equal to result2, however we get: result1==result2 #FALSE! the difference is minimal result1-result2 #3.552713678800501e-15 However, for particular applications this error can amplify so …

Total answers: 9