ConceptPythonBeginner Computer algebra: formulas as trees, exact until you ask for digits ratio = 2 * sp.elliptic_k(sp.sin(theta0 / 2) ** 2) / sp.pi # T/T0, kept as an expressionprint(f"simplify(sin(x)**2 + cos(x)**2) = {sp.simplify(sp.sin(x)**2 + sp.cos(x)**2)}")
ToolPythonBeginner SymPy from the ground up: where the pendulum's 1.74 % comes from print(sp.series(sp.sin(theta), theta, 0, 4))theta_of_phi = 2 * sp.asin(k * sp.sin(phi))ratio = sp.expand(4 * phi_integral / T0).subs(k, sp.sin(theta0 / 2))