Python Solve Equation Numerically