> +    N = ReferenceFrame('N')
> +    A = N.orientnew('A', 'Axis', [q, N.z])
> +    A.set_ang_vel(N, qd * N.z)
> +
> +    # Next, we create the point O and fix it in the inertial frame. We then
> +    # locate the point P to which the bob is attached. Its corresponding
> +    # velocity is then determined by the 'two point formula'.
> +    O = Point('O')
> +    O.set_vel(N, 0)
> +    P = O.locatenew('P', l * A.x)
> +    P.v2pt_theory(O, N, A)
> +
> +    # The 'Particle' which represents the bob is then created.
> +    Pa = Particle('Pa', P, m)
> +
> +    T = 1/2.0 * m * P.vel(N) & P.vel(N) # T is the kinetic energy of the 
> system

Whenever you use the & and ^ for the dot and cross products it is probably good 
practice to always enclose the operation in parentheses because these two 
operators have special order of operation rules that don't necessarily act like 
you think they do. In this case it is fine, but I think all example code that a 
user may possibly look at to figure out how to write their own problems should 
have this explicit. New users may spend forever trying to figure out the bug if 
they type something like

```
A & B ^ C ^ D
```

and expect the order of operations to match they way they think  about it on 
paper.

Look back on the sympy mailing list, the online docs, or old pull requests to 
see how these operators work (or you may already know).

---
Reply to this email directly or view it on GitHub:
https://github.com/sympy/sympy/pull/1460/files#r1339703

-- 
You received this message because you are subscribed to the Google Groups 
"sympy-patches" group.
To post to this group, send email to sympy-patches@googlegroups.com.
To unsubscribe from this group, send email to 
sympy-patches+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to