Advertisement

Spring Compression from Rest Lenght and Real Length

Started by July 09, 2016 10:47 AM
3 comments, last by adriansnetlis 8 years, 7 months ago

Hooke's law:
F = -kx

Where k is spring constant(stiffness) and x is compression rate. So if the spring is compressed, the force will push each ends of the spring away. If spring is stretched, than it will pull each of the ends together. That's kind of clear.

However, I need to get the compression somehow. I have the rest length(in m) and the current spring length(in m) and I need to get the compression distance(in m).

Currently I do:

compression = rest_length - spring_length

However, I'm not sure if this is correct.

Hooke's law:
F = -kx

Where k is spring constant(stiffness) and x is compression rate. So if the spring is compressed, the force will push each ends of the spring away. If spring is stretched, than it will pull each of the ends together. That's kind of clear.

However, I need to get the compression somehow. I have the rest length(in m) and the current spring length(in m) and I need to get the compression distance(in m).

Currently I do:


compression = rest_length - spring_length

However, I'm not sure if this is correct.

Seems like you want :

.


compression = spring_length - rest_length

.

So the variable x ("compression" in your code) is positive when you stretch the spring, giving you a negative force F, and vise versa when you compress it.

Advertisement

I more like meant - is it correct to use simple subtraction in this case?

Hooke's law:
F = -kx

Where k is spring constant(stiffness) and x is compression rate. So if the spring is compressed, the force will push each ends of the spring away. If spring is stretched, than it will pull each of the ends together. That's kind of clear.

However, I need to get the compression somehow. I have the rest length(in m) and the current spring length(in m) and I need to get the compression distance(in m).

Currently I do:


compression = rest_length - spring_length

However, I'm not sure if this is correct.

It is correct. x is not the compression rate, it's the displacement of the spring.

OK! Thanks!:)

This topic is closed to new replies.

Advertisement