# Graph non-linearity calculation

1. Jul 2, 2009

### thavamaran

Hi guys, im currently undergoing process of my final engineering project. so im analyzing my sensor via graph. so i have attach two graph image whereby i need to compare the actual output which is in blue line and red line is the actual linearity graph which how it suppose to be. so now i need to find the drifting percentage between the actual graph and the linearity graph. i need idea how to do it, can anyone guide me through please. thank you.

in second graph i have pointed out the drifted point from linearity form. please guide me through.

File size:
9.3 KB
Views:
361
File size:
10.7 KB
Views:
381
2. Jul 2, 2009

### HallsofIvy

I presume that by the "drift" you mean the difference between the observed value (blue line) and the predicted value (red line). Calling the observed value yo(x) and the predicted (linear) value yp(x), the "percentage drift" is
$$\frac{|y_o(x)- y_p(x)|}{y_p(x)}$$
written as a percent.

3. Jul 2, 2009

### thavamaran

So you mean by A=blue line and B=red line, ((A-B)/B)x100% right. so that means this equation goes for point of the drifted value right, so its for point by point analysis. is there any possibilities for the entire blue line drifting equation compare to red line equation?

thanks a lot

4. Jul 2, 2009

### thavamaran

come back to your equation, how if the blue line value is smaller than red line? like A=1, B=2, its going to be in negative form?

5. Jul 2, 2009

### HallsofIvy

That was why I suggested using absolute value. If you want a single number for the entire graph you might use either
$$\frac{\int |y_o(x)- y_p(x)|dx}{\int y_p(x) dx}$$
or
$$\frac{\sqrt{\int{(y_o(x)- y_p(x))^2 dx}}}{\int y_p(x)dx}$$

(A third measure that is sometimes used is
$$max\left(\frac{|y_o(x)-y_p(x)|}{y_p(x)}\right)$$)