In article <vnttl2$20mb1$
[email protected]>, Luigi Fortunati wrote
If I push the end A of a spring, do I compress it or accelerate it?
Obviously I compress it and accelerate it at the same time, because I
am not pushing the elastic body of the spring but only its point A.
I ask myself: how much of my force is dedicated to compression and how
much to acceleration?
In general the spring's center of mass accelerates AND the spring is compressed.
But, it's not correct to say that only part of the applied force is
dedicated to acceleration -- actually, the spring's center-of-mass
acceleration is determined by *all* of the applied force, while at the
same time the spring compresses.
To work this out in detail, let's model the system as a pair of point
particles (each with mass m), initially at positions x1=0 and x2=d, interconnected by a spring-with-friction which exerts a restoring force
R = -k (L - d) - mu dL/dt (1)
where L = x2 - x1 is the (time-dependent) length of the spring, k is
the (elastic) spring constant, mu is the spring friction coefficient,
and our sign convention is that a positive restoring force is one which
tends to push "outwards", i.e., one that tends to increase L.
Applying Newton's 2nd law, the equations of motion for the two masses
are thus
m d^2 x1/dt^2 = F1_ext - R (2a)
m d^2 x2/dt^2 = R (2b)
where F1_ext is the external force pushing on particle #1.
Now let's work out the motion of the spring's center of mass. The
center of mass is located at
xc = (x1+x2)/2 . (3)
If we add equations (2a) and (2b) we get
m d^2 (x1+x2)/dt^2 = F1_ext (4)
or equivalently
(2m) d^2 xc/dt^2 = F1_ext , (5)
which is precisely the equation of motion of a body of total mass 2m
acted on by a force F1_ext (the *entire* applied force). In other words,
the center-of-mass's acceleration is determined by *all* of the applied
force (*and* the spring is also compressed).
(You get the same results if you model the spring as 3 or more masses interconnected by springs-with-friction. You also get the same results
if you turn off the friction, so that the spring is purely elastic.)
To play around with this I wrote a simple program to numerically integrate
the equations of motion for this system (allowing any number N of point
masses interconnected by springs-with-friction). The program is short
enough that I'll give it below.
For the example above, with the program's default parameters m=1, d=1,
k=2.5, mu=0.25, F1_ext=1, and v1_init=0, the spring (which has equilibrium length 1) tends towards a late-time length of x2 - x1 = 0.8, i.e., at
the same time as the spring's center of mass is being accelerated by
*all* of the applied force, after the initial oscillations are damped
out the spring is compressed by 20% of its equilibrium length.
Here is the simulation program. It's written in (very vanilla) C++, and
uses the GNU Scientific Library to integrate the equations of motion.
--- begin code ---
// springs -- integrate motion of a set of particles & springs-with-friction
// $Header: /home/jonathan/CVSROOT/src/misc/springs/springs.cc,v 1.33 2025/02/16 03:22:50 jonathan Exp $
//
// *** copyright ***
// *** external libraries used ***
// *** global constants, parameters, and declarations ***
// *** PROBLEM DESCRIPTION ***
// *** definition of ODE state vector and access fns ***
// main
// params::print_me - print out all the parameters
// springs_rhs - compute the entire ODE system's RHS
// spring_force - compute spring-with-friction's restoring force
//
#include <cassert>
#include <cstdio> // sscanf(), printf(), fprintf() #include <cstring> // strcmp()
#include <cstdlib> // exit()
#include <vector>
#include "gsl/gsl_errno.h"
#include "gsl/gsl_odeiv2.h"
using std::sscanf;
using std::printf;
using std::fprintf;
using std::strcmp;
//******************************************************************************
//
// Copyright 2025, Jonathan Thorn