title: Keep getting , TypeError: a float is required
body: <p>I keep getting the type error but i can't figure out which is causing the problem.
  my code is..</p>
  
  <pre><code>#import modules needed
  from math import sin, pi, sqrt
  from cmath import exp
  from lab2_q4b import q
  
  #Define constants
  lamda=500e-6 #wavelength of the incident light, units in meter
  n=10 #number of slits in a dffraction grating
  f=1.0 #focal length, units in meter
  x=0.1 #width of the screen, units in meter
  
  #Define a new function called qnew, which will be our integrand
  def qnew(u):
      return sqrt(q)*exp(1j*2*pi*x*u/(lamda*f))
  </code></pre>
  
  <p>and I run this it gives me the error.. </p>
  
  <p>this is the code for q.. </p>
  
  <pre><code>#Import modules
  from math import sin, pi
  
  
  #Define a function q that takes u as an argument
  
  def q(u): #transmission function 
      d=20e-6 #separation of slits, units in meter
      alpha=pi/d #
  
      return (sin(alpha*u))**2 #the result of the transmission function 
  </code></pre>