Whatโs the action of a simple harmonic oscillator? And how does this change depending upon the path? Some mates of mine and I worked through this recently. This is my write-up of that calculation.
While discussing special relativity recently, some friends of mine and I realised that weโd not understood the concept of action. It seems that this isnโt a well-understood concept, at least not at an intuitive level: it โjust worksโ and most people seem happy with that. As mentioned in a Veritasium video a while ago, Euler and Lagrange gave the concept of action a firm mathematical foundation. The idea that action is minimised is known as the principle of least action.
To understand this topic better (or at least, try to), we decided to consider a simple harmonic oscillator as a toy example. Since we know the solution, we could then calculate the action for the path matching the known solution and, as a comparison, the path of a linear ramp. The idea here being that weโd find the action to be minimised over an oscillatory path and that a path differing from that would give a non-minimal action. Thus, we could develop a better intuition for the principle of least action and hence for why the Lagrangian formalism works the way it does.
Letโs look at how to calculate the action for a simple harmonic oscillator.
Setting the stage
Consider a simple harmonic oscillator (SHO) such as a mass on a spring. We wish to calculate the action for a quarter oscillation of this system to try and convince ourselves that the standard solution for the equations of motion of a SHO (in a simplified form) gives the minimal (and hence optimal) action. We will later compare this to an alternative motion with the same boundary conditions1โbut following a different path between themโto see that the standard solution minimises the action. We will also show that the general solution for the action of a SHO reduces to the same value as our simplified form when considering these boundary conditions.
with
q
and
qหโ
being the generalised positions and velocities of the objects in motion, and where
t
is time. The values
t1โ
and
t2โ
denote the start and end points of the interval over which we are measuring the action. The quantity
L
is the Lagrangian, which is defined by
L=TโV,โโ
with
T
being the kinetic energy and
V
being the potential energy.
We simplify the situation by considering only motion in the
x
-direction. Hence,
q
and
qหโ
reduce to
x
and
xห
, respectively.
The kinetic energy is written in its familiar form:
T=21โmv2โโ
which, given we only consider motion in the
x
-direction, we write as:
T=21โmxห2โโ
For motion under the influence of a conservative force,2 the potential energy is the negative of the integral of all forces in the system, i.e.
V=โโซFย dx,โโ
where in this case we only consider forces acting in the
x
-direction. To find the potential energy of a mass on a spring, we use Hookeโs Law for the force:
F=โkxโโ
and thus integrate over
x
. Hence we have
V=โโซFย dxโโ
=โซkxย dxโโ
=21โkx2.โโ
Combining (4) and (9) we write the Lagrangian like so:
With the general form for the action of a simple harmonic oscillator in hand, we can consider the action over different paths of motion.
Action for sinusoidal motion
For the mass-on-a-spring example weโre considering here, we choose the situation where the mass has its maximum speed (and hence maximum kinetic energy) at
t1โ=0
corresponding to the position
x(t1โ)=0
. The endpoint, at
t2โ
, we choose to be where the mass has maximum amplitude and hence maximum potential energy. In other words, the final position is
x(t2โ)=A
, where
A
is the amplitude of oscillation.
We can visualise this situation like so:
The interval over which we wish to calculate the action is thus a quarter oscillation of the SHO.
where
x(t)
is the massโ position along the
x
-axis at time
t
,
A
is the amplitude,
ฯ
is the angular velocity of the oscillation and
ฯ
is the phase offset. In our situation, weโve chosen the boundary conditions such that the phase offset can be set to zero; hence, we now have this reduced form of the equation describing the motion:
x(t)=Asin(ฯt).โโ
Differentiating this with respect to time, we obtain a relation for the velocity
xห(t)=ฯAcos(ฯt).โโ
With this information in hand, weโre now able to write the action (Equation 11) explicitly in terms of
t
This now makes it possible to perform the integral. Before we can do that, however, we need to work out what the limits of integration are.
The boundary conditions
x(t1โ)=0andโโ
x(t2โ)=A,โโ
imply that the limits of integration become
t1โ=0andโโ
t2โ=2ฯฯโ.โโ
The squared sine and cosine terms in (15) make performing the integral difficult. We can simplify things by using the trigonometric double-angle identities:
cos2ฮธ=21+cos(2ฮธ)โandโโ
sin2ฮธ=21โcos(2ฮธ)โ.โโ
Therefore, we can replace the squared sine and cosine expressions with simpler expressions only in terms of cosine. The integral calculating the action thus becomes:
Combining Equations (30) and (38), we can write the equation for the action specified in (22) as:
S=81โฯmฯA2โ81โฯฯkA2โ,โโ
which simplifies to
S=81โฯA2[mฯโฯkโ].โโ
From the solution of the differential equation describing simple harmonic oscillation, we know that
ฯ
can be written in terms of the spring constant
k
and the objectโs mass
m
, i.e.:
ฯ=mkโโ.โโ
Substituting this value into (40), we get:
S=81โฯA2[mฯโฯkโ]โโ
=81โฯA2[mmkโโโkkmโโ]โโ
=81โฯA2[mm2kโโโkmk2โโ]โโ
=81โฯA2[mkโโmkโ]โโ
=0.โโ
Thus, we find that the action for a simple harmonic oscillator for the boundary conditions
x(0)=0andโโ
x(ฯ/2ฯ)=Aโโ
is equal to zero. This result implies that the action is minimised over the path described by the equations of motion of a simple harmonic oscillator.
We can see thatโfor the boundary conditions considered hereโthe general solution for the action reduces to the same result as that given by our simplified SHO solution in (13).
Weโve now convinced ourselves that the action for the simple harmonic oscillator seems to be minimised over the path given by the standard solution. What happens if we choose another path? What effect does that have on the action? Letโs look into this now.
A different path
Consider a situation other than simple sinusoidal motion. For instance, a linear ramp from zero amplitude up to maximum amplitude, progressing over the same time interval. The mass now moves with constant velocity from the beginning (
x(t=0)=0
) to the end (
x(t=ฯ/2ฯ)=A
). What is the action in this situation? If the action for the simple harmonic oscillator solution is
0
(and hence minimal), then we expect this alternate path to give a larger action.
Letโs calculate everything and see. The main point about considering such a situation is that the system now takes a different path between the two boundary conditions. Whether or not the motion itself is 100% physical is irrelevant for the calculation. The goal in performing this calculation is to support our intuition about the action being minimised in the optimum situation.
As before, we write the Lagrangian like so:
L=TโVโโ
with
T=21โmv2=21โmxห2andโโ
V=21โkx2.โโ
Because the mass moves between the start and end points with constant velocityโand we want the equations of motion to match these boundary conditionsโwe write the position and velocity of the mass over time as:
Although this equation follows from the sinusoidal result we derived above, we still need to use it in the linear ramp case due to our boundary conditions. This is in particular due to the expression for
t2โ
(Equation (19)), which is defined in terms of
ฯ
.
Substituting the expression for
ฯ
from (68) into (67), we get:
S=ฯA2ฯโ[mโ121โkฯ2ฯ2โ]โโ
=ฯA2โmkโโ[mโ121โkฯ2kmโ]โโ
=ฯA2โmkโโm[1โ12ฯ2โ]โโ
=ฯA2โkmโ[1โ12ฯ2โ].โโ
Since
[1โ12ฯ2โ]โโ
is greater than zero (and hence greater than the action calculated in the sinusoidal case), we can conclude that this motion is not optimal. Thus, the simple harmonic oscillation path gives the best result because it minimises the action.
In other words, it worked! We confirmed our premise from the beginning. ๐
If you want a deeper understanding, you have to put in the work
Going through this process really helped my understanding. For instance, when I first watched the Veritasium video about action, I thought โThatโs interestingโ, but nothing much more. After having done the calculation above myself, I re-watched the video and was like โOh, thatโs what they were talking about!โ.
Going over the material after someone has presented it to you consolidates your knowledge of the topic. Who wouldโve thought? ๐
The boundary conditions must be the same when comparing the actions of two separate paths. I.e. the start and end points in space need to be the same, and the start and end times need to be the same. โฉ
In other words, the work done in taking a particle between two points in space is independent of the path taken. โฉ
Note that
T
here does not represent the kinetic energy; it represents the time at the end of the path between
xaโ
and
xbโ
. โฉ
Top comments (0)
Subscribe
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Top comments (0)