Hi
I have a LDR (light-dependent resistor), the resistance of which falls linearly with increasing lux (light intensity) on a log-log scale.
On a log-log scale, the values increase in powers of 10, but I want to know the resistance value for each lux going up in steps of 1 (eg. 10 lux, 11 lux, 12 lux...), not it powers of 10 (eg. 10 lux, 20 lux, 30 lux, etc...)
Eg. If I want to display the light level in lux based on the LDRs resistance, the display would go something like (in lux):
0.1, 0.2, 0.3, ... ,0.9, 1.0, 2.0, 3.0, ... , 9.0, 10, 20, 30, ... ,90, 100, 200, 300..
This means when the display is reading 1000 lux, the actual light level is between 1000 to 1900 lux!
I don't think finding the gradient of the line helps, as the axes are log-log.
I want to know the resistance value (y-axis) for a given lux value (x-axis). This will allow me to display the values going up 1 lux at a time(eg. 10, 11, 12,... as oppose to 10, 20, 30....).
Thankyou
Hi
What I have is a log-log graph. The x-axis starts at 10^-1 and increases by a power of 10 until 10^4 (on a logarithmic paper). The y-axis is similar, but it ends at 10^6.
On this log graph, there is a line going from 9x10^5 to on the y-axis to 10^4 on the x-axis.
What I want to know is the y-value for any given x-value (eg. x = 1, 100, 200, 201, 203, 593, 9000, 9005 etc...)
I don't know how to work oput the respective y-values out from a log-log graph. This is what I'm asking for.
Thanks
Ah! I think I get it now.
What you have is a line on the log-log graph. The slope-intercept form for a line is
where m is the slope and b is the y intercept. Here x is the independent variable and y is the dependent variable.
On a log-log graph the form of the variables change a bit. Here the form of a line is
If I have you correctly you have two points on either end of this line:
and
(Why am I using a 1 instead of a 0? Because the axes on a log-log plot are not x = 0 and y = 0. You can't take the log(0), it doesn't exist.)
So the slope of the line is (generalizing from the standard definition):
The y-intercept is .
So your line equation is:
To get the x-y relationship from this we put the intercept back into the format:
Thus
-Dan
I see what you're doing - thanks.
I was mistaken with the interecpt coordinates. They are (0.1, 9x10^5) and (10^4, 100)
When I work out the gradient using the respective method, I get -0.7908485019
The final equation gives incorrect values for y. Can you please write an equation (no explanation req) to make sure I'm not messing up somewhere?
Thanks.
P.S. Here's the graph:
Click to enlarge
The coefficient changed because the intercept changed (you changed your points so m and b became different.)
Also, by properties of logs:
and
Finally anything we do to one side of the equation we must do to the other. So if we have
Then:
[tex]10^{log(a)} = 10^{log(b)}
implies
(ie. just drop the logs from both sides.)
-Dan
x = 0.1 might be on the edge of your graph, but the y axis in this case is the line x = 1. (Or at least that's how I've been taught. This is because there can be no point at x = 0.)
Regardless of our difference in definitions:
(Dagnabit! Now I'm getting a different slope from before. Let's just see where this goes.)
Then
Plug in one of the points:
(Different slope, implies different intercept. (sigh))
I want this in log form, so I'll be working with
So
or
(This had better be right this time. I checked both points in the equation and they worked.)
-Dan
Hi
I think the first gradient we worked out (~-0.7908...) was the correct one, as in doing the same gradient calculation you have done above I get -0.79...
It also works for log(100 / [9x10^5]) / log([10^4] / 0.1) which is abit different in method.
Baring this gradient in mind, I get b = 5.1634...
10^5.1643 gives 1.4568...x10^5 as the y-intercept.
This is 16% out of the actual value of 9x10^5, which isn't very accurate in itself (my estimate from an almost 'scale-less' graph). See the graph on page 3w here: http://docs-europe.electrocomponents...6b8001a9d6.pdf
Do you think it's a reasonable error margin?
Thanks again
Bah! Now I'm back to getting the -0.79... slope. Either I had a massive brain fart in my last post or my calculator is overworked and screwing up on me.
Actually your method for the slope isn't any different from mine, it's just a form that exploits the log formulas.
I agree with your intercept also.
Now, what's this about errors? Do you have data points and this is a fit line for them? I had thought you were merely trying to solve the line formula on the log-log graph (between two points) and find out what the formula was without the logs?
-Dan
Hi
That was what I was trying to do. Then I just plug in a lux value of my choice and get the resistance at that point
I've added a link in my previous post. There is a graph on the datasheet (resistance x10^3 against lux) so you can see where I estimated the intercept from.
I don't know how accurately I did it, but the intercept on their graph is 1/9 the way down that part of the grid (the square it's in), so I measured 1/9 the way down on mine and marked it. I didn't know how else to determine it.
Okay I get it now.
Bear in mind that spec sheets like this come from batches of tens, if not hundreds, of test experiments where the data were averaged. Also a graph like the one you are working with is almost certainly idealized, else they likely would have included the resistance equation so you wouldn't have to figure it out.
Is a 16% error "ignorable?" Depends on what application you are using the resistor for. I would go by the printed data over the graphical data if that is pertinent to your decision. Otherwise I can't guide you any further than that, because I exude some sort of strange field such that when I walk into a lab strange things happen to the results.
-Dan
Good point.Also a graph like the one you are working with is almost certainly idealized, else they likely would have included the resistance equation so you wouldn't have to figure it out.
If we analyze the effects of quarks on matter, we can find out why you affect the results the way you do :POtherwise I can't guide you any further than that, because I exude some sort of strange field such that when I walk into a lab strange things happen to the results.
Thanks for your help.
Apex