RecipePythonIntermediate Derive a Jacobian with SymPy and pass it to solve_ivp with lambdify J = sp.simplify(rhs.jacobian(y))
ToolPythonBeginner SymPy from the ground up: where the pendulum's 1.74 % comes from theta_dot_phi = sp.simplify(theta_dot_expr.subs({sp.cos(theta): cos_theta, sp.cos(theta0): cos_theta0}))integrand = sp.simplify(dtheta_dphi / theta_dot_phi)