the Python documentation says using np.linalg.solve is faster than inverting matrices using np.linalg.inv