-
Solving the Harmonic Oscillator Equation
Morgan RootNCSU Department of Math
-
Spring-Mass SystemConsider a mass attached to a wall by means of a spring. Define y=0 to be the equilibrium position of the block. y(t) will be a measure of the displacement from this equilibrium at a given time. Take
. and )0( 0)0(
0 vyy dtdy ==
-
Basic Physical LawsNewton’s Second Law of motion states tells us that the acceleration of an object due to an applied force is in the direction of the force and inversely proportional to the mass being moved.This can be stated in the familiar form:
maFnet =In the one dimensional case this can be written as:
ymFnet &&=
-
Relevant ForcesHooke’s Law (k is called Hooke’sconstant)
Friction is a force that opposes motion. We assume a friction proportional to velocity.
kyFH −=
ycFF &−=
-
Harmonic OscillatorAssuming there are no other forces acting on the system we have what is known as a Harmonic Oscillator or also known as the Spring-Mass-Dashpot.
)()()(or
tyctkytym
FFF FHnet
&&& −−=
+=
-
Solving the Simple Harmonic System
0)()()( =++ tkytyctym &&&
If there is no friction, c=0, then we have an “UndampedSystem”, or a Simple Harmonic Oscillator. We will solve this first.
0)()( =+ tkytym &&
-
Simple Harmonic Oscillator
t)K( y(t)t) K(y(t)
tKyty
K mk
cos and sin
equation. thissolve that willfunctions least twoat know We
)()(:system
at thelook and can take that weNotice
==
−=
=
&&
-
Simple Harmonic Oscillator
. Where
)sin()cos()(
cos. andsin ofn combinatio linear a issolution general The
0
00
mk
tBtAty
=
+=
ω
ωω
-
Simple Harmonic Oscillator
( )0
000
0 1220
0
0
tan and )(
and where
)sin()(
assolution therewritecan We
vyv
mk
y
tty
ωω φ
ω
φω
−=+=Α
=
+Α=
-
Visualizing the System
0 2 4 6 8 10 12 14 16 18 20
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
Undamped SHO
Time
Dis
plac
emen
t
m=2c=0k=3
-
Alternate Method: The Characteristic Equation
0
:have eequation w theinto thisSubbing
)( and )(
.)( solution, lexponentiaan Assume
0)()(
:system at thelook and takeAgain we
20
2
2
20
0
=+
==⇒
=
=+
=
rtrt
rtrt
rt
mk
eer
ertyrety
ety
tyty
ω
ω
ω
&&&
&&
-
Alternate Method: The Characteristic Equation
00 )( and )(
solutions twohave weThus
thatrequire esolution w a have To
0
20
2
ωω
ω
ω
ii etyety
ir
r
−==
±=⇒
−=
-
Alternate Method: The Characteristic Equation
As before, any linear combination of solutions is a solution, giving the general solution:
titi eBeAty 00 **)( ωω −+=
-
Euler’s Identity
Recall that we have a relationship between e and sine and cosine, known as the Euler identity.Thus our two solutions are equivalent
( ) ( )
( ) ( )tite
tite
ti
ti
00
00
sincos
andsincos
0
0
ωω
ωω
ω
ω
−=
+=
−
-
Rewrite the solution
)sin()(
sine with one and
)(
lsexponentiacomplex with One
0
: tosolutions twohave now We
0
** 00
φω
ωω
+Α=
+=
=+
−
tty
eAeAty
ky(t)(t)ym
titi
&&
-
Damped SystemsIf friction is not zero then we cannot used the same solution. Again, we find the characteristic equation.
rtrt
rt
ertyrety
ety
2)( and )(
then,
)( Assume
==
=
&&&
-
Damped Systems
0
ifonly work can Which
0
have, we and ,in Subbing
0)()()(
:osolution tafor lookingnowarehat weRemember t
2
2
=++
=++
=++
KCrr
KeCreer
yyy
tKytyCty
rtrtrt
&&&
&&&
-
Damped Systems
dunderdampe 0 3.
damped critically 0 2.
overdamped 0 1.
options threehave We
4Let
where
: thatus gives This
20
2
024 20
2
<
=
>
−=
== −±−
α
α
α
ωα
ωω
C
r mkCC
-
Underdamped SystemsThe case that we are interested in is the underdamped system.
04 202
-
Underdamped Systems
ω
φ
ω
φω
020
2
and
),(tan ,
,2
4 Where
)sin()(
form, intuitive more ain thisrewritecan We
0
122
2
yv
BA
t
mc
mc
ByA
BA
mcmk
tety
+
−
==
=+=Α
−=
+Α=−
-
Visualizing Underdamped Systems
0 2 4 6 8 10 12 14 16 18 20-1.5
-1
-0.5
0
0.5
1
1.5
2Underdamped System
Time
Dis
plac
emen
t
m=2c=0.5k=3
-
Visualizing Underdamped Systems
0 2 4 6 8 10 12 14 16 18 20-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
Time
Dis
plac
emen
tUnderdamped Harmonic Oscillator
y(t)=Ae-(c/2m)t
y(t)=-Ae-(c/2m)t
m=2c=0.5k=3
-
Visualizing Underdamped Systems
0 2 4 6 8 10 12 14 16 18 20-0.5
0
0.5
1
1.5
2Another Underdamped System
Time
Dis
plac
emen
t
m=2c=2k=3
-
Visualizing Underdamped Systems
0 2 4 6 8 10 12 14 16 18 20-2.5
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
2.5
Time
Dis
plac
emen
t
y(t)=Ae-(c/2m)t
y(t)=-Ae-(c/2m)t
m=2c=2k=3
Underdamped Harmonic Oscillator
-
Will this work for the beam?The beam seems to fit the harmonic conditions.
Force is zero when displacement is zeroRestoring force increases with displacementVibration appears periodic
The key assumptions areRestoring force is linear in displacementFriction is linear in velocity
-
Writing as a First Order System
Matlab does not work with second order equationsHowever, we can always rewrite a second order ODE as a system of first order equationsWe can then have Matlab find a numerical solution to this system
-
Writing as a First Order System
)()()(and
)()( Clearly,
).()( and )()(let can We)0( and )0( with ,0)()()(
ODEorder second Given this
212
21
21
00
tCztKztz
tztz
tytztytzvyyytKytyCty
−−=
=
=====++
&
&
&
&&&&
-
Writing as a First Order System
Matlab.in work that willform ain now is This
with
10 where
or
)(10
)(
formvector -matrixin equation therewritecan weNow
0
0
2
1
2
1
⎥⎦
⎤⎢⎣
⎡=
⎥⎦
⎤⎢⎣
⎡−−
=
⎥⎦
⎤⎢⎣
⎡⎥⎦
⎤⎢⎣
⎡−−
=⎥⎦
⎤⎢⎣
⎡
=
vy
CK
tzz
CKt
zz
z(0)
A Az(t)z(t)
&
&
-
Constants Are Not IndependentNotice that in all our solutions we never have c, m, or k alone. We always have c/m or k/m.The solution for y(t) given (m,c,k) is the same as y(t) given (αm, αc, αk).Very important for the inverse problem
-
SummaryWe can used Matlab to generate solutions to the harmonic oscillatorAt first glance, it seems reasonable to model a vibrating beamWe don’t know the values of m, c, or kNeed the inverse problem