<jupyter_start><jupyter_text>Errors in Sensing<NAME>, PhD A thermistor is used to measure temperatures between $-30^{\circ}$ and $80^{\circ}$ and produces an output voltage between 2.8 V and 1.5 V. The ideal transfer function is shown in the plot below (solid line). Because of errors, the accuracy in sensing is $\pm0.5^{\circ}$. The errors may be specified as follows: a) In terms of the input as $\pm0.5^{\circ}$ b) As a percentange of the input span (Input Full Scale, IFS):<jupyter_code>span = 80-(-30) #input span or input full scale (IFS)
e_input = 0.5 # error as input

e = (e_input/span) *100

## Error as % IFS
print 'The error as percentange of the input span is e = %2.3f %%' % (e)<jupyter_output>The error as percentange of the input span is e = 0.455 %<jupyter_text>c) In terms of the output span (Output Full Scale, OFS): This may be taken off the curve as the difference shown or may be calculated by first evaluating the transfer function and its maximum and minimum limits, as shown in the plot<jupyter_code>import numpy as np
import matplotlib.pyplot as plt
%matplotlib inline

temp = np.array([-30,80])
volt = np.array([2.8,1.5])

# polyfit computes the coefficients a and b of degree=1
a,b = np.polyfit(temp,volt,1)

t = np.linspace(-30,80,50)
trans_f = a*t+b # linear transfer function

# Error in terms of output
e_output = np.abs(a*e_input)

print 'The error in terms of the output is e = ± %2.4f V' % (e_output)

## Error as % OFS 
out_span = 2.8-1.5
e_ofs = e_output/out_span *100

print 'The error as percentange of the output span is e = %2.3f %%' % (e_ofs)

# Error bounds
trans_f_plus = trans_f + e_output
trans_f_minus = trans_f - e_output


# Plotting
plt.plot(t,trans_f)
plt.plot(t,trans_f_plus,'--')
plt.plot(t,trans_f_minus,'--')
plt.xlabel('T [$^{\circ}$C]')
plt.ylabel('V [V]')
plt.xlim([-30,-25])
plt.ylim([2.7,2.9])
plt.legend(['Ideal Transfer Function','Upper error','Lower Error'])
plt.show()<jupyter_output>The error in terms of the output is e = ± 0.0059 V
The error as percentange of the output span is e = 0.455 %
{'fraction_non_alphanumeric': 0.12585034013605442, 'fraction_numerical': 0.034499514091350825, 'mean_word_length': 4.348051948051948, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '58070', 'license': 'MIT', 'n_tokens_mistral': 771, 'n_tokens_neox': 720, 'n_words': 278, 'path': 'notebooks/Ex2-10-errors-in-sensing.ipynb', 'repo_name': 'Mol01/sensors-actuators', 'size': '2066'}