Springs & forces

Started by
8 comments, last by Zipster 16 years, 2 months ago
I was wondering whether anyone could help me understand how I can convert the resolved force to the distance a point should move. Theoretically Hook's Law applies only to the change in length, but in computing the natural length can be 0 and we can alter the k-value of a spring once it's in existence as well. Below is a simple grid of springs. The springs connecting vertices 3,4,6 & 7 have had their k-values altered from 1.0 to 0.5. consequently their lengths should change. I've done part of the workings under the line sketch - but not sure where to go from there

256——	6-----<0.5>-----7-----<1.0>-----8
 	| 		|		|
 	|		|		|
 	|		|		|
      <0.5>	      <0.5>	      <1.0>
 	|		|		|
 	|		|		|
0 ——	3-----<0.5>-----4-----<1.0>-----5
 	|		|		|
 	|		|		|
 	|		|		|
      <1.0>	      <1.0>	      <1.0>
	|		|		|
 	|		|		|
-256—— 	0-----<1.0>-----1-----(1.0)-----2

	|		|		|
      -256		0	      +256
The vertices on the edges need to stay on the edges,it is the central vertices that alter their positions - in this case there is only one though! This is just an example but the non-corner vertices would slide along their respective edges too. Using Hooks law - resolve for Vertex 4:
LeftSpring = 	0.5 * (-256, 0, 0) = 	(-128, 0, 0)
RightSpring = 	1.0 * (+256, 0, 0) = 	(+256, 0, 0)
UpSpring = 	0.5 * (0, +256, 0) = 	(0, +128, 0)
DownSpring = 	1.0 * (0, -256, 0) = 	(0, -256, 0)
------------------------------------------------------
SumForce = 				(-128, 128, 0)
------------------------------------------------------
... So how do I get the distance Vertex 4 should move? I am fairly certain it's resting place is not (192, -128, 0). Many Thanks in advance [Edited by - Will-O on February 17, 2008 9:57:00 PM]
Advertisement
What if I told you your system won't reach equilibrium? [smile]

If I've done my math correctly (which rarely happens [grin]), assuming only the middle vertex (#4) can move, your equations of motion are (assuming 'm' is the point's mass):

x(t) = (128/3) - (128/3)cos[t*sqrt(3)/sqrt(m)]
y(t) = -(128/3) + (128/3)cos[t*sqrt(3)/sqrt(m)]

Which make sense, since that's the lower-right quadrant, however there is no limit as time goes to infinity. You can usually tell this will happen when the system is given an impulse input and there are no dampers which would introduce decay factors.
Assuming the system does eventually reach an equilibrium because of damping forces, equilibrium is a state where the sum of all forces is 0. You can try solving the equations for the positions that will cause the forces to sum to 0. The behavior of the system outside of equilibrium is a different problem.
Maybe I wasn't totally clear to start with - consider the springs to be replaced, which is essentially what happens when the k-value of a spring is altered.

If the springs connecting v3-v4 and v4-v7 were replaced by springs that are half as strong as those connecting v1-v4 and v4-v5, it stands to reason that the system would look something like this: (I hope the diagram is comprehendible).

The exact location of v4 should be attainable, shouldn't it?

256——	6-----<0.5>-----7-----<1.0>-----8 	| 		 \              | 	|		  \             | 	|		   \            |      <0.5>	          <0.5>         | 	|		     \          | 	|		      \         |0 ——	3-______               \      _/5 	|	\_<0.5>_ 	\  <1.0>| 	|		\________4_/	| 	|		      _/	|        |	          <1.0>	        |	|		  _/		| 	|		 /		|-256—— 	0-----<1.0>-----1-----(1.0)-----2	|		|		|      -256		0	      +256


There is no time aspect or animation of the oscillation to consider in this case - the aim is merely to relax a portion of the overall structure. And find out where the resultant location of v4 would be.
You have two options: (1) explicitly integrating the system forwards until it comes to rest. Damping will be necessary there, and will not affect the result (other than ensuring there is one). (2) Use implicit methods to find the rest position, by finding the position where the sum of all forces on each movable particle is zero. In your case, where certain particles are restricted to a line, that is "the sum of all forces projected onto each particle's domain of motion is zero".
Read Vorpy's answer again! it tells you exactly how to solve the problem.
I was hoping to avoid all the looping involved in resolving forces to zero.

However, I think this might be the way...

Each spring has a K value. These K values are merely magnitudes, and as such have no direction so dist = sum_Forces / (sum_Kvalues). It does seem to work in this case.

Resultant Force = (128, -128, 0);
Sum of K Values = 3.0

=> distance to move point v4
=> (128/3, -128/3, 0)
=> (42 2/3, -42 2/3, 0)

Moving the point v4 to this position and then trying to resolve forces does definitely make the forces resolve to zero.

Thank you all for your help.
You also could have found the second derivative of the motion equations I provided and solved those for zero [wink] It probably would have helped if I also provided the initial differential equations I solve from, because those are a little clearer. That would have told you where the acceleration of the point was zero, which is where the net force on the particle is zero. I just didn't know you could "place" the particle anywhere you wanted, I assumed it was under the initial conditions shown.

Here are those equations if you're curious. You can determine them using Lagrangian mechanics:

3*x(t) - 128 + m*x"(t) = 0
3*y(t) + 128 + m*y"(t) = 0

Note how the last term on the left side in each equation is mass-times-acceleration, or force.
Quote:Original post by Zipster
You also could have found the second derivative of the motion equations I provided and solved those for zero [wink] It probably would have helped if I also provided the initial differential equations I solve from, because those are a little clearer. That would have told you where the acceleration of the point was zero, which is where the net force on the particle is zero. I just didn't know you could "place" the particle anywhere you wanted, I assumed it was under the initial conditions shown.

Here are those equations if you're curious. You can determine them using Lagrangian mechanics:

3*x(t) - 128 + m*x"(t) = 0
3*y(t) + 128 + m*y"(t) = 0

Note how the last term on the left side in each equation is mass-times-acceleration, or force.


Thanks Zipster. Thankfully I'm not trying to create any kind of animation. The sequence of events is
(1) Alter spring constants
(2) vertex by vertex work out the forces applied by each spring
(3) If (sum of forces != 0)
{
distance to move = sum forces divided by total K of springs about that vertex;
vertex position += distance;
}
else
ignore;
(4) Update renderer.


- That's it!

No need to see where a vert would be after a certain amount of time or take into account its mass, or anything like that. The points could even have mass=0 for my purpose.

On the other hand...

Using the equations you presented which would allow me to animate, reading from right to left:
- for each dimension I read
Three times Position(x/y/z) at time 't' + Sumforce(x/y/z) + m (times) acceleration(x/y/z) at time t equals zero - is that right?

Is the "three" from my sum K values?

Isn't that Euler integration? What's Lagrangian?
Without going into too much detail, Legrangian mechanics is a nice approach to solving problems where a Newtonian approach would be too unwieldy. You're guaranteed to at least get a set of differential equations that describe the motion of the system, even if it isn't necessarily easy to solve for the original generalized coordinates (luckily it is in this case). Near the bottom of that link in the Examples section, you should find some applications of the Euler-Lagrange equations to a few mass-spring-pendulum problems. You need to know the potential energy stored in a spring, which is U = (0.5)*k*x2. The sum of the potential energies stored in each spring attached to the point is the potential energy of the entire configuration, and the kinetic energy of the point is what you'd expect it to be. Use the generalized coordinates 'x' and 'y' (which are really just the Cartesian coordinates), and you're good to go!

This topic is closed to new replies.

Advertisement