Uncertainty in measurement is the quantification of the doubt about the measurement result.For example – we might say that a particular stick is 200cm ±1cm at a level of confidence of 95%.
In the following way, the user can perform the uncertainty calculation.
import numpy as np
from unc import Unc
import math
a = Unc(3, 0.5)
b = Unc(2, 0.7)
print(‘\nUncertainty value with constant calculation:’)
print(“NOTE: By default the value in parenthesis represents the absolute uncertainty\n”)
input(“Enter any key to continue ………..”)
# ######## Constant calculation with addition ##################
# ########################### Addition Calculation ##################
print(‘Value and uncertainty is:’, a)
print(‘Now if we Add(+) pi=3.14 Constant right side of the calculation, example: Unc(3, 0.5) + Unc(math.pi)’)
c = a + Unc(math.pi)
print(c)
input(“Enter any key to continue ………..”)
print(‘\nNow if we Add(+) pi=3.14 Constant left side of the calculation, example: Unc(math.pi) + Unc(3, 0.5)’)
d = Unc(math.pi) + a
print(d)
#################################################################
input(“Enter any key to continue ………..\n”)
print(‘Now if we Subtract (-) pi=3.14 Constant right side of the calculation, example: Unc(3, 0.5) – Unc(math.pi)’)
# ######## Constant calculation with subtraction ##################
c = a – Unc(math.pi)
print(c)
print(‘Now if we Subtract (-) pi=3.14 Constant left side of the calculation, example: Unc(math.pi) – Unc(3, 0.5)’)
d = Unc(math.pi) – a
print(d)
input(“Enter any key to continue ………..\n”)
#################################################################