Nothing Special   »   [go: up one dir, main page]

Latex Project Q9 PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

The Simple Harmonic Oscillator

Rishabh Jain
November 21, 2019

1 INTRODUCTION
Start with a spring resting on a horizontal, frictionless (for now) surface. Fix one end
to an unmovable object and the other to a movable object. Start the system off in an
equilibrium state nothing moving and the spring at its relaxed length.

Now, disturb the equilibrium. Pull or push the mass parallel to the axis of the spring and
stand back. You know what happens next. The system will oscillate side to side (or back
and forth) under the restoring force of the spring. (A restoring force acts in the direction
opposite the displacement from the equilibrium position.) If the spring obeys Hooke’s
law (force is proportional to extension) then the device is called a Simple Harmonic
Oscillator (often abbreviated SHO) and the way it moves is called Simple Harmonic
Motion (often abbreviated SHM).

2 The Harmonic Oscillator


We consider a particle of mass m, that is moving in a potential which depends only on
x, and has the form
1
V (x) = kx2 (2.1)
2
where k is some constant.
This particle is therefore attracted to the origin (x= 0, the center of the potential) by a
restoring force given by Hooke’s law,
dV
F=− = −kx (2.2)
dx
Begin the analysis with Newton’s second law of motion.
X
F = ma (2.3)

There is only one force - the restoring force of the spring (which is negative since it
acts opposite the displacement of the mass from equilibrium). Replace net force with
Hooke’s law. Replace acceleration with the second derivative of displacement.

d2 x
−kx = m (2.4)
dt2

1
Rearrange things a bit.

k d2 x
− x= 2 (2.5)
m dt
This is a second order, linear differential equation. On the left side we have a function
with a minus sign in front of it (and some coefficients). On the right side we have the
second derivative of that function. The solution for this equation is a function whose
second derivative is itself with a minus sign. We have two possible functions that satisfy
this requirement sine and cosine two functions that are essentially the same since each is
just a phase shifted version of the other. When a trigonometric function is phase shifted,
it’s derivative is also phase shifted. Nothing else is affected, so we could pick sine with a
phase shift or cosine with a phase shift as well.

The parabolic potential in Equation (2.1) is particularly useful both in classical and
in quantum mechanics, since it provides a very good approximations to many arbitrary,
continuous potentials close to a stable equilibrium position. The SHO is therefore the
prototype for systems in which there exist small motion (vibrations) about a point of
stable equilibrium -such as vibrations of atoms in a lattice, etc.

3 Reaching the Solution


Because of the importance of SHO, it is worth recalling the classical treatment. The
equation of motion of a particle is given by,

d2 x dV
m = − = −kx (3.1)
dt2 dx
The general solution of this equation is,

x = X0 cos(ωt + φ), (3.2)


namely a sinusoidal oscillation around x = 0. Here,
r
k
ω= (3.3)
m
is the angular frequency of the motion, and the constants X0 (the amplitude) and φ
(the initial phase) are determined by the initial conditions.

The kinetic energy of the particle is


2
p2

1 dx
T = m = , (3.4)
2 dt 2m
where p = m dxdt
is the momentum of the particle, while the potential energy is given
by Equation 2.1,
1 1
V = kx2 = mω 2 x2 (3.5)
2 2

2
The total energy is thus

p2 1 1
E =T +V = + mω 2 x2 = mω 2 X02 (3.6)
2m 2 2
which is a constant of motion. (Note that we used Equation 3.2). The energy of the
particle is therefore time-independent, and depends only on X0 , which is arbitrary (see
Figure 1).

Figure 1: The potential energy,V (x) in a 1-d simple harmonic oscillator. The amplitude
of the classical motion of particle with energy E is X0 .

The motion of the particle is limited between −X0 ≤ x ≤ X0 . At x = ±X0 the kinetic
energy is zero, while the potential energy is maximal, while at x = 0, the kinetic energy
is maximal and the potential energy is zero.

For ease of comparison between the classical and quantum results, let us calculate the
classical probability p(x)dx of finding the particle in the interval dx around x, when a
random observation is carried out. This probability is equal to the fraction of the total
time that the particle spends in this interval.


Denote the period of oscillation by Tosc = ω
, this probability is given by
1 2dx ω 2dx dx
p(x)dx = = = 2
(3.7)
Tosc v(x) 2π (−1)ωX0 sin(ωt − φ) π(X0 − x2 )1/2
Obviously,p(x)dx is largest near the turning points, x = ±X0 , where the speed of the
classical particle vanishes.

4 FORTRAN Code
Following is the FORTRAN code to solve the equation of motion of Simple Harmonic
Oscillator. This code couples the 2nd order differential equation into a system of 1st
order differential equations and solve them using RK-4 mehtod.

! Program to solve SHO problem with RK-4 method


program sho
implicit none

3
real :: x0,v0,dt,x,v,t,xold,vold,f,g
real :: k1,k2,k3,k4,p1,p2,p3,p4

! x0, v0 are initial position and velocity


print*, ’Enter x0, v0 :’
read*, x0,v0

! dt is the time step


print*, ’Enter dt :’
read*, dt

! Initilialise the variable


xold = x0; vold = v0; t = 0;

! Open output data file


open(unit=56,file=’rk4.dat’,status=’unknown’)

do
if (t > 50) exit

k1 = f(xold,vold,t)
p1 = g(xold,vold,t)

k2 = f(xold+0.5*dt*k1,vold+0.5*dt*p1,t+0.5*dt)
p2 = g(xold+0.5*dt*k1,vold+0.5*dt*p1,t+0.5*dt)

k3 = f(xold+0.5*dt*k2,vold+0.5*dt*p2,t+0.5*dt)
p3 = g(xold+0.5*dt*k2,vold+0.5*dt*p2,t+0.5*dt)

k4 = f(xold+dt*k3,vold+dt*p3,t+dt)
p4 = g(xold+dt*k3,vold+dt*p3,t+dt)

x = xold+dt*(k1+2*k2+2*k3+k4)/6
v = vold+dt*(p1+2*p2+2*p3+p4)/6

t = t+dt

! Print out values


print*, t,x,v
write(56,*) t,x,v

xold = x; vold = v;
end do

close(56)
stop
end

4
! Function f(x,v,t)
function f(x,v,t)
implicit none
real :: x,v,t,f
f = v
return
end

! Function g(x,v,t)
function g(x,v,t)
implicit none
real :: x,v,t,g
g = -x
return
end

The following figure shows the plot of data points made by the code in rk4.dat file

Figure 2: Variation of displacement(x) and velocity(v = dx/dt) with time

5 Conclusion
The differential equation of S.H.O. is hence numerically solved using RK-4 method of
solving ODEs by coupling the 2nd order differential equation (eq.2.5) into a system of
first order ordinary differential equations and hence solved simultaneously to obtain data
points.These data points when plotted in GnuPlot show variation as shown in Figure 2.

While obtaining the differential equation of motion, we consider few basic approxima-
tions like sin(x) ≈ x for small values of x, i.e. for small angles but if we do not consider
the above approximation, it results in a non linear differential equation and it becomes
hard to solve it analytically.
This forms a whole new branch of physics and mathematics: Chaos. Chaos theory
is a branch of mathematics and physics focusing on the behavior of dynamical systems

5
that are highly sensitive to initial conditions. Chaos theory is an interdisciplinary the-
ory stating that, within the apparent randomness of chaotic complex systems, there
are underlying patterns, constant feedback loops, repetition, self-similarity, fractals, and
self-organization. The butterfly effect describes how a small change in one state of a
deterministic nonlinear system can result in large differences in a later state, meaning
there is sensitive dependence on initial conditions. A metaphor for this behavior is that
a butterfly flapping its wings in China can cause a hurricane in Texas.
Small differences in initial conditions, such as those due to rounding errors in numeri-
cal computation, yield widely diverging outcomes for such dynamical systems, rendering
long-term prediction of their behavior impossible in general. This happens even though
these systems are deterministic, meaning that their future behavior is fully determined
by their initial conditions, with no random elements involved. In other words, the de-
terministic nature of these systems does not make them predictable. This behavior is
known as deterministic chaos, or simply chaos. The theory was summarized by Edward
Lorenz as:
”Chaos: When the present determines the future, but the approximate
present does not approximately determine the future.”

References
1) http://www.physics.ucc.ie/apeer/PY3102/SHO.pdf/
2) https://physics.info/sho/
3) https://www.google.co.in/
4) https://en.wikipedia.org/wiki/Chaos theory/
5) An Introduction to Mechanics:Kleppner and Kolenkow
6) LATEX-A Document Preparation System, Leslie Lamport (Second Edition).
7) Gnuplot in action: understanding data with graphs, Philip K Janert
8) Computational Physics: An Introduction, R. C. Verma

You might also like