Hi,
I now know why I was confused about SymPy supporting functions that
depend upon x,y,z,t. It's because the sympy.physics.mechanics doesn't
support it (since it requires this dynamicsymbol class). It assumes
that things are functions of time only.
Looking through the code for sympy.physics.mechanics, I've noticed
that it's very slanted towards the Kane and Levinson approach, even in
all the supporting functions and classes and as a result, it forces
one into something that they might not be comfortable with.
One example I'm thinking of is the approach of how it handles inertia.
If I have an inertia matrix in a defined frame, how am I supposed to
include it? If I know Ixx, Iyy, Izz and the cross-products of inertia
how do I use them? The example in the rigidbody.py file is,
>>> from sympy import Symbol
>>> from sympy.physics.mechanics import ReferenceFrame, Point, RigidBody
>>> from sympy.physics.mechanics import outer
>>> m = Symbol('m')
>>> A = ReferenceFrame('A')
>>> P = Point('P')
>>> I = outer (A.x, A.x)
>>> Inertia_tuple = (I, P)
>>> B = RigidBody('B', P, A, m, Inertia_tuple)
>>> # Or you could change them afterwards
>>> m2 = Symbol('m2')
>>> B.mass = m2
I don't see how to use the known info about I in this example. Looking
through functions.py, there's an inertia function that does what I
want, but this isn't clear if one is trying to define a rigid body
because they'd look at the rigid body class. Plus, printing out the
inertia matrix would be a nice option, rather than the given form.
How is parallel axis theorem carried out in this code? I can't find an
example. A parallel axis theorem matrix is defined in
sympy.physics.matrices, but I doubt it's used. What about rotation of
the inertia matrix?
Next, is the kinematic equations function. First, they seem to be hard
coded based upon the sequence of rotations. Second, what is meant by u
and qdot? Nowhere is this defined or explained, even by just giving a
reference. There's rotation matrices about the 1-, 2-, and 3-axes
available in sympy.matrices (if needed, but I'm guessing there's
another way you'd prefer).
Trying to puzzle out the examples in the documentation is difficult
since there's lots of Python code, but really no explanation as to
what the symbols are. What are u1, u2, u3, q1, q2, q3 and how do they
relate to the figure? It's mentioned that they're configuration and
speed variables but it's not stated which are which (it's stated only
at the end of the example). Plus the choice of names (configuration
and speed) is definitely a Kane thing. Most texts I've read would have
called them position and velocity variables.
What does orientnew do? It's not clear from the example. I'm assuming
it's a rotation about an axis (or presumably an angle). Plus, the
frames Y and L should be shown on the diagram (plus R should be moved
next to the specific frame), especially since you're defining angular
velocities in one of them.
What is Dmc (put this on the figure)? The r * L.z confused me a bit. I
figured out that you're saying a distance r in the L.z direction, but
I rarely write out things that way. I'm normally specifying the frame
and the complete vector. I get that's what you're doing, but could I
pass a matrix or a tuple and multiply by L? I'd probably create a
vector in the L frame and use that, but I get that r * L.z is a
shortcut. Nowhere is just defining a vector in a frame done in the
example on its own.
What does v2pt_theory and a2pt_theory do? (Also, why the theory
suffix?). I'm guessing that Dmc is the centre of mass of the disc, but
nowhere is that stated. I'm also guessing that v2pt_theory and
a2pt_theory are the velocity and acceleration of Dmc with respect to
point C.
Why compute the kinematic differential equations by hand? Why not show
how to do it with the module? It seems like a lost opportunity.
I'm coming at this from the perspective of one who has been involved
in the teaching of a number of physics courses. If you define a symbol
in your code, it should show up in the text and if at all possible, in
a corresponding figure. Also, it would be nice if the output was LaTeX
output to show the full utility of the package.
Thoughts?
Tim.
--
Tim Lahey
PhD Candidate, Systems Design Engineering
University of Waterloo
http://about.me/tjlahey
--
You received this message because you are subscribed to the Google Groups
"sympy" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy?hl=en.