Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # coding: utf-8
- # Lab 1
- # Haley Partlow
- # In[1]:
- get_ipython().magic(u'matplotlib inline')
- import numpy as np
- from __future__ import division
- import matplotlib.pyplot as plt
- # First, determine the frequency of the oscillator using the equation for frequency ${f = (\frac{1}{\lambda})*(\sqrt(\frac{F_{T}}{\mu}))}$
- # In[35]:
- def Frequency(l,F,m,L):
- f = (1/l)*(F/(m/L))**0.5
- return f
- # In[48]:
- Wavelength=0.7814 #m
- Uncertainty_wavelength=1 #mm
- Force=2.45 #N
- Uncertainty_Force=0.03 #N
- Mass=0.000435 #kg
- Uncertainty_Mass=0.000002 #kg
- Length=1.555 #m
- Uncertainty_Length=0.001 #m
- frequency = Frequency(Wavelength, Force, Mass, Length)
- print "Frequency = ", frequency, "Hz"
- # Second, determine the uncertainty of the frequency using Rule 4 error propagation ${\delta f = f \sqrt{(- \frac{\delta \lambda}{\lambda})^2 + (\frac{1}{2}* \frac{\delta F_{T}}{F_{T}})^2 + (\frac{-1}{2}*\frac{\delta m}{m})^2 + (\frac{1}{2}*\frac{\delta L}{L})^2}}$
- #
- # In[43]:
- def Uncertainty(el,l,eF,F,em,m,eL,L):
- Part1=(-el/l)**2
- Part2=(0.5*(eF/F))**2
- Part3=(-0.5*(em/m))**2
- Part4=(0.5*(eL/L))**2
- ef=(Part1 + Part2 + Part3 + Part4)**0.5
- return ef
- # In[55]:
- Uncertainty_frequency = Uncertainty(Uncertainty_wavelength,Wavelength,Uncertainty_Force,Force,Uncertainty_Mass,Mass,Uncertainty_Length,Length)
- print "deltaf = ", Uncertainty_frequency, "Hz"
- # The frequency of the oscillator is 119.77 ${\pm}$ 1.28 Hz.
- # In[ ]:
Add Comment
Please, Sign In to add comment