Linear and angular spring simulation

AI Thread Summary
The discussion focuses on simulating a point mass connected to linear and angular springs using polar coordinates. Initial attempts led to incorrect results due to the independence of the equations governing radial and angular motion, which neglected centrifugal and Coriolis forces. The correct approach involves calculating acceleration components in both radial and tangential directions, incorporating these pseudo forces to achieve accurate simulation results. The final equations derived for the forces account for these effects, confirming the simulation's validity. The conversation highlights the importance of correctly applying coordinate transformations in dynamic simulations.
account
Messages
2
Reaction score
0
Hello,

I am trying to implement a simple simulation of a point mass connected to a linear and to an angular spring. I thought this would be very easy, basically just integrating these two equations:

mr''=-k_l(r-L)-c_lr'
m\theta''=-k_a(\theta-\alpha)-c_a\theta'

These are in polar coordinates (r,\theta), where k_l,c_l,L are the stiffness, damping coefficient and rest length of the linear spring and k_a,c_a,\alpha - of the angular spring.

It looks like it works correctly but then I realized that it is wrong. For example, with initial conditions r'(0)=0,r(0)=L the point will never change its distance from the origin no matter what the angular speed is, so there is no centrifugal force... This is obvious in hindsight because the two equations are completely independent.

So now I'm stuck and not really sure what I'm missing here. Any help is appreciated.
 
Physics news on Phys.org
You could calculate motion in Cartesian coordinate system (x,y). You can still calculate the force in polar coordinate system and then transform it to Cartesian.
 
It is also possible to calculate in polar coordinates, but one must correctly calculate
acceleration componets in radial and tangential direction. In this case you start with
position vector (rcos(fi),rsin(fi)), take a second time derivative and then split it into radial and tangential component. Since polar coordinates are not straight, an expression with second time derivative of fi (centrifugal force) also appears in r component of force and an expression with time derivative of r (Coriolis force) appears in fi component of force.
 
I have the answer to this (I think) I solved it using Laplace transforms. It's a loooong answer though, so email me if you want the equations. brian.kernan@gmail.com
 
Lojzek said:
You could calculate motion in Cartesian coordinate system (x,y). You can still calculate the force in polar coordinate system and then transform it to Cartesian.

I prefer to calculate in polar coordinates because there is a problem with calculating \theta only from (x,y). For example if I use \theta=\mbox{atan2}(y,x) then if there is any oscillation outside of [-\pi,\pi] the angle will wrap around and strange things happen.

Lojzek said:
It is also possible to calculate in polar coordinates, but one must correctly calculate acceleration componets in radial and tangential direction. In this case you start with position vector (rcos(fi),rsin(fi)), take a second time derivative and then split it into radial and tangential component. Since polar coordinates are not straight, an expression with second time derivative of fi (centrifugal force) also appears in r component of force and an expression with time derivative of r (Coriolis force) appears in fi component of force.

Ok, I just tried that. If I understand correctly I should write:

p=r(\cos \theta,\sin \theta)
\hat{p}=r(-\sin \theta,\cos \theta)
mp''=(-k_l(r-L)-c_lr')\frac{p}{r}+(-k_a(\theta-\alpha)-c_a\theta')\frac{\hat{p}}{r}

Solving these for the forces I get the following equations:

m(r''-r\theta'^2)=-k_l(r-L)-c_lr'
m(r\theta''+2r'\theta')=-k_a(\theta-\alpha)-c_a\theta'

I implemented these and it seems to work correctly now. Does this look correct to you?

kernanb said:
I have the answer to this (I think) I solved it using Laplace transforms. It's a loooong answer though, so email me if you want the equations. brian.kernan@gmail.com

I wrote to you about this. I'm waiting for your reply and I will try to summarize it and post it here. Thanks.
 
account said:
Solving these for the forces I get the following equations:

m(r''-r\theta'^2)=-k_l(r-L)-c_lr'
m(r\theta''+2r'\theta')=-k_a(\theta-\alpha)-c_a\theta'
These equations are correct. If would you put m(-r\theta'^2) to the other side of
the first equation, you would get centrifugal force. Similary you can get Coriolis force if you put m(2r'\theta') to the other side of the second equation. These two pseudo forces must be added in a rotating coordinate system (with angular velocity \theta') if one wants to consider the system to be inertial.
 
I have recently been really interested in the derivation of Hamiltons Principle. On my research I found that with the term ##m \cdot \frac{d}{dt} (\frac{dr}{dt} \cdot \delta r) = 0## (1) one may derivate ##\delta \int (T - V) dt = 0## (2). The derivation itself I understood quiet good, but what I don't understand is where the equation (1) came from, because in my research it was just given and not derived from anywhere. Does anybody know where (1) comes from or why from it the...
Back
Top