Thursday, 26th June 2014

In an experiment  to study oscillations of a loaded spring, we could obtain position time data and plot graph.

To determine the spring constant of the given spiral spring we need to measure frequency and time periodic time.

Today I could get this done by fitting the data by writing the following code…

from pylab import *
import expeyes.eyesj, time
import expeyes.eyemath as em

p =
f = open(‘srf.dat’,’r+’)
ta = []
da = []
strt = time.time()
et =0
while et < 30:
dist = p.srfechotime(8,3)
et = time.time() – strt
s = ‘%5.3f\t %d’%(et,dist)
#s = ‘%d\t %d’%(et,dist)
f.write(s + ‘\n’)
print s
vfit, par = em.fit_sine(ta,da)
print par
plot(ta, vfit)


par[1] gives frequency of oscillations..

Now I will create the  GUI and the experiment will be completely ready…. 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *