12.07.2015 Views

Simple Nature - Light and Matter

Simple Nature - Light and Matter

Simple Nature - Light and Matter

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

the time ∆t = ∆x/v required to move a predetermined distance∆x, we pick ∆t <strong>and</strong> determine the distance traveled in that time,∆x = v∆t. Also, we can no longer update v based on conservation ofenergy, since we don’t have any easy way to keep track of how muchmechanical energy has been changed into heat energy. Instead, werecalculate the velocity using ∆v = a∆t.1 import math2 k=39.4784 # chosen to give a period of 1 second3 m=1.4 b=0.211 # chosen to make the results simple5 x=1.6 v=0.7 t=0.8 dt=.019 n=100010 for j in range(n):11 x=x+v*dt12 a=(-k*x-b*v)/m13 if (v>0) <strong>and</strong> (v+a*dt

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!