Differential Equations of Physics

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

Examples of the

Differential equations of
Physics
This is an article from my home page: www.olewitthansen.dk

Ole Witt-Hansen 2008


Contents

1. The dependence of pressure with altitude.............................................................................. 1


2. Radioaktive chains of decay .................................................................................................. 3
3. Linear motion of a particle in liquids and gasses................................................................... 6
3.1 A ball sinking in a liquid...................................................................................................... 6
3.2 Vertical motion with turbulent resistance in liquids and gasses .......................................... 8
3.2.1 Upward movement ............................................................................................................ 9
3.2.2 Downward movement: .................................................................................................... 11
3.2.3 Vertical motion in air ...................................................................................................... 11
4. The motion of a projectile .................................................................................................... 13
4.1 The motion of a projectile without drag............................................................................. 13
4.2 The motion of a projectile with drag (air resistance) ......................................................... 14
5. Damped harmonic oscillations............................................................................................. 16
5.1 Solution to the differential equation using complex numbers. .......................................... 17
5.2 Traditional solution of the same differential equation ....................................................... 19
6. Forced harmonic oscillations without damping ................................................................... 21
7. Numerical solution to differential equations........................................................................ 24
7.1 Taylor’s formula ................................................................................................................ 24
7.2 Numerical solution to first order differential equations..................................................... 25
First order differential equations 1

1. The dependence of pressure with altitude

We consider a rectangular horizontal section of the


atmosphere. The area of the two end faces are A. The box
is situated in the height y over the ground. The height of
the box is Δy. The pressure on the upper and the lower
side are p ( y  y ) and p ( y ) respectively.
The density of the air in the height y is  ( y ) .
The force on a flat piece with area A is F = pA, where p
is the pressure on the flat.
We then express that the difference in the force on the
upper and the lower side is equal to the gravitational force
on the air in the box, assuming that the air in the box is at
rest. (g is the gravity acceleration)

p( y ) A  p( y  y ) A  mair g   ( y )Vair g   ( y ) Ayg

So p( y ) A  p ( y  y ) A   ( y ) Ayg

p( y  y )  p( y ) p( y  y )  p( y ) dp
Dividing by AΔy:    ( y ) g , and replacing by we find:
y y dy

dp
(1.1)    ( y) g
dy
To solve this differential equation we need to know another relation between  ( y ) and p ( y ) .
This can however be obtained by:

1. The equation of state for ideal gasses: PV = nM RT (nM is the number of moles)
m
2. Definition of the mole mass M: m  nM M  nM 
M
m
3. The definition of density;    m  V
V
Insertion of the last two equations in (1) the equation of state gives:

m V M
(1.2) PV  nM RT  RT  RT   P
M M RT

This expression for the density is then used in (1.1).

dp Mg
(1.3)  p
dy RT
First order differential equations 2

It is well known that the temperature decreases roughly by one centigrade for every 200 meters
increase i altitude over the ground but Initially, we shall assume that the temperature is constant up
through the atmosphere.

The differential equation (1.3) has the well known solution:

Mg
 y
(1.4) p ( y )  p0 e RT

Using the known values: Mair =29 g/mol, g = 9.82 m/s2, R= 8.31 J/(mol K) and T = 273 K,
we find:
4
(1.5) p( y )  p0e 1.2610 y

Where y should be measured in meters


This results in a pressure drop of 1.3% per 100 m and a drop of 12% per 1000 m.

Next we shall look at the solution to the differential equation, where we take into account that the
temperature drops linearly 1 0C per 200 m increase in altitude.
We put the temperature on the ground at 20 0C = 293 K. The temperature in the altitude y then
becomes T = T(y) = 293 – y/200. Then the differential equation becomes:

dp Mg
(1.6)  y
p
dy R(293  )
200

The equation is solved in the usual way by separating the variables and integrating

p y
dp Mg 1
p p   R 0 y
dy
0 293 
200
p y
dp Mg 1 1
p p   293R 0 1  y dy where 
293200
0

p Mg
ln( ) ln(1   y ) 
p 293R
(1.6) 0
Mg

p  p0 (1   y ) 293 R

Although it looks rather different from (1.5), it turns out that it only causes a deviation from (1.5)
of about 0.1 – 0.2 %.
First order differential equations 3

2. Radioaktive chains of decay


The differential equation for the number N of radioactive Nuclei, which have not decayed yet is
well known from elementary high school.

dN
(2.1)   kN
dt

It has the equally well known solution

(2.2) N (t )  N 0 e  kt

The activity is the rate of decay


dN
(2.3) A(t )    kN (t )
dt

Th constant k is the decay constant, and is equal to ln2 divided by the half life T½ , since

ln 2
(2.4) 1
2
N 0  N 0e  kT½ gives: k

We shall then look at a chain, where the original nucleus decays into another radioactive nucleon.
This is well known from the common chains of decay: The Uranium-, the Thorium-, and the
Actinium series.

If we denote the two nuclei by (1) and (2), we may establish two differential equations.
The first one is identical to (2.1), with decay constant k1, whereas the second expresses that
nucleus (2) is produced with a speed that is equal the activity of nucleus (1), subsequently decays
with the decay constant k2.
dN1 dN 2 dN
 k1 N1 and   1  k2 N 2 
dt dt dt

dN 2
(2.2)  k1 N1  k 2 N 2
dt
The last differential equation has the form

dy
(2.3)  ky  h(x)
dx

It is solved by moving the term –k·y to the left hand side, multiplying the equation by ekx , and
rewrite it as a single differential quotient.

dy dy k  x d ( ye k  x )
(2.4)   ky  h( x)  e  ke k  x y  h( x)e k  x   h ( x )e k  x
dx dx dx
First order differential equations 4

If H ( x)   h( x)e k x dx , then the differential equation has the solution:

(2.5) yek  x  H ( x)  c  y  H ( x)e  k  x  ce  k  x

The constant c is the usual constant of integration, which is to be determined by the initial
conditions.

Replacing x with t, y with N2 , and h(x) with N1(t) in (2.3) and following the same manipulations
with the new variables, we find:

dN 2
 k1 N1  k 2 N 2  N1  N 0 e  k1t 
dt

dN 2
e k2 t   k 2 e k2 t  N 2  k1 N 0 e  k1t e k2 t 
dt

d (e k2 t  N 2 )
 k1 N 0 e ( k2  k1 )t 
dt

k1
e k2 t  N 2  N 0 e ( k2 k1 )t  c 
k 2  k1

k1
N 2  N 2 (t )  N 0 e  k1 t  ce  k 2 t 
k2  k1

k1
The constant c is determined by N2(0) = 0 => c   N 0 k2 k1
, and the solution is hereafter:

k1 k1
N 2 (t )  N 0 e  k1  t  N 0 e  k 2 t 
k2  k1 k2  k1
(2.6)
k1
N 2 (t )  N 0 (e( k 2  k1 )t  1)e  k 2 t
k2  k1

Notice that N2 > 0 for t > 0, whether k2 > k1 or not. (The case k2 = k1 , has only academic interest,
but the solution is: N 2  k1 N 0te  k2 t ).

The result (2.6) is relatively easy to interpret, since the first two factors are the number of (1)
nuclei, which have decayed to (2) nuclei, but have not yet decayed, and the last factor is the law of
decay for the (2) nuclei.
First order differential equations 5

If the chain of decay is longer than three nuclei a solution to the differential equations can in
principle be found in the same manner, as one should just replace the expression for N1 (t ) with
the expression for N 2 (t ) in the differential equation for N 3 (t ) .

Solutions of the type (2.6) can be applied to determine the age of radioactive materials.
In praxis we know the two decay constants k1 and k2 together with the ratio N2/N1.
Then the following equation (2.7) can be applied to find the time t which has elapsed since the
material N1 was created. This has been one of the first reliable methods to determine the correct
age of the earth.

k1
N 2 N0 k2  k1
(e ( k2 k1 )t  1)e  k2t k1
(2.7)   k1t
 (1  e ( k1 k2 ) t )
N1 N 0e k 2  k1

N2 k1
If k2 > k1 then:  for t  
N1 k 2  k1
Second order differential equations 6

3. Linear motion of a particle in liquids and gasses


When you analyze a mechanical system in order to determine the equation of motion, one is often
referred to assume, that the system is without friction or dissipative forces.
This is usually only a realistic description to a certain degree, and sometimes completely unrealistic,
but the differential equation, which describes the dynamics of the system, can only be solved in
some cases, when the dissipative forces (coming from friction or viscosity) do not depend on the
velocity. The latter is the case where to solid materials move relatively to each other.

The aim of this section is to draw attention some simple examples where the friction (the viscosity)
is velocity dependent, either linearly or as the square of the velocity.

3.1 A ball sinking in a liquid


We shall first consider a body (characteristically a ball), which sinks in a liquid (water) under the
influence of gravity.
If the speed is not too big (and for minor bodies it is not) we have a so called laminar streaming,
and in that case, we can assume that the resistance to the movement is proportional to the speed of
the sinking body.
If the speed of movement becomes larger, the resistance transforms into turbulent flow, where the
resistance to the movement is more conspicuous, but empirically it is assumed to be proportional to
the square of the speed. Turbulence is best described by the appearance of vortices in the liquid or
in the air.

Incidentally turbulence is still one of partly unsolved problem hydrodynamics, since the Navier-
Stokes equations (Newton’s second law for hydrodynamics) do not allow a transition from laminar
streaming to turbulent streaming, although both phenomena appear as solution to the equations.

A theoretical expression for the viscous force on a ball in a laminar flow is first given by Stoke, and
is called Stokes law. If r = radius of the ball, v= the speed,  = viscosity of the fluid, then:

(3.1) Fvisc  6rv

In the following examples, we shall abbreviate the constants 6r to one, and we then write the
proportionality between the force and the speed as: Fvisc    v . This formula is actually
independent of the shape of the falling body, as long as the flow is laminar.

For a motion along the x axis, we have the well known concepts.

dx dv d 2 x
Velocity: v  , acceleration: a   , and Newton’s 2. law: Fres  ma
dt dt dt 2

A body falling in a liquid is influenced by the following forces:

1. Gravity: FT = mg.

2. The buoyancy Fup   vVg


Second order differential equations 7

Which is equal to the gravity of the displaced liquid, where  v is the density of the fluid and
m
V is the volume of a body with mass m and density  .

3. The viscous force: Fvisc  v .

The resulting force on the body is therefore:

FT – Fup = mg   vVg  Vg   vVg  (    v )Vg  mv g

Where mv g is the gravity of the body reduced by the buoyancy:The equation of motion is hereafter:

dv dv  m
(3.2) Fres  ma  m  mv g  v   v v g
dt dt m m

mv
To obtain more simplicity we put g v  m
g


t
The equation is solved by the same method, as we did in (2.4), by multiplication with e m and
rearranging.
  
t dv  mt t
e m
 e v  e m gv 
dt m

t 
d (ve m ) t
(3.3)  e m gv 
dt
 
t m mt
ve  e g v  c
m



mgv  t
v  ce m

(3.4)


mv g  t
v  ce m

mv g
Adding the initial condition v(0)=0, we find c   
, which inserted in the solution (3.4) gives:

mv g  t
(3.5) v (1  e m )

mv g
We can see that the velocity approaches asymptotically to v  
.
The half life of the velocity can be found in the traditional manner:

ln 2  m ln 2
t1  og k   t1  .
2
k m 2

For the majority of motions in liquids, the final velocity is obtained rather quickly.
Second order differential equations 8

The equation (3.5) can of course be integrated to give the distance x.



m g m  t
(3.6) x  x0  v (t  (e m  1))
 

If the body has a initial velocity v0 opposite to gravity, we must change sign on the mg term in (3.4)
m g
and c  v0  v . In this case we find the solution:
 
 t  t
(3.7) v  v0 e m
 mv g (e m
 1)
mv g
But again the velocity again approaches asymptotically to v   
.

3.2 Vertical motion with turbulent resistance in liquids and gasses


In general the equations of motion cannot be solved in two dimensions, mostly because of the non
linear -v2 term in the drag force, but they can actually be solved analytically for a vertical motion.

We shall look at a vertical motion of a spherical body in a


liquid or a gas, either falling, or moving upwards, as a
consequence of buoyancy.
The body is in all cases influenced by

1. The gravitational force. (Always directed downwards)


2. The buoyancy. (Always directed upwards)
3. The viscous resistance. (Always directed against the
velocity)

Whether the ball (bullet) sinks or moves upward depends


on whether the density of the ball is larger or smaller than
the density of the liquid (water) or gas (air).
For the viscous drag force, we shall apply the semi empiric
expression.

(3.8) Fvisc  12 cw Av 2

ρ is the density of the liquid/gas, A is the area of cross section of the body, v is the velocity, and cw
is the so called dimensionless form factor. For convenience we put: Fvisc  cv 2

An estimate of cw can be found in a standard table of physical constants, where one can also look
up the kinematic viscosity ν and the dynamic viscosity η.
The connection between the two viscosities is η = νρ.
vD
cw depends on the shape of the body, and the Reynold’s number is defined as: R  .

Where v in the numerator denotes the speed, and  i the denominator is the kinematic viscosity.
D is the linear extension of the body.
Second order differential equations 9

As we have already seen in section 3, the equations of motion can be solved, if we apply Stoke’s
law for the drag force Fstoke  6rv , but the result for bodies with a diameter larger than a few
centimetres and having a weight more than a 100 grams does not yield results in accordance with
experience.
If the body moves upwards, as a consequence of the buoyancy, it will be influenced by the
buoyancy, the gravity and the viscous resistance, the two latter having the same direction.

(3.9) Fres  FT  Fup  Fvisc  ma   mg  mv g  cv 2

In contrast, if the body sinks it is influenced by the same thee forces, but now the gravity and the
drag force have opposite directions.

(3.10) Fres  FT  Fop  Fvisc  ma   mg  mv g  cv 2

m is the mass of the body and mv is the mass of the displaced liquid according to Archimedes law.

3.2.1 Upward movement

dv mv  m c
(3.11) a  g  v2
dt m m

mv  m dv c
We put:   in (3.11), and the equation is simplified to: a  g  v 2 
m dt m

dv c 2
(3.12)  g (1  v )
dt gm

The equation can be solved in a usual manner by separating the variables v and t followed by doing
some integrals and rearranging the terms, but it is easier to notice that (tanh x)’ = 1 – tanh2 x
c
If we put: k 2  the equation takes the form.
gm
dv
(3.13)  g (1  (kv) 2 )
dt

And it is seen to have the solution

1
(3.14) v tanh( gkt )
k

Or, when the expressions for k and μ are reinserted.

(mv  m) g c(mv  m) g
(3.15) v tanh t
c m2

tanh approaches rather quickly asymptotic to 1, e.g. tanh(1) =0.76 og tanh(2) =0.96.
Second order differential equations 10

The end velocity is seen to be:

1 (mv  m) g
(3.16) v   ,
k c

dv
as can also be inferred directly by putting:  0 in (3.13) , implying:
dt
1
g (1  (kv) 2 )  0  v 
k

We may then apply the results to a beach ball, with a diameter of 0.30 m, and estimate how high it
will jump, when it is hold under water and released.
You may find the form factor in a table of physical constants, and for a ball it is: cw = 0.2.
For the ball in consideration it gives the value c = 7.07 kg/m, in the formula: Fvisc  12 cw Av 2  cv 2 .

If we in the formula for the velocity:

( mv  m ) g c(mv  m) g
v tanh t
c m2

c ( mv  m ) g
solve the equation t  2 , corresponding to 96% of the end velocity, we se that the
m2
ball will reach this value in fractions of a second, so we may safely use the end velocity in the
calculations.
(mv  m) g
vend   4.4 m / s .
c

So when a beach ball is held under water and released, the calculations show that i twill jump to:

v2
h  0.98 m
2g

For a ping pong ball with a radius 2 cm, and the mass 3.0 g the calculations goes as follows:
vD 4  0,04
The Reynold’s number: R    1.6 107 gives the form factor cw = 0.2
 1.0  10 6

A = π (0.02)2 m2 = 1.26 10-3 m2 , ρ = 103 kg/m3 .


c  12 cw A  0.1∙ 103 ∙ 1.26 10-3 kg/m = 0.126 g/m. mv  43 r 3   0.0335 kg , which gives the end
velocity:
(mv  m) g 0.0305  9.82
v  m / s  1.54 m / s
c 0.126
v2
With this velocity the ping pong ball will, however, only jump: h   0.12 m
2g
Second order differential equations 11

3.2.2 Downward movement:


We shall look into the case of a body sinking in water. The equation of motion is.

(3.17) Fres  FT  Fop  Fvisc  ma   mg  mv g  cv 2

The difference from above is, that the density of the body is larger than the density of water, so that
m > mv i.e. the mass of the body is larger than the mass of the displaced water.
The equations of motion are otherwise the same, apart from a minus sign. The acceleration is:

dv mv  m c m  mv c
a  g  v2   g  v2
dt m m m m
m  mv
We put:   .
m
dv c dv c 2
(3.18) a   g  v 2    g (1  v )
dt m dt gm

And we get the same solution as in (3.15), apart from a change in sign.

c
As before we put: k 2  , which gives the equation:
gm

dv
(3.19)   g (1  (kv) 2 )
dt
Having the solution:
1 (m  mv ) g c(mv  m) g
v   tanh( gkt )  v tanh t
k c m2

If we for example look at an iron ball with radius 5 cm , and density ρ =7.8 103 kg/m3,
the constant c  12 cw A  0.79 (SI-units), mv =ρwater Vball = 1.0 103 ∙4/3(5 10-2)3 kg = 0.524 kg,
m =ρiron Vball = 7.8 103 4/3(5 10-2)3 kg = 4,1 kg. From which we get the end velocity.

(m  mv ) g
v    6,7 m / s  24 km / h
c

3.2.3 Vertical motion in air


For motion of a body in air, we need not to be concerned with the buoyancy, since it is vanishing
compared to the gravity and drag forces. The equations of motion are therefore.

Upward: Fres  FT  Fluft  ma   mg  cv 2


(3.20)
Downward: Fres  FT  Fluft  ma   mg  cv 2

First we solve for the upward movement:


Second order differential equations 12

dv c dv c 2
a  g  v2    g (1  v )
dt m dt mg

c
Setting k  gives:
mg
dv
(3.21)   g (1  (kv) 2 )
dt

As mentioned earlier, (3.21) can be solved by separating the variables followed by integration, but it
is easier to notice that (tan x)’ =1+tan2x, (which correspond to the right hand side), and then try
with a parametized solution:

v   a tan bt
Differentiating we find:

dv
  a (1  tan 2 bt )b
dt

dv
Which we compare this to:   g (1  (kv) 2 )
dt
we see that
1
tan bt  v  tan bt
k
so
1
a and consequently ab   g  b  kg .
k
The solution then becomes:

1
(3.22) v  v0   tan(kgt )
k
c
where k and c  12 c w A
mg

If kgt << 1 then tan(kgt)  kgt, and the formula goes into v = v0 – gt, as it should.

If we have a ball with radius r = 0.05 m and mass m = 250 g, c = 2.0 10-3 kg/m and k = 0.0285 s/m,
And if the ball has an initial velocity 5,0 m/s, we can determine the max height, by solving the
equation
v = 0  tan gkt  kv0 , which gives: t =0.51 s.
If we want to find the max height, we must integrate (3.22) to give

1
(3.23) s  s0   ln(cos( gkt ))
k 2g
Second order differential equations 13

When we calculate the distance, with v0 = 5.0 m/s, it is only a correction on the second decimal
compared to a vertical throw without air resistance.

We shall then deal with a free fall with air resistance.

Fres  FT  Fluft  ma   mg  cv 2 

dv c dv c 2 dv
 g  v2    g (1  v )    g (1  (kv) 2 )
dt m dt mg dt
c
Where we have put: k 2  .
mg
The last equation has the same solution as (3.15) and (3.19).

1
(3.24) v   tanh( gkt )
k
1 mg
With the end velocity v     .
k c

Inserting c = 8.1 10-3, corresponding to a ball with radius r = 0.10 m, and density 1.0 103 kg/m3, we
find: vend =226 m/s.
1
The distance completed can be calculated by integrating (3.24) to give: s  s0  2 ln(cosh( gkt )
gk
The end velocity occurs when: gkt =2, which gives: t = 1/gk = 46 s, and this corresponds to the
distance: s – s0 = 5200 m.

I will not be held responsible, whether these results are in accordance with reality. Firstly the v2
dependence is not necessarily correct, and the form factor is only fixed by a factor of 2.

4. The motion of a projectile


We next consider the trajectory of a projectile, fired at an angle θ, and the initial speed v0.
First we shall review the trajectory for motion of a particle in the gravitational field near the surface
of the earth. The projectile is thought to move in the x –y plane only influenced by gravity, so the
equation of motion is:

4.1 The motion of a projectile without drag

    0    v cos 
(4.1) Fres  mg , where g    and v0   0  (The initial velocity)
 g   v0 sin  

The motion is with constant acceleration, and the solution is:


      
(4.2) v  at  v0 and r  12 at 2  v0t  r0
Second order differential equations 14

 0
If we put r0    it is found by straightforward insertion:
0
  v x   v 0 cos     x   v0 cos t 
(4.3) v       and r      
2
v
  
y v 0 sin   gt  y
   0 v sin  t  1
2
gt 

v0 sin 
The max height of the trajectory can be found by putting vy = 0  t and inserting in y,
g
(v0 sin  ) 2
gives: ymax 
2g

The width (in the x direction) of the trajectory, can be found by setting

2v0 sin 
y0  v0 sin  t  12 gt 2  0  t0  t
g

The maximum width (length of the throw), is then determined by inserting the second value for t
into the expression for x(t). The result it can be reduced to:

v0 sin 2
2
(4.4) xmax 
g

The longest throw is obtained when sin 2  1    450 , as is well known from elementary
physics.
The trajectory is a parabola, by the way, since eliminating t en the expression for x and y leads to:

1
g
y  x tan   2
x2
(v0 cos ) 2

4.2 The motion of a projectile with drag (air resistance)


We shall now consider the same motion as above, in the gravitational field of the earth, but this time
paying to the inevitable resistance caused by the air.
Here we shall however only be concerned with laminar flow, with is the same as saying that the
drag force is proportional to and directed opposite to the velocity.
For motion in the air, this is hardly applicable if the speed exceeds about 5.0 m/s, where the flow
becomes turbulent, and the equations of motion do not have an analytic solution.

With turbulent flow, the drag force can empirically be represented by Fdrag = vβ , where 1    2 .
But we shall preliminary only be concerned with laminar flow.
When the motion takes place in gasses, we can safely discard the buoyancy. So in that case:
  
(4.5) Fdrag   | v | and Fdrag  v .

The equation of motion becomes:


Second order differential equations 15


dv  
 g v 
(4.6) dt m
dv x  dv y 
  vx   g  vy
dt m dt m

The differential equation (4.1) separates with respect to the x-direction and the y-direction.
But we have already solved such an equation for a linear motion in (3.2) to (3.5).

If the initial velocity is v  (v0 cos , v0 sin  ) , we can simply copy the solution from (3.5).

  
 t  t mg  t
(4.7) vx  v0 cos  e m
and v y  v0 sin   e m
 (1  e m
)


If  t << 1, that is, if the resistance of the air is small, we may apply the approximation e x  1  x
m

 t
to the factor e m
to obtain.

  mg 
vx  v0 cos  (1   t) and v y  v0 sin   (1   t)  (1  (1   t) )
m m  m

Dropping all terms proportional to α, we retrieve the formulas (4.3) for the motion without drag.

(4.8) vx  v0 cos  og v y  v0 sin   g  t

We may also find the position x(t ), y (t )) , by integrating (4.7) with respect to t.
Choosing (x0, y0) = (0,0), we get:
t  t  t 
 t  t mg  t
x  v0 cos  e dt and
m
y  v0 sin   e dt 
m
 (1  e m )dt
0 0
 0

  
m  t m  t mg m  t
(4.9) x  v0 cos  (1  e m
) and y  v0 sin   (1  e m
) (t   (1  e m
))
   

 
Again if t << 1, we may apply the approximation e x  1  x  12 x 2 with x  
t .
m m
Dropping all terms, proportional to α, we retrieve the former expressions (4.3), derived without
resistance.

x  v0 cos   t og y  v0 sin   t  ½ g  t 2

Neither (4.8) nor (4.9) are particular transparent, when determining the maximum height or the
width of the throw. It is actually possible to determine ymax, but we cannot determine xmax, since the
equation y = 0 is transcendent.
In a later section we shall however look at numerical solutions to differential equations.
Second order differential equations 16

As mentioned, the equation of motion for a projectile can not be soved when assuming turbulent
flow i.e when the drag force is proportional to v2, Fdrag = α v2 . Below is shown a numerical solution
with: α = 0 (no air resistance ) , α = 0.0001, α = 0.0005, α = 0.001.

5. Damped harmonic oscillations


An harmonic oscilllation is a linear movement (along an axis), where the resulting force is always
directed against and proportional to the distance to the position of equilibrium.
If the motion is along the x – axis, then the equation of motion is:

d 2x d 2x k
(5.1) Fres   k  x  m 2   kx  2
 x
dt dt m
k
If we put   (the cyclic frequency), then the equation becomes:
m
d 2x
(5.2) 2
  2 x
dt
Which has the familiar solution:

(5.2) x  A cos(  t   0 )

A is the amplitude, ω is the cyclic frequency, and φ0 is the initial phase.

2 m
The period is T  T  2 .
 k

In the Math classroom, one usually writes the solution in a slightly different way:

(5.3) x  c1 cos  t  c2 sin  t

That this is actually the same solution, one may realize, by applying one of the addition formula,
mentioned earlier:
Second order differential equations 17

cos(u  v)  cos u cos v  sin u sin v


to the solution (5.2).

x  A cos(  t   0 )  A cos( 0 ) cos(  t )  A sin( 0 ) sin(  t )

c2
If we put c1  A cos(0 ) and c2   A sin(0 ) , having the solutions: tan 0  
2 2
, A  c1  c2
c1
We regain the solution (5.2).
If there is friction or viscous forces (drag forces), another term has to be added to (5.1). We shall
first assume that the drag force is proportional to the velocity, and directed opposite to the velocity.

The coefficient of proportionality depends on the shape of the body, and the nature of the medium
(air, liquid) the body moves in.
dx
(5.4) Fvisc  v  Fvisc   .
dt

Hereafter the differential equation for the damped harmonic oscillator becomes.

Fres   k  x  Fvisc 
2
d x dx
(5.5) m 2
   kx 
dt dt
d 2 x  dx k
  x0
dt 2 m dt m

It is however associated with a bit more ingenuity to solve (5.5), than to solve (5.1).
First we simplify the equation a bit, with the aim of having lesser constants.

d 2x dx
(5.6) 2
b cx  0
dt dt

 k
Where we have put b  og c
m m

(5.6) is now a 2. order linear homogenous differential equation with the two constants b and c.
It is linear, because all terms containing x appears in first order, and homogenous, because there are
no terms which depend explicit on t.

5.1 Solution to the differential equation using complex numbers.


The solution of linearly homogenous differential equations with constant coefficients, can always
be reduces to finding the complex roots in the characteristic polynomial of the same order as the
differential equation
To solve (5.6), we put x  e zt where z is a complex number to be determined. It then follows:
Second order differential equations 18

dx d 2x
 z  e zt og  z 2  e zt
dt dt 2

Inserting in (5.6) and dividing by e zt , we get a complex quadratic equation:

z2  b z  c  0

The discriminant is: d  b 2  4  c . The discriminant is real, so if d > 0 then quadratic equation has
two real solutions.
b b2  4  c b b2  4  c
(5.7) z   z 
2 2 2 2

Returning to the original equation, we notice that b >0 and c = k/m > 0, so both solutions (5.7) are
negative. The case d = 0 reduces to one solution.

If d < 0 then the quadratic equation has no real solutions, but rather two complex solutions.

b 4  c  b2 b 4  c  b2
(5.8) z   i  z i
2 2 2 2

Here i is the complex unit. i2=-1.

In the theory of complex numbers one of the most important formulas is Eulers formula.
Actually one of the most important formulas in the mathematical analysis at all.
If z  x  i  y is a complex number, where x and y are real, Euler’s formula reads:

(5.9) e z  e x iy  e x eiy  e x (cos y  i sin y )

We are only interested in the real part of the solution – naturally!


Futhermore, we notice that when we made the substitution x  e zt , we might as well have written
x  Ae zt i0 , having two integration constants. necessary for the complete solution of a second order
differential equation.
b
 t

x(t )  Ae cos(t  0 )
2
(5.10)

What we see is that the solution is a harmonic oscillation, but with an amplitude which decreases
exponentially with time. This is called damped harmonic oscillations.
 k
If the original values for the constants for b and c: b  and c  , are substituted back, we
m m
k 2
get    . Inserted in (5.10) gives:
m 4m 2


 t k 2
(5.11) x(t )  Ae 2m
cos(   t  0 )
m 4m 2
Second order differential equations 19

 is the coefficient of viscosity, defined by the equation: Fvisc = -α·v, and k is "constant of the
spring".
The condition for the validity of the solution (5.11) is that the expression under the square root is
positive. Otherwise the oscillating system will never perform one period, and the system will
approach the equilibrium exponentially.

5.2 Traditional solution of the same differential equation


We shall again look at the differential equation

d 2 x  dx k
(5.12)   x0
dt 2 m dt m

For convenience, as above, we make some abbreviation.

d 2x dx  k
(5.13) 2
b cx  0 , hvor b  og c
dt dt m m

We solved earlier the equation by resorting to complex numbers, but here we shall apply a more
traditional method, resembling the method used to solve a general linear first order equations.

The method is to introduce an aiding function, equipped to rewrite the differential equation to one,
we can solve, that is, the equation for the harmonic oscillator.

d2y d2y k d2y


(5.14) m   ky   y0   2 y  0
dt 2 dt 2 m dt 2

Having the solution:


(5.15) y  A cos t  0 

To obtain this we have put y = x e  t , where x refers to the solution to the original differential
equation (5.13)
d 2 ( xe  t )
(5.16) 2
  2 xe  t  0
dt
By a suitable choice of β and  2 , we hope to make (5.16) have the same form as (5.13)

d 2 ( xe  t ) d dx  t  t d 2 x  t dx  t dx  t
 ( e  x e )  e   e   e  x 2e  t
dt 2 dt dt dt 2 dt dt

d 2 ( x e  t ) d 2 x   t dx
2
 2 e  2 e  t  x 2e  t
dt dt dt

We add the term  2 xe  t to the second derivative of xe  t and put the result to 0.
Second order differential equations 20

d 2 ( xe  t )
(5.17)   2 xe  t  0 
dt 2

d 2 x  t dx
2
e  2 e  t  x 2e  t   2 xe  t  0
dt dt

The equation is simplifying by diving by e  t .

d 2x dx
(5.18) 2
 2   ( 2   2 )  0
dt dt

We then compare (5.18) with the original differential equation:

d 2x dx
(5.19) 2
 b  c  x  0
dt dt

And we see that the two differential equations are identical if and only if:

b  b2 k 2
  and  2  2  c  2  c   2   .
2 2m 4 m 4m

However, we can solve (5.17) directly. If we put y  x  e  t , the equation takes the form:

d2y
(5.20) 2
  2 y
dt

y  A cos(t   0 )
and so we find:

(5.21) y  x  e  t  A cos(t  0 )  x  A  e   t cos(t  0 )

 k 2
Inserting the constants:   and  2   we arrive at the solution to (5.12)
2m m 4m


 t k 2
(5.22) x(t )  Ae 2m
cos(   t  0 ) .
m 4m 2

The solution is a harmonic oscillation with an exponential decreasing amplitude.

Below is shown an example of a solution, where the exponential envelope curve is also shown.
Second order differential equations 21

Damped harmonic oscillations turn up in many fields of physics, and therefore it is not without
interest to be able to solve the associated differential equations.

6. Forced harmonic oscillations without damping


We shall consider a forced oscillation without damping, where the mass m, besides the “spring
force” i.e. obeys Hookes law – kx , is driven by an external time dependent force f(t).
The results are directly applicable to an electrical circuit consisting of a capacitor and a coil, and
driven by an alternating current.

Fres   k  x  Fext 

d 2x
(6.1) m   kx  Fext (t ) 
dt 2

d 2x k F (t )
2
 x  ext
dt m m

Fext (t ) f 0 it
We shall assume that the external force varies harmonically:  e .
m m
The solution to (6.1) is (as well known from the theory of differential equations) a particular
solution to the non homogeneous equation plus the complete solution to the corresponding
homogeneous equation:
Second order differential equations 22

d 2x k
(6.2)  x0
dt 2 m
Which has the solution:
k
x  A cos(0t   ) where 0 
m
Since the differential equation

d 2x k f d 2x f
 x  0 e it   0 x  0 e it
2
(6.3) 2
 2
dt m m dt m

is of second order with constant coefficients, we may write a particular solution as: x  Aeit
(where ω is the enforced frequency), when inserted in (6.3) gives:

f 0 it
  2 Ae it  0 Ae it 
2
(6.4) e ,
m
f0
When solved with respect to A gives: A  2 m 2
0  

The complete solution to (6.3) can thereafter be written as the particular solution plus the solution to
the homogeneous equation:
f0
(6.5) x  A0 cos(0t   )  2 m 2 cos( t )
0  

Writing this as: x = A·cos(ω0t+φ)+ B·cos(ωt), we can in the case where A = B apply the first of the
logarithmic formulas for addition of two cosine functions:

uv uv uv u v


cos u  cos v  2 cos cos og cos u  cos v  2 sin sin
2 2 2 2

0   0  
(6.6) x  2 A cos( t  ½ ) cos( t  ½ )
2 2
0  
The system will perform oscillations with a frequency with an amplitude
2
0  
2 A cos( t  ½ ) , which is time dependent and varies between the values -2A and 2A.
2
A phenomena which is familiar for sound waves, and goes under the name modulation and beats.
 
The beat frequency is 0 , and when 0    0 the signal will sound like a sirene.
2
In general the two amplitudes A and B are not equal, but it changes only the situation in the sense
that the signal will have two beat frequencies instead of one.
We may namely always determine two numbers C and D, so that A = C+D and B = C - D , and
solve for C and D:
Second order differential equations 23

A B A B
C og D
2 2

A·cos(ω0t+φ)+ B·cos(ωt)=(C+D)cos (ω0t+φ)+ (C-D) cos(ωt) =

C·cos (ω0t+φ)+ C·cos(ωt)+ D·cos (ω0t+φ)- D·cos(ωt)

Rewiting the solution by the logarithmic formulas then gives:

0   0   0   0  
(6.6) x  2C cos( t  ½ ) cos( t  ½ )  2 D sin( t  ½ ) sin(
t  ½ )
2 2 2 2
The result is two modulations with the same frequency, but where the amplitudes (the beats) are

2
out of phase.
Numerical solutions to differential equations 24

7. Numerical solution to differential equations


It is actually the fewer differential equations in physics, which have an analytical solution.
Analytical means that the solution is given by mathematical expressions that describes the position
and velocity at any time t.
The mathematical discipline which deals with numerical, that is, step by step solutions to problems
is called numerical analysis.
Theoretically numerically analysis covers a large area of methods, and in contras to what one may
think it is developed long before the invention of computers.

However, one should not diminish the importance of analytical solutions, even if the small
mathematics computers, which has already been in use in high schools for almost ten years now
(2016) are able to do differentiation, evaluate integrals and solve differential equations
analytically, that my generation had to do by hand.
But of course the computers can do no more, than (some of us) could do by hand.

The alternative to analytical solutions are numerical solutions, where one roughly speaking
replaces infinitesimal entities dx and dy by small changes Δx, Δt, differential quotients dx by
dt
x
and integrals  f (t ) dt , by sums  f ( ti )ti
t
But the theory of numerical analysis relies heavily on analytic methods of course!

7.1 Taylor’s formula


We shall begin by looking at numerical solution to first order differential equations.
When doing things numerically, it is imperative to be able to estimate the accuracy.
To do so, it is strictly necessary to be familiar with Taylor’s formula. The formula can be written
in numerous ways, but we shall apply the one where a real function y = f(x) is developed around a
point x0, and h is (a small) increment to x0. Under fairly general circumstances the formula can be
written:

h ( n 1)
( 3) ( n)
( x0  t ) n
(7.1) f ( x0  h)  f ( x0 )  f ' ( x0 ) h  f ' ' ( x0 ) h 2  f ( x0 ) h 3  ...  f ( x0 ) h n   f t dt
1! 2! 3! n! 0
n!

The last term (the rest term) is seen to be proportional to hn+1, which we write as O(hn)h, where the
symbol O(hn) is to be read as "order of hn ". If we omit the rest term, we get an approximation to
f(x0+h). Depending how many terms we include, we get an 0'th, 1., 2., order approximation.

f ( x0  h )  f ( x0 )  O ( h 0 ) h
f ( x 0  h)  f ( x0 )

(7.2) f ( x 0  h)  f ( x0 )  f ' ( x 0 ) h  O ( h) h
f ( x 0  h)  f ( x0 )  f ' ( x0 ) h

1
(7.3) f ( x 0  h)  f ( x0 )  f ' ( x0 ) h  2 f ' ' ( x0 ) h 2  O ( h 2 ) h
1
f ( x0  h )  f ( x0 )  f ' ( x0 ) h  2 f ' ' ( x0 ) h 2
Numerical solutions to differential equations 25

1 1
(7.4) f ( x 0  h)  f ( x0 )  f ' ( x0 ) h  2 f ' ' ( x 0 ) h 2  6 f ( 3) ( x0 ) h 3  O ( h 3 ) h
1 1
f ( x 0  h )  f ( x 0 )  f ' ( x 0 ) h  2 f ' ' ( x 0 ) h 2  6 f ( 3) ( x 0 ) h 3

7.2 Numerical solution to first order differential equations


If we wish to solve the firs order equation
dy
(7.5)  f ' ( x )  g ( x, y )
dx
Where we know the initial value ( x0 , y0 ) , then it can be done by applying (7.1), since:

(7.6) f ( x0  h)  f ( x0 )  f ' ( x0 )h  y0  g ( x0 , y0 )h

Where f ( x0  h) is calculated with an accuracy of order h2.

(x1, y1) = (x0+h, f(x0+h)) = (x0+h, f(x0)+ f’(x0)h) =(x1, y0+g(x0, y0))

The new value can thereafter be used to calculate:

(x2, y2) = (x1+h, f(x1+h)) = (x1+h, f(x1)+f’(x1)h) =(x1+h, y1+g(x1, y1) h)

and so on. The method is called Euler integration.


Euler’s formula is however hardly ever used, because the errors accumulate, especially when f''(x)
is constant. To obtain a better approximation, one may use Aitken’s formula:

h h
f ( x0  2 )  f ( x0  2 ) h h
(7.5) f ' ( x0 )   f ( x 0  2 )  f ( x0  2 )  f ' ( x0 ) h
h

h h
Expanding f ( x0  2 )  f ( x0  2 ) by Taylor’s formula, we find this time:

h h h 1 h2 h 1 h2
f ( x 0  2 )  f ( x0  2 )  f ( x 0 )  f ' ( x0 ) 2  2 f ' ' ( x 0 ) 4
 ( f ( x0 )  f ' ( x0 )( 2 )  2 f ' ' ( x0 ) 4
)  O(h 2 )h

h h
(7.6) f ( x0  2 )  f ( x0  2 )  f ' ( x0 ) h  O ( h 2 ) h

As it is seen this formula is correct until order h3 , in contrast to Euler’s h2 approximation, but
using the same first order derivatives.
1 1
If h  10 , then is the correction (the error) of order h 3  1000 i stead of the Euler integration, where
1
the correction is of order h 2  100 . Otherwise the procedure is the same as the Euler integration,
h
apart from the initial step, where one must calculate f ( x0  ) , by Euler’s method.
2
Numerical solutions to differential equations 26

h h h
(7.7) f ( x0  )  f ( x0  )  f ' ( x0 )h  f ( x0  )  g ( x0 , y0 )h
2 2 2

To scientific an practical purposes, one applies almost always the method of Runge-Kutta, which
is far more complicated to account for, than the methods described above. But it has the definite
advantage that the corrections (the errors) is of order h4.

You might also like