Physics 240: Superconductor Error Analysis

Linear fit to two points with uncertainties

Mathematica and Matlab both ignore uncertainties in the data when fitting a straight line to two points as we use for the diode calibration for the superconductor.  For the linear fit to two points it is simple to do a direct calculation because you are simultaneously solving two equations:
  V1 = m*T1 + b
  V2 = m*T2 + b
and then propogating the errors through those solutions.

Clear["`*"];

sol=Solve[{V1==m*T1+b, V2==m*T2+b},{m,b}]
m = m/.sol[[1]]
b = b/.sol[[1]]
σm = Sqrt[(σV1*D[m,V1])^2+(σT1*D[m,T1])^2+(σV2*D[m,V2])^2+(σT2*D[m,T2])^2]
σb = Sqrt[(σV1*D[b,V1])^2+(σT1*D[b,T1])^2+(σV2*D[b,V2])^2+(σT2*D[b,T2])^2]

Enter your values for the two temperatures, voltages, and their uncertainties here:

values = {V1->0.5626127, T1->273, V2->1.020333,T2->76.5};
σs = {σV1->1.585582*10^(-6),σT1->0.05,σV2->1.688086*10^(-6),σT2->0.05};

Print["m=",m/.values]
Print["σ_m=",σm/.values/.σs]
Print["b=",b/.values]
Print["σ_b=",σb/.values/.σs]

Calculate the uncertainty in a temperature determined from a diode

NOTE: If you don’t execute the group with the “Clear” command, this calculation will use the results from the fit in the previous section.   

If you are not using the values from above you will also need to insert your values for the fitting parameters into the obvious locations here.

Clear["`*"];
m = -0.002375;
σm = 9.95*10^(-6);
b = 1.204;
σb = 2.32*10^(-3);

Some dummy variables are used here so that we can manipulate the equations without the complication of dealing with numbers (we want to be able to see the relationships).

T=(V-bt)/mt;
dT=Sqrt[(dV*D[T,V])^2+(db*D[T,bt])^2+(dm*D[T,mt])^2]
params={mt->m,dm->σm,bt->b,db->σb};

Now you can enter the value of V and the uncertainty in V from a given measurement to get the corresponding T and the uncertainty in T.

data = {V->0.557386,dV->5.61*10^(-6)};
Print["equation for T = ",T/.params]
Print["equation for dT = ",dT/.params]
Print[" V = ",V/.data,"\n σ_v = ",dV/.data,"\n T = ",T/.data/.params,"\n σ_T = ",dT/.data/.params]

Calculate the resistivity and uncertainty in the resistivity

Clear["`*"];

ρ = R*A/L;
R = V/Cur; (* don't use I for current *)
A = H * W;
σρ = Sqrt[(dV*D[ρ,V])^2+(dCur*D[ρ,Cur])^2+(dH*D[ρ,H])^2+(dW*D[ρ,W])^2+(dL*D[ρ,L])^2]

Enter the basic parameters here (everything except the measured voltage and the uncertainty in that voltage.  If you enter the values in SI units (amps, meters) then the resistivity will be in Ω·m.

params = {H->2.04*10^(-3),dH->0.0117*10^(-3),W->3.01*10^(-3),dW->0.0364*10^(-3),L->9.47*10^(-3),dL->0.0923*10^(-3),Cur->0.01506,dCur->0.000005};

Now enter the voltage and uncerainty to find the corresponding value of ρ and its uncertainty.

data = {V->1.0378728*10^(-4),dV->8.17943*10^(-7)};
Print["equation for ρ = ",ρ/.params]
Print["equation for dρ = ",σρ/.params]
Print[" V = ",V/.data,"\n dV = ",dV/.data,"\n ρ = ",ρ/.data/.params,"\n σ_ρ = ",σρ/.data/.params]