

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Thursday 8 February - Due: Thursday 15 February
In this lab we will practice our Python programming and go on to explore a simple model for a 1D elastic solid and try to understand some of the properties of the waves that propagate in such a medium
Open up an IDLE file window.
for i in range(0,LLL):
to loop over all spheres on the lattice.
Download the codes wave.py and integrate.py from the PHY300 webpage. These contain most of the code you need to simulate wave motion in a 1d elastic medium. They correspond to a simple modification of our molecular dynamics program in which the motion is restricted to 1D, the forces are harmonic and only nearest neighbors on the lattice interact. We also set the initial conditions to a pulse at the lefthand end of the lattice by displacing the first two masses a little from their equilibrium positions.
xn=objlist[a+1].pos-(a+1)*vspacing
calculates the displacement of the mass a+1 from its equilibrium lattice position, The subsequent line computes the resultant elastic force due the relative displacement of the mass at a from the one at position a+1. Write two similar lines of code to handle the additional elastic force on a from site a-1. Save the new integrate.py.
if(fabs(chain[N-1].pos.x-(N-1)*spacing>0.0001)): print "time to end is " , t