SlideShare a Scribd company logo
Solving and visualizing the motion of a Harmonic Oscillator
Harmonicoscillationiseverywhere inphysics.Itisprobablythe simplestandmostimportantphysical
system. Learningthe basicsof harmonicoscillationisaquantumleapto understandinga whole lotof
systemsfrommechanics,electronics,andoptics.Thiscomputational projectisafast tract explorationof
the propertiesof drivenharmonicoscillation.
Simple Harmonic Oscillator
The motionof a simple harmonicoscillatorisgovernedbythe equation
𝑚𝑥̈ = −𝑘𝑥
The motionof the oscillator(solutiontothe equationof motion) canbe writtenas
𝑥( 𝑡) = 𝐴 cos(𝜔𝑡 + 𝜙), 𝜔2 = 𝑘/𝑚
where the constants 𝐴,and 𝜙 dependsonthe initial conditions.
Usingan ODE solverinMATLAB, usingtwodifferentinitialconditions{𝑥(0) = 0, 𝑥̇(0) = 1} and
{ 𝑥(0) = 1, 𝑥̇(0) = 0}, do the following
1. Plotthe positionandvelocityasafunctionof time
2. Plotthe potential,kinetic,andtotal energyasafunctionof time
3. Plotthe phase space (i.e.positionvsmomentum),set 𝑚 = 1
4. Describe whathappenstothe plotswhenyouvary 𝜔.
To have a betterfeel the problem, trydifferentconditions andparameters.
Damped harmonic oscillator
Whenthere isfrictionor anylossof energyina harmonicmotion, the motionisdescribedby
𝑥̈ + 2𝛽𝑥̇ + 𝜔0
2
𝑥 = 0
where 𝛽 isthe dampingconstant,and 𝜔0 isthe natural frequency.Usingthe ODEsolverinMATLAB,do
the same plotsas before forinitial conditions {𝑥(0) = 0, 𝑥̇(0) = 1},when 𝛽 < 𝜔0, 𝛽 = 𝜔0,and 𝛽 > 𝜔0.
Describe the effectof damping inthe three differentregimes. Playwiththe parameterstohave abetter
feel of the problem.
Driven dampedoscillator
Whenthe oscillatorisdrivenbyan external force 𝐹(𝑡),the equationof motioncanbe writtenas
𝑥̈ + 2𝛽𝑥̇ + 𝜔0
2
𝑥 = 𝑓(𝑡)
There are infinitelydifferentwaystodrive the system. The mostcommonwaytodo it iswitha wavelike
force,say sinusoidalforce of the form
𝑓( 𝑡) = 𝑓𝑑 cos 𝜔 𝑑 𝑡
where 𝑓𝑑 isthe drivingamplitudeand 𝜔 𝑑 isthe drivingfrequency.Now, considerthe case when the
oscillatorstartsstationaryat 𝑥 = 1.
Solve forthe equation forthe followingparameters 𝑓𝑑 = 100, 𝜔0 = 1 𝛽 = 𝜔0/30, and 𝜔 𝑑 =
𝜔0/5. On equal time axis,plotthe positionandthe drivingforce side byside.Show atleastleast 6cycles
of the drivingforce.Youshouldget somethinglike this)
Include athirdplot forthe positionof the same oscillatorbutwithnodrivingforce. The initial
oscillationsare called transientswhichdisappearsafterafew cycles andthe eventual oscillationiscalled
an attractor.
While keepingotherparametersconstant,describethe effectof the followingonthe transientsand
attractor (amplitude andphase):
1. Initial condition(positionandvelocity)
2. Dampingconstant 𝛽 from 𝛽 < 𝜔0 to 𝛽 > 𝜔0
3. Drivingfrequency 𝜔 𝑑 from 𝜔 𝑑 < 𝜔0 to 𝜔 𝑑 > 𝜔0
Showthat the amplitude 𝐴 andphase shift 𝛿 of the attractor follow thisequation
(
𝐴
𝑓𝑑
)
2
=
1
( 𝜔0
2
− 𝜔 𝑑
2) + (2𝜔 𝑑 𝛽)2, 𝛿 = arctan (
2𝛽𝜔 𝑑
𝜔0
2
− 𝜔 𝑑
2 )
To showthis,keepotherparametersconstantandplotthe analytical curve above withthe one from
theorytogether.Youshouldgetsomethinglike this for 𝐴 vs 𝜔0.
The amplitude ismaximumwhen 𝜔 𝑑 = 𝜔0,whichiscalled resonance.Thatis,the oscillatorabsorbs
maximumenergywhenthe natural frequencyof the oscillatoristhe same asthe drivingfrequency.
You can try differentdrivingforces,notjustsinusoidal ones.
Reference:
1. For more on the analytical side of the harmonicoscillator,consultthe book ClassicalMechanics
by John Taylor.Chapter5 is dedicatedforharmonicoscillations. Figuresinthispaperistaken
fromthat chapter.

More Related Content

PPTX
Postulates of quantum mechanics & operators
PPTX
Harmonic Oscillator
PPTX
Chemical Bonding
PPTX
Postulates of quantum mechanics
PDF
Operators n dirac in qm
PPTX
The time independent Schrödinger wave equation
PPT
Simple Harmonic Motion
PPTX
Perturbation
Postulates of quantum mechanics & operators
Harmonic Oscillator
Chemical Bonding
Postulates of quantum mechanics
Operators n dirac in qm
The time independent Schrödinger wave equation
Simple Harmonic Motion
Perturbation

What's hot (20)

PDF
Schrodinger eqn
PPT
PPTX
Small amplitude oscillations
PPTX
Physics lo6
PPTX
Standing Waves LO
PPTX
Introduction to perturbation theory, part-1
PPTX
Quick run through on classical mechancis and quantum mechanics
PPTX
PPT
Structure Design-I (Moments)
PPTX
Physics Learning Object 6
PPT
Equation of motion of a variable mass system2
PDF
Geometry of Continuous Time Markov Chains
PPTX
Equilibrium, Energy and Rayleigh’s Method
PPTX
Fundamentals of statics
PDF
Postulates of quantum mechanics
PPT
MECHANICS OF SOLID
DOCX
Important Notes - JEE - Physics - Simple Harmonic Motion
PDF
Lit review-Thomas Acton
PPT
Equation of motion of a variable mass system1
PDF
Instantons in 1D QM
Schrodinger eqn
Small amplitude oscillations
Physics lo6
Standing Waves LO
Introduction to perturbation theory, part-1
Quick run through on classical mechancis and quantum mechanics
Structure Design-I (Moments)
Physics Learning Object 6
Equation of motion of a variable mass system2
Geometry of Continuous Time Markov Chains
Equilibrium, Energy and Rayleigh’s Method
Fundamentals of statics
Postulates of quantum mechanics
MECHANICS OF SOLID
Important Notes - JEE - Physics - Simple Harmonic Motion
Lit review-Thomas Acton
Equation of motion of a variable mass system1
Instantons in 1D QM
Ad

Viewers also liked (13)

PPTX
Crisis and Challenge in AMerican Legal Educaton
DOCX
Jahnaproject
DOCX
GMOs-Not Too Bad..
PDF
Franchesca Velasquez Resume
PPTX
Social Media For All
PDF
Etudeutilisateursfacebookenafrique2016 160126153026
PPTX
Camera angles improved version
DOCX
Recommendation Letter K Coffee
DOCX
Bilde2
PPTX
Refactoring to a SPA
PDF
FINAL Agenda EU refining forum 010316
PDF
Portugal tourism
Crisis and Challenge in AMerican Legal Educaton
Jahnaproject
GMOs-Not Too Bad..
Franchesca Velasquez Resume
Social Media For All
Etudeutilisateursfacebookenafrique2016 160126153026
Camera angles improved version
Recommendation Letter K Coffee
Bilde2
Refactoring to a SPA
FINAL Agenda EU refining forum 010316
Portugal tourism
Ad

Similar to Cp project-1-chaotic-pendulum (20)

PPSX
1. Oscillation engineering physics .ppsx
PDF
unit-4 wave optics new_unit 5 physic.pdf
PPTX
Chapter 1A (1).pptx
DOCX
Harmonic Oscillator Paper
DOCX
Module-1 Review of Semiconductor Physics
PPTX
Simple harmonic motion
PPTX
Free vibration
PDF
ADS & B.Sc Waves and Oscillations (Home of Physics).pdf
PPT
Ch 1-3.ppt
PDF
Oscillations 2008 prelim_questions
PPT
Driven Oscillation
PPTX
Simple Harmonic Motion
PPTX
Module-1-2.pptx
PPT
Oscillations
PPTX
Simple harmonic oscillator
DOCX
Phase, Pendulums, & Damping An investigation into swingers .docx
PPT
Dynamic response to harmonic excitation
PDF
Final m1 march 2019
PDF
The Guide on How Damped Harmonic Oscillations effect the tides
PDF
General Physics (Phys1011)_Chapter_5.pdf
1. Oscillation engineering physics .ppsx
unit-4 wave optics new_unit 5 physic.pdf
Chapter 1A (1).pptx
Harmonic Oscillator Paper
Module-1 Review of Semiconductor Physics
Simple harmonic motion
Free vibration
ADS & B.Sc Waves and Oscillations (Home of Physics).pdf
Ch 1-3.ppt
Oscillations 2008 prelim_questions
Driven Oscillation
Simple Harmonic Motion
Module-1-2.pptx
Oscillations
Simple harmonic oscillator
Phase, Pendulums, & Damping An investigation into swingers .docx
Dynamic response to harmonic excitation
Final m1 march 2019
The Guide on How Damped Harmonic Oscillations effect the tides
General Physics (Phys1011)_Chapter_5.pdf

Recently uploaded (20)

PPTX
TOTAL hIP ARTHROPLASTY Presentation.pptx
PDF
Mastering Bioreactors and Media Sterilization: A Complete Guide to Sterile Fe...
PPTX
Taita Taveta Laboratory Technician Workshop Presentation.pptx
PPTX
7. General Toxicologyfor clinical phrmacy.pptx
PPT
protein biochemistry.ppt for university classes
PPTX
famous lake in india and its disturibution and importance
PDF
MIRIDeepImagingSurvey(MIDIS)oftheHubbleUltraDeepField
PPTX
The KM-GBF monitoring framework – status & key messages.pptx
PPTX
ANEMIA WITH LEUKOPENIA MDS 07_25.pptx htggtftgt fredrctvg
PDF
Phytochemical Investigation of Miliusa longipes.pdf
PDF
IFIT3 RNA-binding activity primores influenza A viruz infection and translati...
PPTX
2. Earth - The Living Planet earth and life
PPTX
G5Q1W8 PPT SCIENCE.pptx 2025-2026 GRADE 5
PPTX
cpcsea ppt.pptxssssssssssssssjjdjdndndddd
PDF
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
PDF
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
PPTX
Vitamins & Minerals: Complete Guide to Functions, Food Sources, Deficiency Si...
PDF
CAPERS-LRD-z9:AGas-enshroudedLittleRedDotHostingaBroad-lineActive GalacticNuc...
PPTX
Microbiology with diagram medical studies .pptx
PPTX
neck nodes and dissection types and lymph nodes levels
TOTAL hIP ARTHROPLASTY Presentation.pptx
Mastering Bioreactors and Media Sterilization: A Complete Guide to Sterile Fe...
Taita Taveta Laboratory Technician Workshop Presentation.pptx
7. General Toxicologyfor clinical phrmacy.pptx
protein biochemistry.ppt for university classes
famous lake in india and its disturibution and importance
MIRIDeepImagingSurvey(MIDIS)oftheHubbleUltraDeepField
The KM-GBF monitoring framework – status & key messages.pptx
ANEMIA WITH LEUKOPENIA MDS 07_25.pptx htggtftgt fredrctvg
Phytochemical Investigation of Miliusa longipes.pdf
IFIT3 RNA-binding activity primores influenza A viruz infection and translati...
2. Earth - The Living Planet earth and life
G5Q1W8 PPT SCIENCE.pptx 2025-2026 GRADE 5
cpcsea ppt.pptxssssssssssssssjjdjdndndddd
SEHH2274 Organic Chemistry Notes 1 Structure and Bonding.pdf
ELS_Q1_Module-11_Formation-of-Rock-Layers_v2.pdf
Vitamins & Minerals: Complete Guide to Functions, Food Sources, Deficiency Si...
CAPERS-LRD-z9:AGas-enshroudedLittleRedDotHostingaBroad-lineActive GalacticNuc...
Microbiology with diagram medical studies .pptx
neck nodes and dissection types and lymph nodes levels

Cp project-1-chaotic-pendulum

  • 1. Solving and visualizing the motion of a Harmonic Oscillator Harmonicoscillationiseverywhere inphysics.Itisprobablythe simplestandmostimportantphysical system. Learningthe basicsof harmonicoscillationisaquantumleapto understandinga whole lotof systemsfrommechanics,electronics,andoptics.Thiscomputational projectisafast tract explorationof the propertiesof drivenharmonicoscillation. Simple Harmonic Oscillator The motionof a simple harmonicoscillatorisgovernedbythe equation 𝑚𝑥̈ = −𝑘𝑥 The motionof the oscillator(solutiontothe equationof motion) canbe writtenas 𝑥( 𝑡) = 𝐴 cos(𝜔𝑡 + 𝜙), 𝜔2 = 𝑘/𝑚 where the constants 𝐴,and 𝜙 dependsonthe initial conditions. Usingan ODE solverinMATLAB, usingtwodifferentinitialconditions{𝑥(0) = 0, 𝑥̇(0) = 1} and { 𝑥(0) = 1, 𝑥̇(0) = 0}, do the following 1. Plotthe positionandvelocityasafunctionof time 2. Plotthe potential,kinetic,andtotal energyasafunctionof time 3. Plotthe phase space (i.e.positionvsmomentum),set 𝑚 = 1 4. Describe whathappenstothe plotswhenyouvary 𝜔. To have a betterfeel the problem, trydifferentconditions andparameters. Damped harmonic oscillator Whenthere isfrictionor anylossof energyina harmonicmotion, the motionisdescribedby 𝑥̈ + 2𝛽𝑥̇ + 𝜔0 2 𝑥 = 0 where 𝛽 isthe dampingconstant,and 𝜔0 isthe natural frequency.Usingthe ODEsolverinMATLAB,do the same plotsas before forinitial conditions {𝑥(0) = 0, 𝑥̇(0) = 1},when 𝛽 < 𝜔0, 𝛽 = 𝜔0,and 𝛽 > 𝜔0. Describe the effectof damping inthe three differentregimes. Playwiththe parameterstohave abetter feel of the problem. Driven dampedoscillator Whenthe oscillatorisdrivenbyan external force 𝐹(𝑡),the equationof motioncanbe writtenas 𝑥̈ + 2𝛽𝑥̇ + 𝜔0 2 𝑥 = 𝑓(𝑡) There are infinitelydifferentwaystodrive the system. The mostcommonwaytodo it iswitha wavelike force,say sinusoidalforce of the form 𝑓( 𝑡) = 𝑓𝑑 cos 𝜔 𝑑 𝑡 where 𝑓𝑑 isthe drivingamplitudeand 𝜔 𝑑 isthe drivingfrequency.Now, considerthe case when the oscillatorstartsstationaryat 𝑥 = 1. Solve forthe equation forthe followingparameters 𝑓𝑑 = 100, 𝜔0 = 1 𝛽 = 𝜔0/30, and 𝜔 𝑑 = 𝜔0/5. On equal time axis,plotthe positionandthe drivingforce side byside.Show atleastleast 6cycles of the drivingforce.Youshouldget somethinglike this)
  • 2. Include athirdplot forthe positionof the same oscillatorbutwithnodrivingforce. The initial oscillationsare called transientswhichdisappearsafterafew cycles andthe eventual oscillationiscalled an attractor. While keepingotherparametersconstant,describethe effectof the followingonthe transientsand attractor (amplitude andphase): 1. Initial condition(positionandvelocity) 2. Dampingconstant 𝛽 from 𝛽 < 𝜔0 to 𝛽 > 𝜔0 3. Drivingfrequency 𝜔 𝑑 from 𝜔 𝑑 < 𝜔0 to 𝜔 𝑑 > 𝜔0 Showthat the amplitude 𝐴 andphase shift 𝛿 of the attractor follow thisequation ( 𝐴 𝑓𝑑 ) 2 = 1 ( 𝜔0 2 − 𝜔 𝑑 2) + (2𝜔 𝑑 𝛽)2, 𝛿 = arctan ( 2𝛽𝜔 𝑑 𝜔0 2 − 𝜔 𝑑 2 ) To showthis,keepotherparametersconstantandplotthe analytical curve above withthe one from theorytogether.Youshouldgetsomethinglike this for 𝐴 vs 𝜔0. The amplitude ismaximumwhen 𝜔 𝑑 = 𝜔0,whichiscalled resonance.Thatis,the oscillatorabsorbs maximumenergywhenthe natural frequencyof the oscillatoristhe same asthe drivingfrequency. You can try differentdrivingforces,notjustsinusoidal ones. Reference: 1. For more on the analytical side of the harmonicoscillator,consultthe book ClassicalMechanics by John Taylor.Chapter5 is dedicatedforharmonicoscillations. Figuresinthispaperistaken fromthat chapter.