science forum beginner
Joined: 03 Oct 2005
|Posted: Mon Jul 17, 2006 5:40 am Post subject:
Angular springs in all their glory
I'm looking to simulate a 3D spring-mass system numerically, where some of the
springs are angular rather than hookean. Thus, each spring will cause a
torque, centered about one point, which acts on two other point-masses.
Ultimately, I want to convert those torques to forces. I've seen a couple of
formulations for this sort of system, but never are they quite defined to the
point where I fully understand them. So perhaps you can help me decypher them.
Or, at least can someone give some advice and/or point me to some nice
intuitive literature on the subject? Searching google and various journal
databases for things related to angular springs does not give me much.
The first definition is in terms of energy, as seen here:
E( p1, p2, p3 ) = ( s/2 )[ z . ( p3 - p2 ) x ( p2 - p1 ) - C ] ^ 2,
C = ||p1p2|| ||p2p3|| sin( td )
- p1, p2, p3 are the three points I was telling you about
(p2 is the point in the middle, about which the torque acts)
- p1p2, p2p3 are vectors from points p1 to p2, and p2 to p3, respectively
- z is the vector (0,0,1) -- this definition appears to be specific to 2D
- C is a "curvature" parameter.
- td is the desired angle between vectors p1p2 and p2p3
- s is a stiffness parameter
- x is the vector cross product
- . is the dot product
So, what does z mean, and how do I generalize it to 3D? Ultimately, how do I
calculate a force to apply to each point mass from this definition?
Another definition is out of an old intro physics text. The basis of it is the
fact that the cosine of the angle between two vectors is the dot product of
the normalized vectors. So, I could get an angle between them, but that angle
will always be between 0 and pi. So, as far as my numerics are concerned, I
have to be really careful of springs that have angles near pi. For example, if
I have a spring whose rest angle is 175 degrees, the system will push it
towards 175 for current angles less than 180, but will push it towards 185 for
current angles greater than 180. That's not good, and I was wondering if there
was some better way to get the angle, or rather how handle this in general.
The other trouble is that, once I have computed the torque acting on point p1,
I then have to convert that torque to a force vector. The only way I can think
of doing that is to find the plane whose normal vector is p1p2, and then
project the vector p3p2 onto that plane to get the direction of the force. The
magnitude is simply the torque divided by || p1p2 ||. So how do I find that
plane? Or, if there is an easier way to calculate the force's direction, I'd
be happy to hear it.