rust

spring pulled const velo

Sparisoma Viridi
2 mins read ·

A working note for system of two masses and one spring pulled with constant velocity

A mass mim_i connected with mass mjm_j via a spring with constant kijk_{ij} and normal length lijl_{ij}. Position of mim_i relative to mjm_j is

xij=xixj(1)\tag{1} x_{ij} = x_i - x_j

and the distance between mass mim_i and mjm_j is

rij=(xixj)2.(2)\tag{2} r_{ij} = \sqrt{(x_i - x_j)^2}.

Notice that rijr_{ij} is always positive, while xijx_{ij} can be positive or negative.

Spring force on mim_i due to mjm_j is

Sij=kij(rijlij)uij,(3)\tag{3} S_{ij} = -k_{ij}(r_{ij} - l_{ij}) u_{ij},

where the unit vector is simple

uij=xixjrij.(4)\tag{4} u_{ij} = \frac{x_i - x_j}{r_{ij}}.

Eqns (2) and (4) can be extended from this 1-d system to 2-d and 3-d systems.

Newton’s second law of motion

F=mx¨(5)\tag{5} \sum F = m\ddot{x}

and Eqn (3) will produce

mix¨i=kij(rijlij)uij(6)\tag{6} m_i \ddot{x}_i = -k_{ij}(r_{ij} - l_{ij}) u_{ij}

with uiju_{ij} and rijr_{ij} are given in Eqns (2) and (4).

Suppose that mim_i is fixed and mjm_j is pulled with constant velocity vjv_j then position of mjm_j is simply

xj(t)=xj,0+vjt,(7)\tag{7} x_j(t) = x_{j,0} + v_j t,

while position of mim_i can be obtained after solving Eqn (6), which can be explcitly in the form of

x¨i=kijmi((xixj)2lij)(xixj(xixj)2).(8)\tag{8} \ddot{x}_i = - \frac{k_{ij}}{m_i} \left( \sqrt{(x_i - x_j)^2} - l_{ij} \right) \left( \frac{x_i - x_j}{\sqrt{(x_i - x_j)^2}} \right).

With nn is index of time tt, advancement of tt can be formulated as

tn+1=tn+Δt(9)\tag{9} t^{n + 1} = t^n + \Delta t

with n=0,1,2,..n = 0, 1, 2, ... Eqn (7) is rewriten as

xjn+1=xjn+vjΔt(10)\tag{10} x_j^{n+1} = x_j^n + v_j \Delta t

and also Eqn (8) as

x¨in=kijmi((xinxjn)2lij)(xinxjn(xinxjn)2).(11)\tag{11} \ddot{x}_i^n = - \frac{k_{ij}}{m_i} \left( \sqrt{(x_i^n - x_j^n)^2} - l_{ij} \right) \left( \frac{x_i^n - x_j^n}{\sqrt{(x_i^n - x_j^n)^2}} \right).

Using Euler’s method 1 new velocity of mass mim_i can be calculated

x˙in+1=x˙in+x¨inΔt(12)\tag{12} \dot{x}_i^{n+1} = \dot{x}_i^n + \ddot{x}_i^n \Delta t

and also its new position

xin+1=xin+x˙inΔt.(13)\tag{13} x_i^{n+1} = x_i^n + \dot{x}_i^n \Delta t.

And

xj0,  xi0,  t0(14)\tag{14} x_j^0, \ \ x_i^0, \ \ t^0

are the initial conditions. Simulation can be performed using Eqns (9) – (14). Additional initial condition can also be applied, e.g. if the spring is in its normal length, then

xi0=xj+lij(15)\tag{15} x_i^0 = x_j^ + l_{ij}

should hold.


  1. Kenneth Howell, “”, Department of Mathematical Sciences, University of Alabama in Huntsville, 28 Jun 2010, url https://www.uah.edu/images/people/faculty/howellkb/DEText-Ch9.pdf [20241008]. velocity of mim_i can be found as follow ↩︎

Tags: