Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Linear and angular spring simulation

  1. Oct 17, 2008 #1

    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:


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

    It looks like it works correctly but then I realized that it is wrong. For example, with initial conditions [tex]r'(0)=0,r(0)=L[/tex] 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.
  2. jcsd
  3. Oct 17, 2008 #2
    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.
  4. Oct 17, 2008 #3
    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.
  5. Oct 17, 2008 #4
    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
  6. Oct 17, 2008 #5
    I prefer to calculate in polar coordinates because there is a problem with calculating [tex]\theta[/tex] only from [tex](x,y)[/tex]. For example if I use [tex]\theta=\mbox{atan2}(y,x)[/tex] then if there is any oscillation outside of [tex][-\pi,\pi][/tex] the angle will wrap around and strange things happen.

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

    [tex]p=r(\cos \theta,\sin \theta)[/tex]
    [tex]\hat{p}=r(-\sin \theta,\cos \theta)[/tex]

    Solving these for the forces I get the following equations:


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

    I wrote to you about this. I'm waiting for your reply and I will try to summarize it and post it here. Thanks.
  7. Oct 17, 2008 #6
    These equations are correct. If would you put [tex]m(-r\theta'^2)[/tex] to the other side of
    the first equation, you would get centrifugal force. Similary you can get Coriolis force if you put [tex]m(2r'\theta')[/tex] to the other side of the second equation. These two pseudo forces must be added in a rotating coordinate system (with angular velocity [tex]\theta'[/tex]) if one wants to consider the system to be inertial.
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?

Similar Discussions: Linear and angular spring simulation