ConceptPythonBeginner
sympy.cos
Python. Called in 2 tutorials; each line below leads to its place in the tutorial.
ToolPythonBeginner
SymPy from the ground up: where the pendulum's 1.74 % comes from
- E = sp.Rational(1, 2) * L**2 * theta_dot**2 + g * L * (1 - sp.cos(theta))
- cos_theta = sp.expand_trig(sp.cos(theta_of_phi))
- cos_theta0 = sp.expand_trig(sp.cos(2 * sp.asin(k)))
- theta_dot_phi = sp.simplify(theta_dot_expr.subs({sp.cos(theta): cos_theta, sp.cos(theta0): cos_theta0}))
- theta_dot_phi = theta_dot_phi.subs(sp.Abs(sp.cos(phi)), sp.cos(phi))