These solutions could be wrong, so tread with care!
2 Measurement Error and Uncertainty (100%)
And these are from lectures 17 and 18, along with their lecture notes and references.
2.1 Uncertainty Estimation (30%):
The density of air (\(\rho\)) can be estimated by measuring the absolute air pressure (\(p\)) and the aboslute temperature (\(T\)):
\[\rho = \frac{p}{RT}\]
where \(R = 287.04\) J/(kg K) is the specific gas constant for dry air, \(\rho\) is in units of kg/m\(^3\), \(T\) is in Kelvin and \(p\) is in mm Hg.
Assuming that the accuracy of the pressure and temperature measurements are 1 mm Hg and 1 K respectively, what is the uncertainty of the air density estimation when \(T = 24\) Celsius and \(p = 760\) mm Hg?
Answer
Our function, through which we will propagate the uncertainty in our measurements, is as follows:
\[\rho(p,T) = \frac{p}{RT}\]
We know that \(u_p = 1\) mmHg, \(u_T = 1\) Kelvin and \(R\) is a constant with a value of \(287.04\) J/(kg K).
Assuming that \(p\) and \(T\) are uncorrelated, the uncertainty of \(\rho\) is thus:
import numpy as npu_p =1# mmHgu_t =1# KelvinT =24+273.15# Kelvin p =760# mmHgR =287.04# J/(kg K)u_rho = np.sqrt((1/(R*T)*u_p)**2+(p/(R*T**2)*u_t)**2)print(f'The uncertainty of the air density estimation is {u_rho:.4f} mmHg kg / J')
The uncertainty of the air density estimation is 0.0000 mmHg kg / J
2.2 Total uncertainty (30%):
The supply air pressure in a duct is going to be kept constant at a set value for a series of tests. A damper controls the air flow (and pressure) supplied by the air handling unit. The duct is equiped with a dial gauge (resoluton of 1 psi and accuracy of 0.5 psi) to monitor the air pressure. Thirty trials of maintaining a static pressure of 50 psi are attempted to estimate how precisely the pressure can be controlled via the damper. The results show that the standard deviation in the set pressure is 2 psi. Estimate the total uncertainty at 95% confidence in the set pressure that would be expected during normal operation.
Note: since we do not know the population standard deviation, you will need to use Studennt’s t-distribution.
Answer
We have a sample standard deviation of \(s_p = 2\) psi. Given that this was with 30 trials (i.e., \(\nu = 29\) degrees of freedom), and we want the 95% confidence interval, which means we want \(t_{95\%, 29}\), which can be gleaned from a table (or through any other means) and is \(2.045\). This is enough for us to calculate the uncertainty of the measurements (not the total uncertainty) as \(u_p = t_{95\%, 29} \frac{s_p}{\sqrt{30}}\). Then we need to add half of the resolution error (\(u_0 = 1/2\) psi) as the design stage uncertainty, and the accuracy \(u_1 = 0.5\) psi using the RSS method, namely: total uncertainty = \(\sqrt{u_0^2 + u_1^2 + u_p^2}\). To calculate we do:
import numpy as nps_p =2# psit_95 =2.045u_p = s_p/np.sqrt(30) * t_95u_1 =0.5# psiu_0 =0.5# psiu_total = np.sqrt(u_0**2+ u_1**2+ u_p**2)print(f'The total uncertainty is {u_total:.2f} psi')
The stress on a loaded wing for an electric drone is measured using a system consisting of a strain gague, a Wheatstone bridge, an amplifier, and a data acquisition system. The bias and precision uncertainties arising from calibration, data acquisition and data reduction are listed below:
Error source
Bias uncertainty (N/cm\(^2\))
Precision uncertainty (N/cm\(^2\))
# of Samples
Calibration
1.0
4.6
15
Data acquisition
2.1
10.3
38
Data reduction
0.0
1.2
9
Assume 100% reliability in the values of all bias errors and that there are no correlated uncertainties.
For 95% confidence, determine the range that contains the true mean value of the stress given that the average value is 223.4 N/cm\(^2\).
Answer
The “expanded uncertainty” (\(u_{\sigma}\)) that we are calculating here is the result of finding a t value for the combined degrees of freedom at 95% confidence and then multiplying that by the random standard uncertainty (combining precision errors). Finally we combine this – in the RSS sense – with the total systematic uncertainty (combining all bias errors).
and c indicates “calibration”, daq indicates “data acqusition” and dr is “data reduction”.
We can now combine these to find the result:
from scipy.stats import tq =0.975# Quantiledf_c =14# Degrees of freedom for calibration statisticsdf_daq =37# Degrees of freedom for data acquisition statsdf_dr =8# Degrees of freedom for data reduction stats b_c =1.0s_c =4.6b_daq =2.1s_daq =10.3b_dr =0.s_dr =1.2df_combined = (s_c**2+ s_daq**2+ s_dr**2)**2/(s_c**4/df_c + s_daq**4/df_daq + s_dr**4/df_dr)t_combined = t.ppf(q, df_combined)u_total = np.sqrt(b_c**2+ b_daq**2+ b_dr**2+ (t_combined * np.sqrt(s_c**2+ s_daq**2+ s_dr**2))**2)average =223.4low_limit = average - u_totalhigh_limit = average + u_totalprint(f'A 95% confidence interval containing the true mean value of the stress is [{low_limit:.3f}, {high_limit:.3f}].')
A 95% confidence interval containing the true mean value of the stress is [200.487, 246.313].
Let’s compare that to the naive approach where we treat each uncertainty separately and later combine them.