0.1 Introduction
◼ Description: In this tutorial, you will learn how to propagate uncertainty, which is a method for determining the uncertainty in quantities that are calculated from direct measurements.
0.2 Tutorial Guidelines
◼ Makesurethatyouperiodicallysaveyourworkasyouprogressthroughthistutorial. ◼ To save a notebook, press “Cmd+S” (Mac) or “Ctrl+S” (Windows) to save.
◼ Grading Guidelines
◼ You are expected to complete this entire tutorial. The rubric for this tutorial will be
posted in Canvas.
◼ Submit this assignment to Canvas as a PDF.
◼ When you have finished this tutorial, save your work as both an Mathematica Notebook (.nb) file and a PDF file
◼ To save your work as a PDF, navigate to the File menu, select “Save As”, and, under “Save as type:”, select “PDF Document.”
◼ Guidelines for Answering Questions
◼ When answering a question in this tutorial with plain text, answer in the specified Text
Cell below the question.
◼ If you need to need to use special characters (e.g., σ, δ) or formatting (e.g., x , x), use 2
Palettes or InputAliases . Below are some tutorials and resources that explain how to use these features.
◼ How to use Palettes and InputAliases to write special characters
◼ How to use the Writing Assistant Palette, Classroom Assistant Palette, and
Writing Assistant Palette
◼ ListofInputAliasesforcommonlyusedspecialcharacters.
◼ Without special prompting, you should always show your calculations and provide justifications for your answers.
◼ In Mathematica, you can type out practically any calculation using Palettes or InputAliases. (e.g., σ = σ )
100m 10 m
Printed by Wolfram Mathematica Student Edition
2 Homework 3.1 – Propagation of Uncertainty Tutorial (1).nb
◼ However, if you prefer to write out you calculations on a tablet or piece of paper, you can, alternatively, take a screenshot or image of your written work and paste it into the Text Cell of your answer.
◼ If the justification for you answers are visual, such as a graph or histogram, take a screenshot of that diagram and include it in the Text Cell of your answer. Better yet, use an external program to annotate the diagram to provide additional explanation.
◼ Evaluate the input cell below called 0.3 Initialization Cells. This contains functions and variables that you need to evaluate in order to perform this tutorial. To keep things tidy, evaluate the cell without expanding it.
0.3 Initialization Cells
1. Introduction to Transforming Measurements
1.1 Transforming Function
So far in this course, you have designed experiments in which you directly measure physical quanti- ties and then analyze the relationship between those directly measured quantities.
In upcoming experiments, a simple analysis between directly measured quantities may not suffi- ciently answer your research question. Instead, you may need first to transform your direct measure- ments with a mathematical function and then analyze the transformed measurements. (This mathematical function is called a transforming function F.)
The following are examples of experimental designs that rely on transformed measurements.
◼ Example 1.1: Analyze Nonlinear Data
Suppose you need to determine how well a nonlinear model describes your measured
data.
To robustly analyze your data, you decide to use linearization techniques and plot your data on a log-log plot. To produce this plot, you first transform measurements (both independent and dependent variables) with the natural logarithm and then plot the transformed measurements.
Printed by Wolfram Mathematica Student Edition
Homework 3.1 – Propagation of Uncertainty Tutorial (1).nb 3
In this case, you are transforming your direct measurements with the transforming functions F(x) = Ln(x) and F(y) = Ln(y), where x and y represents your independent and dependent variables, respectively.
◼ Example 1.2: Calculate Physical Quantities
Suppose you need to measure a specific physical quantity to answer your research question. Unfortunately, due to the limitations of your equipment, you cannot directly measure this quantity of interest. However, you may be able to calculate this quantity of interest from one or more quantities that you can measure directly with this experimental setup.
For instance, suppose you need to measure the distance between the center of two identical spheres, r, (e.g., Lab Unit 2). Based on your experimental setup, you cannot measure this distance directly. However, can measure the shortest surface-to-surface distance between the spheres, d, and the radius of the identical spheres, R, and then calculate the distance between the spheres’ centers using the definition r ≡ d + 2 R
In this case, you are using the transforming function F(d, R) = d + 2 R to transform your direct measurements for d and R into r.
Alternatively, suppose you need to measure the electrical resistance of a conductor, but you do not have an ohmmeter. Instead of directly measuring this quantity, you could directly measure the applied potential difference across the conductor, ΔV, and the current through the conductor, I, and then calculate the conductor’s resistance using the definition R ≡ ΔV .
I
In this case, you would use the transforming function F(ΔV, I) = ΔV to transform I
your direct measurements for ΔV and I into the conductor’s resistance. 1.2 Transforming Uncertainty
When transforming a measurement, we have to consider how the uncertainty in the measurement is affected by the transformation.
To review, since every measurement is susceptible to small random effects, every measurement comes with inherent uncertainty. As such, when you report a value for a measured quantity, you typically report both your best estimate for the measured quantity and the uncertainty in that best estimate:
xbest ± δxbest
In doing so, you are reporting the most probable range for the measured quantity x. You are
stating that x probably ranges from
Printed by Wolfram Mathematica Student Edition
4
Homework 3.1 – Propagation of Uncertainty Tutorial (1).nb
x- = xbest – δxbest to x+ = xbest + δxbest .
Therefore, due to measurement uncertainty, when you transform a measured quantity x, you need
to transform not just one value but a range of values.
For instance, suppose you need to use transformation function F to calculate quantity q from quantity x, which you directly measure:
q= F(x)
If you report that quantity x probably ranges from
x- = xbest – δxbest to x+ = xbest + δxbest ,
then according to your transformation function F, quantity q will probably range from
q- = F(xbest – δxbest) to q+ = F(xbest + δxbest) .
Therefore, when you use a transformation function to transform direct measurements,
you are transforming a range of values into another range of values:
(x , x )⟶(q , q ) -+F-+
This concept will be illustrated in the next activity.
1.2.1 Activity: Qualitatively Understanding Uncertainty Transformations
In this activity, you will use a simulation to further explore the relationship between a direct mea- surement x and a transformed measurement q.
◼ Instructions for Simulation
Evaluate the Input Cell below, which will start the simulation.
In the simulation, you can select a specific transformation function and see how the uncertainty in a directly measured quantity x affects the uncertainty in the transformed quantity q.
Controls
1
2
3
Use the SetterBar (e.g., ) in the left Control Panel to select a
transformation function F. There are three transformations available for this simulation:
F(x) = Ln(x), F(x)= 1 ,and
x2 F(x)=10x+5
Use the xbest slider in the left Control Panel to change the values of the best estimate for the direct measurement of x.
Use the δxbest slider in the left Control Panel to increase or decrease the uncertainty in the best estimate for x.
Printed by Wolfram Mathematica Student Edition
(*Evaulate me*) transformUncertainMeasurement
Homework 3.1 – Propagation of Uncertainty Tutorial (1).nb 5
When adjusting the xbest and δxbest sliders, use the Zoom to Measurement Range button to auto-scale the graph.
Use the Reset Scale button to return to the default scale for the graph.
Notations and Definitions
This simulation uses the following notations and definitions: ● x- = xbest – δxbest
In[ ]:=
● x+ = xbest + δxbest
● q=F(x)
●q =F(x ) best best
● q = F(x ) = F(x – δx
– – best best
) ● q+ = F(x+) = F(xbest + δxbest)
Question 1.1: Methodically adjust the controls for the simulation, selecting different transformation functions and values for xbest and δxbest. Record any patterns or interesting behaviors that you observe.
Enter any text-based response in this text cell.
Using the range (q-, q+) is one way to report the uncertainty in the transformed measure- ment q. However, we are much more accustomed to reporting uncertain values in the follow- ing form:
(best estimate) ± (uncertainty in best estimate).
So, why are we reporting q as (q-, q+) instead of qbest ± δq ?
± δq implies that the most probable range for q is symmetric around q . best best best
The form q
In other words, this form implies that q only true under certain conditions.
– q = δq . However, this is
– q
Question 1.2: Based on your observations from Question 1.1, under what conditions
best
best
+
≅ q
best –
best
is the most probable range of q symmetric around qbest? In other words, under what condi- Printed by Wolfram Mathematica Student Edition
6 Homework 3.1 – Propagation of Uncertainty Tutorial (1).nb
± δq ? Enter any text-based response in this text cell.
tionscanyoureportqintheformq
best
best best
Question 1.3: Under the conditions you found in Question 1.2, develop a method for calculating δq . Describe your method in words and provide a mathematical expression for
δq . Justify your method. best
best
Enter any text-based response in this text cell.
2. Propagation of Uncertainty
2.1 Uncertainty in a Transformed Measurement using a Single- Variable Transformation Function
accepted method.
◼ Uncertainty in a Transformed Measurement using a Single-Variable Transformation Function
Suppose you directly measure physical quantity x. You then report your best estimate for that quantity and the uncertainty in that best estimate: xbest ± δxbest
Using this direct measurement, you then calculate quantity q according to transformation function q = F(x) .
In Question 1.3 you proposed a method for determining δq
quantity. In this section, I will provide you with the accepted method for determining δq
best
. Then you will reflect on the similarities and differences between your proposed method and the
, the uncertainty in a transformed
best
If δxbest is small, then:
= ±δ = F( )±∂F ∂=
δ
Printed by Wolfram Mathematica Student Edition
∂x x=xbest best
best
◼ Example 2.1
Suppose you measure the distance r between two point charges. You then report your
best
Homework 3.1 – Propagation of Uncertainty Tutorial (1).nb 7
q=q ±δq = F(x )±∂F
best best best ∂x x=xbest best
Hence:
δq
with respect to x, evaluate this derivative at x = x , take its absolute value, and
δx
In words, to find δq , you first take the derivative of the transformation function
= ∂ F δx
then multiply that by δx . best
best
best estimate for r and its uncertainty: r ± δr . To answer your research question, best best
you need to calculate 1 / r and its uncertainty.
In this case, q = F(r) = 1/r and the uncertainty in q
is:
δq = δr best ∂1/r r=xbest best
best
∂r
δqbest = -1 r=rbest δrbest
r2
δq =δ1 δr
best rbest best 2
δqbest = rbest rbest2
If your measurement for r is 11.25 ± 0.080 cm, then your transformed measurement would be:
q = qbest ± δqbest q= 1 ±δrbest
rr2 best best
1 0.08 -1 q= ± cm
11.25 11.252 q=0.08889 ± 0.00063 cm-1
This process of transforming δxbest into δqbest is called propagation of uncertainty: F
δxbest ⟶ δqbest
Question 2.1: Is this accepted method for calculating δqbest consistent with your
proposed method and observations? If so, explain. If not, discuss any discrepancies.
Printed by Wolfram Mathematica Student Edition
8 Homework 3.1 – Propagation of Uncertainty Tutorial (1).nb
Enter any text-based response in this text cell.
2.2 Uncertainty in a Transformed Measurement using a Multi- Variable Transformation Function
Sometimes, we need to use multiple measurements to calculate a single physical quantity. In these cases, we need to use transformation functions that depend on more than one variable. For instance, to calculate the resistance of a conductor, we need to use a transformation function that
depends on two variables: R = F(ΔV, I) = ΔV I
◼ Uncertainty in a Transformed Measurement using a Multi-Variable Transformation Function
Suppose you directly measure many different physical quantities: x, y, z, ….
For each measured quantity, you determine your best estimate for that quantity and
the uncertainty in that best estimate: xbest ± δxbest , ybest ± δybest , zbest ± δzbest ,… Using these direct measurements, you then calculate quantity q according to
transformation function q = F(x, y, z, …) .
If δxbest, δybest, δzbest, … are small, then the uncertainty in qbest is:
222
δq = best
(x,y,z, …)=(x
◼ Example 2.2: Making sense of those partial derivatives
∂F x=x
∂x y=ybest
z=z best best
…
(δxbest)2 + ∂F x=x
∂y y=ybest
z=z best best
…
(δy )2 + ∂F x=x (δzbest)2 + … best ∂z y=ybest
z=z best best
…
, y ,z , …) best best best
z=z best
best …
Note: Each partial derivative in the expression above is evaluated at the point
Suppose that F(x, y, z) = xyz and you need to evaluate the partial derivative ∂F x=x
∂x y=ybest
∂F First, ev=aluate ∂x :
∂ F ∂(xyz) ∂x ∂x
Printed by Wolfram Mathematica Student Edition
∂F =yz(1) ∂x
∂F =yz ∂x
Homework 3.1 – Propagation of Uncertainty Tutorial (1).nb 9
∂F =yz∂(x) ∂x ∂x
Then, evaluate the expression at (x, y, z, …) = (xbest, ybest, zbest, …). ∂F x=x = ybest zbest
∂x y=ybest z=z best
best …
δq = best
δq = best
δq = best
δqbest =
◼ Example 2.3: Adding Measurements
Suppose you recorded two measurements: xbest ± δxbest and ybest ± δy
You want to calculate the sum of these two measurements: q = F(x, y) = x + y. The uncertainty in qbest is:
best
.
22 (δxbest)2 + ∂F x=x
∂F x=x
∂x y=ybest
z=z best best
…
(δy )2 ∂y y=ybest best
z=z best best
… 22
(δxbest) + ∂(x+y) x=x (δy ) ∂x 2∂y 2
∂(x+y) x=x
y=ybest y=ybest best
z=z best z=z best best best
(1)x=x y=ybest
z=z best best
…
… 22
(δxbest)2 + (1)x=x y=ybest
z=z best best
…
…
(δy )2 best
(1)2 (δxbest)2 + (1)2 (δybest)2
Printed by Wolfram Mathematica Student Edition
δqbest = (δxbest)2 + (δybest)2
10 Homework 3.1 – Propagation of Uncertainty Tutorial (1).nb
best
correlated (i.e., they don’t always occur in the same directions).
◼ Example 2.4: Multiplying Measurements
Suppose you recorded two measurements: xbest ± δxbest and ybest ± δy
You want to calculate the product of these two measurements: q = F(x, y) = xy. The uncertainty in qbest is:
and δy simply to add, but this would best
You might expect the uncertainties δx
overestimate the uncertainty δq because random fluctuations in x and y are not
best
best
.
δq = best
δq = best
δq = best
δqbest =
22 (δxbest)2 + ∂F x=x
∂F x=x
∂x y=ybest
z=z best best
…
(δy )2 ∂y y=ybest best
z=z best best
… 22
∂(xy) x=x
y=ybest y=ybest best
(δxbest) + ∂(xy) x=x (δy ) ∂x2∂y2
…
(y)x=x y=ybest
z=z best best
…
22 (δxbest)2 + (x)x=x
…
(δy )2 best
z=z best z=z best best best
(ybest)2 (δxbest)2 + (xbest)2 (δybest)2
δqbest = xbest ybest δxbest 2 + δybest 2 xbest ybest
y=ybest z=z best best
…
Question 2.2: In past experiments, you used the t’-test to compare two measure-
ments of the same physical quantity. According to the Statistics Handbook, if you have two
measurements for the same quantity x, A ± δA and B ± δB, then their t’ value is
t’ =
Find an expression for δ(A – B), the uncertainty in the quantity A – B . Then rewrite the t’
A-B (δA)2+(δB)2
value in terms of δ(A – B) .
Printed by Wolfram Mathematica Student Edition
Homework 3.1 – Propagation of Uncertainty Tutorial (1).nb 11 δ( – )
Enter any text-based response in this text cell.
Question 2.3: For A and B to be distinguishable from each other, t’≥3. Use your expres- sion from Question 2.2 to explain why this interpretation makes sense.
Enter any text-based response in this text cell.
Question 2.4: To measure the area of a square, you could calculate the square’s area by measuring l, the length of one side, and using the formula A = l 2. Or, you could measure
each side l and and find the area with A = l. Which method for calculating the square’s area should have the lesser uncertainty? Why?
Enter any text-based response in this text cell.
Question 2.5: Suppose you measured both l and to be 3.5 ± 0.30 cm long. Using each of the two methods from Question 2.4, determine your best estimate for the square’s area and its uncertainty.
Enter any text-based response in this text cell.
Question 2.6: Suppose you directly measured physical quantities x and y and reported your best estimates for each quantity as:
xbest ± δxbest and ybest ± δybest .
For each of the transformation functions listed below, find the uncertainty in the transformed quantity (δq ). For each transformation function, discuss whether δq is greater than,
less than, or equal to the uncertainty in the direct measurements (i.e., δx why this makes sense.
and δy
3. q = F(x, y) = x / y
4. q = F(x, y) = xSin(αy)
best best
(In the functions below, α represents a constant, exact value (i.e., a value with no uncer- tainty)).
1. q = F(x) = αx
2. q = F(x) = Ln(x)
best
best
), and
Printed by Wolfram Mathematica Student Edition
12 Homework 3.1 – Propagation of Uncertainty Tutorial (1).nb
Enter any text-based response in this text cell.
2.3 Revisiting Around[]
In previous tutorials, you have plugged numerical arguments into the built-in function Around[] to
(*r=r
rMeasurement = Around[11.25, 0.80]
±δr best best
*)
11.3 ± 0.8
In[ ]:=
Out[ ]=
In[ ]:=
Out[ ]=
In[ ]:=
Out[ ]=
Out[ ]=
create numerical quantities with uncertainty.
For instance, in Example 2.1, the distance between two point charges was reported to be
r = rbest ± δrbest = 11.25 ± 0.80 cm. Here is how you would use Around[] to create this numerical quantity with uncertainty in Mathematica:
Notably, if you plug uncertain quantities into a transformation function, Mathematica will propa- gate the uncertainty for you. For instance, from Example 2.1, q = F(r) = 1/r. Using Around[],
q = qbest ± δqbest is
You can also plug symbolic arguments into Around[] to create symbolic quantities with uncer- tainty. If you plug uncertain symbolic quantities into a transformation function, Mathematica will propagate the uncertainty for you algebraically. In other words, Mathematica will give you an algebraic expression for δq. For instance:
Lastly, if you want to extract the uncertainty from an uncertain quantity, you can use the property “Uncertainty”:
(*q=q
1 / rMeasurement
±δq *) best best
0.089 ± 0.006
rMeasurementSymbolic = Around[r, δr] 1 / rMeasurementSymbolic
r ± δr
1 ±Absδr r r2
Printed by Wolfram Mathematica Student Edition
Homework 3.1 – Propagation of Uncertainty Tutorial (1).nb 13
Around[11.25, 0.80][“Uncertainty”] (1/Around[11.25, 0.80])[“Uncertainty”] (1/Around[r, δr])[“Uncertainty”]
(Around[x, δx]+Around[y, δy])[“Uncertainty”] (Around[x, δx]*Around[y, δy])[“Uncertainty”]
0.8
In[ ]:=
Out[ ]=
Out[ ]=
Out[ ]=
Out[ ]=
Out[ ]=
0.00632099
Abs δr r2
δx2 + δy2
y2 δx2 + x2 δy2
Question 2.7: Use the built-in function Around[] to check your answers for Question 2.6. As always, show your work.
Question 2.8: In Unit 3, you will measure the electrical resistance of various conduc- tors. Instead of directly measuring this quantity, you will calculate the resistance from direct measurements. Specifically, you will directly measure the applied potential difference across the conductor and the current through the conductor, and then calculate the conductor’s resistance using the definition R ≡ ΔV .
Suppose you measured the following quantities for a resistor. Use Around[] to calculate the
resistance of this resistor and its uncertainty.
Potential Difference: ΔV ± δ(ΔV ) = 5.00 ± 0.05 V best best
Current: I ± δ I = 10.0 ± 0.1 mA best best
I
Printed by Wolfram Mathematica Student Edition