lecture4 - Damped, driven oscillator • Start with the...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Damped, driven oscillator • Start with the case where q=0, F D =0 • y(t)= Acos ω t + Bsin ω t • Initial conditions, A=y , B=v 0 / ω • Energy (kinetic + potential) should be conserved! Compare with analytical to verify code, also test energy conservation! Test with simple harmonic oscillator • Use Verlet algoritim y n+1 = 2y n- y n-1 - ω 2 dt 2 y n c force/mass from spring force = -om0**2*ynow c integrate to get y at next time step, use Verlet Test with simple harmonic oscillator • Use Verlet algoritim y n+1 = 2y n- y n-1 - ω 2 dt 2 y n c force/mass from spring force = -om0**2*ynow c integrate to get y at next time step, use Verlet ynext = 2.0d0*ynow-ylast+dt**2*force Initial conditions, analytic solution • Analytic result computed for comparison • Verlet algorithm needs position at two previous times • Translate into initial position and initial velocity y(t)= Acos ω t + Bsin ω t Initial conditions, A=y , B=v 0 / ω c velocity at current timestep vnow = (ynext-ylast)/(2.0d0*dt)vnow = (ynext-ylast)/(2....
View Full Document

This note was uploaded on 08/08/2011 for the course PHZ 5156 taught by Professor Johnson,m during the Fall '08 term at University of Central Florida.

Page1 / 10

lecture4 - Damped, driven oscillator • Start with the...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online