next up previous contents
Up: Testing The Law Previous: Raw data


A physica macro

This physica macro was used to generate the plot of Figure 3 as well as to fit xxx xxxxx xxxxx xxx xxxx xxxx xxxxx xxxxx xxxx xxxxx xxxx xxxxxxxxx xxx xxxxx xxxxx xxx xxxx xxxx xxxxx xxxxx xxxx xxxxx xxxx xxxxxxxxx

      ! exp_3.pcm
      clear
      
      ! read in the data
      read\format\noerror exp_3.dat (*) x,y,dy

      ! plot the data
      label\x `Voltage, V'
      label\y `Power, W'
      set colour 1 1
      set pchar -4
      graph x,y,dy

      ! fit and plot the curve
      scalar\vary A,T,w,phi
      ! initial values for parameters
      A=2.3
      w=6.5
      phi=0
      T=10.

      fit y=A*cos(w*x+phi)*exp(-x**2/T)
      fit\update f
      set colour 2 2
      set pchar 0
      graph\noaxes x,f


For info, write to: physics@brocku.ca
Last revised: 2008-01-22