Ideal Straight Line - instrumentation HND

AI Thread Summary
To determine the ideal straight line equation for a temperature sensor with an OHM output, the user initially calculated the line of best fit using a subset of data points, resulting in the equation y = 0.96x + 105. However, the calculated ideal output values deviated significantly from the actual sensor outputs. It was suggested to use the entire dataset for a more accurate line fitting, employing the least-squares method to minimize errors. This approach would provide a better fit by considering all data points and their residuals. Utilizing tools like spreadsheets or calculators with least-squares fitting capabilities can simplify this process.
cps.13
Messages
40
Reaction score
1

Homework Statement


I am doing a distance HND and need to find the ideal straight line of a sensor output. The sensor is a temperature sensor with an OHM output. From a temperature range of 0-250 it has an output of 120-364ohm.

temp output
0 = 120
50 = 178
100 = 201
150 = 249
200 = 303
250 = 364

I need to generate the ideal straight line equation.

The Attempt at a Solution



I have plotted a line of the points on a graph with the x-axis as ohms and the y-axis as temperature. Calculated the line of best fit using y = mx+C where...

m = (249-201)/(150-100)= 0.96
Using the data for a temp of 150 c = 249 - (150*.96) = 105
therefore the equation of the line is

y = 0.96x + 105

When I now calculate the ideal ohm output values they seem quite wayward of the values given.

temp ISL Temp
0 = 105
50 = 153
100 = 201
150 = 249
200 = 297
250 = 345can anyone see if I have made a mistake? should I be calculating my line equation by using the entire temperature range from 0-250?

thanks
 
Physics news on Phys.org
cps.13 said:

Homework Statement


I am doing a distance HND and need to find the ideal straight line of a sensor output. The sensor is a temperature sensor with an OHM output. From a temperature range of 0-250 it has an output of 120-364ohm.

temp output
0 = 120
50 = 178
100 = 201
150 = 249
200 = 303
250 = 364

I need to generate the ideal straight line equation.

The Attempt at a Solution



I have plotted a line of the points on a graph with the x-axis as ohms and the y-axis as temperature. Calculated the line of best fit using y = mx+C where...

m = (249-201)/(150-100)= 0.96
Using the data for a temp of 150 c = 249 - (150*.96) = 105
therefore the equation of the line is

y = 0.96x + 105

When I now calculate the ideal ohm output values they seem quite wayward of the values given.

temp ISL Temp
0 = 105
50 = 153
100 = 201
150 = 249
200 = 297
250 = 345can anyone see if I have made a mistake? should I be calculating my line equation by using the entire temperature range from 0-250?

thanks

Google "Least Squares Fit".
 
HND = ??
ISL = ??

Please expand these acronyms so we can know what you're talking about.
 
ISL = ideal straight line as mentioned earlier in the post
HND = Higher National Diploma.
 
cps.13 said:
ISL = ideal straight line as mentioned earlier in the post
HND = Higher National Diploma.

Since you seemed to have ignored my previous response, I will expand on it a bit. First: YES, you should try to use the entire (x,y) data set, unless you have reason to suspect that some data points are seriously wrong. A simple plot in your case does not suggest any of the points to be truly anomalous, so none of them should be dropped.

A standard method for such problem is the so-called "least-squares" fitting method, where you want to minimize the total of all the squared errors in the fit. That is, in your case you have six data points, so in general there will be six "residual errors"; these are the amounts by which the y-values of the data points miss the straight line. You want some "goodness of fit" measure involving all six of the errors; furthermore, you should look at a measure that involves the absolute errors, not the actual numerical values of the errors. By this, I mean that if one residual error = (actual y) - (fitted y-value) is, for example equal to -2, you should count that as a +2, because +2 is the actual distance between the fit and the data. Positive error means the actual y lies above the fitted value, while negative error means the actual y lies below the fit. You can have positive and negative errors cancelling in total, but that does not mean the fit is perfect; there could still be a significant difference between the data and the fit. When we look, instead, at absolute errors |actual y - fitted y| we eliminate that problem, so guard against false confidence. Looking at squared errors (actual-fit)^2 also gets around the problem of false error-cancellation, and furthermore has the additional desirable property that small errors are de-emphasized, while large errors have their importance magnified. Besides, the least-squares method has been in use for over 200 years, and involves only elementary methods.

Every spreadsheet comes equipped with a least-squares fitting module, and there are also on-line sources that will do the calculations for you. Many hand-held calculators also have a "least-squares fit" button. However, the calculations are so straightforward that no fancy tools are needed, and just using the calculator for addition and multiplication is enough.
 

Similar threads

Back
Top