Calibration and Curve Fitting
Calibration and Curve Fitting
P M V Subbarao
Professor
Mechanical Engineering Department
Sensors
Sensors convert physical variables to signal
variables.
Sensors are often transducers : They are devices
that convert input energy of one form into output
energy of another form.
Sensors can be categorized into two broad classes
depending on how they interact with the
environment they are measuring.
Passive sensors: do not add energy as part of the
measurement process but may remove energy in
their operation.
Active sensors : add energy to the measurement
environment as part of the measurement process.
Calibration
The process of development of a relationship between the
physical measurement variable input and the signal variable
(output) for a specific sensor is known as the calibration of the
sensor.
Typically, a sensor (or an entire instrument system) is calibrated
by providing a known physical input to the system and
recording the output.
The data are plotted on a calibration curve.
Sensitivity of A Sensor
Saturation Point
Linear range
Sensitivity of Thermistor
f x ax b
Error d i2 y1 f x1 y2 f x2 y3 f x3 y4 f x4
2
f x ax b
Error yi f xi yi axi b
2
i 1
i 1
The best line has minimum error between line and data points
This is called the least squares approach, since square of the error
is minimized.
Take the derivative of the error with respect to a and b, set each to zero
N
Error
2 xi yi axi b 0
a
i 1
N
Error
2 yi axi b 0
b
i 1
Solve for the a and b so that the previous two equations both = 0
i 1
i 1
a x b xi xi yi
2
i
i 1
i 1
i 1
a xi bN yi
put these into matrix form
N
x
i 1
b
i 1
N
2 a
xi
i 1
y
i 1
x y
i 1
i 1
i 1
i 1
N xi yi xi yi
N
N x
i 1
2
i
i 1
y x x x
i 1
i 1
N
2
i
N x
i 1
i 1
2
i
i 1
i 1
yi
y a0 a1 x a2 x .........am x
2
i 1 yi f xi min
n
i 1 yi a0 a1 xi a x ......a x
n
2
2 i
n
n i
min
2nd and 6th order look similar, but 6th has a squiggle to it.
Is it Required or not?
i 1
i 1
a y b yi xi yi
'
2
i
i 1
'
a yi b N xi
'
'
i 1
i 1
i 1
b'
i 1
N
2 a '
yi
i 1
x
i 1
x y
i 1
x a yb a
'
'
'
i 1
i 1
i 1
N xi yi xi yi
N
N y
i 1
2
i
i 1
1
a'
1
b'
y ' x '
a
a
is the slope of this second line, which not same as
the first line
y ax b a
i 1
i 1
i 1
N xi yi xi yi
N
N x
i 1
x a y b a
'
'
'
2
i
i 1
i 1
i 1
i 1
N xi yi xi yi
N
N y
i 1
2
i
i 1
i 1
i 1
i 1
N xi yi xi yi
N x
i 1
2
i
2
xi N yi
i 1
i 1
i 1
i 1
i 1
i 1
N xi yi xi yi
N x
i 1
2
i
2
xi N yi
i 1
i 1
y
i 1
Correlation Coefficient
The sign of the correlation coefficient is determined by the sign
of the covariance.
If the regression line has a negative slope the correlation
coefficient is negative
while it is positive if the regression line has a positive slope.
The correlation is said to be perfect if = 1.
The correlation is poor if 0.
Absolute value of the correlation coefficient should be greater
than 0.5 to indicate that y and x are related!
In the case of a non-linear fit a quantity known as the index of
correlation is defined to determine the goodness of the fit.
The fit is termed good if the variance of the deviates is much less
than the variance of the ys.
It is required that the index of correlation defined below to be
close to 1 for the fit to be considered good.
y
i 1
f xi
y
i
i 1
y
N
i 1
2=1.000
2=0.821
2=0.991
2=0.493
2=0.904
2=0.0526
d orifice
m f p, T , p, A,
d
pipe
d orifice
p
c d
m a
p A
d pipe
RT
b
d orifice
p
ln m ln a b ln
c ln p d ln A e ln
d pipe
RT
Simply:
y ln a bl cm dn eo
i 1
i 1
i 1
i 1
i 1
i 1
Na b li c mi d ni e oi f pi yi
N
i 1
i 1
i 1
i 1
i 1
i 1
i 1
a li b li2 c li mi d li ni e li oi f li pi li yi