Admittedly math is my worst subject ...
Well you could fix that first: all math is is based on counting. But we don't have space for that now.
Say you were driving from west of Gary to Osceola (just east of South Bend).
From previous trips you know it is 80mi miles from Gary to Osceola along I-90 and Route 31, but your odometer is broken today.
...[Gary]<-------------------80mi------------------>[Osceola]
There is construction the whole way, so your speed will be a constant 40mph*.
Even without mad math skills, I suspect that by now you know that if you pass through Gary at midnight (0000), you will arrive in Osceola at 2am (0200), i.e in 2h after you left gary, which you get by dividing 80mi by 40mph.
But let's say you pass through La Porte at 1am, 1h after Gary.
[Gary]<-------1h------>[La Porte]<------1h------>[Osceola]
Your odometer is broken*, but how far is La Porte from Gary? Obviously it is 40mi from Gary, which you get by multiplying the 1h traveled by 40mph. But let's look at it another way:
Speed is constant at 40mph, and speed is defined as distance (miles) divided by (per) time (hour). What this means is that for every hour you drive, you will travel 40mi. So a plot of distance vs. time is a line:
Code:
^miles
| /
80+ x
| /
| /
| /
| /
40+ x
| /
| /
| /
|/
0-+----+----+----->hours
0 1 2
And because the plot of this time vs. distance is a
line, this trip is called a linear process. Very few processes are truly linear, but very very few cannot be represented well enough with a linear model, at least over some limited range of operation. Even motion control problems, which are often non-linear in position, will model constant acceleration so they are linear in velocity vs. time, or even constant jerk, so they are linear in acceleration vs. time.
Back to your trip ...
Use Yc and Xc to represent distance and time, respectively, of city c from Gary, so
Ygary = 0mi
Yosceola = 80mi
Ylaporte = ?
Xgary = 0100 (0h)
Xosceola = 0200 (2h)
Xlaporte = 0100 (1h)
So for the Gary-Osceola trip, we have
Code:
Yosceola - Ygary 80mi - 0mi 80mi
speed = ---------------- = ---------- = ---- = 40mph
Xosceola - Xgary 2h - 0h 2h
And for the Gary-La Porte trip we have
Code:
Ylaporte - Ygary Ylaporte - 0mi
speed = ---------------- = -------------- = 40mph
Xlaporte - Xgary 1h - 0h
Now comes the cool part: note that it does not matter if you started in Oshkosh at midnight and pass through Gary at 5am and 200mi from Oshkosh:
Ygary = 200mi
Yosceola = 280mi
Ylaporte = ?
Xgary = 5h
Xosceola = 7h
Xlaporte = 6h
Code:
Yosceola - Ygary 280mi - 200mi 80mi
speed = ---------------- = ------------- = ---- = 40mph
Xosceola - Xgary 7h - 5h 2h
And for the Gary-La Porte trip we have
Code:
Ylaporte - Ygary Ylaporte - 200mi
speed = ---------------- = ---------------- = 40mph
Xlaporte - Xgary 6h - 5h
So, you should recognize those formulas from my previous post, e.g. if we drop the laporte subscripts, and use 1 for Osceola and 0 for Gary, and set the two speed formulas equal (since both are 40mph), i.e. we get (Y-Y0)/(X-X0) = (Y1-Y0)/(X1/X0) from my previous post.
Note that if we were interested in the distance from Gary to Portage (Yportage), and we knew that we went past Portage 15minutes, or 0.25h, after Gary, the same formula applies with Xportage equal to 0.25h (or 5.25h) and Yportage will be 10mi.
And that is a long way around to an answer your query:
how do you come up with the above formula from the question “Describe how you would perform a 2-point linear calibration of a PLC analog input? The scaling is calculated in PLC ladder.”
I.e. because the original question is specifically about a
linear process, and that is the fundamental equation that expresses all linear processes.
Further, it does not matter if your odometer is working and your watch is broken, and you see that you drive through La Porte at 40mi past Gary (or 240 from Oshkosh), the form of the equations is exactly the same, except the ratios become 0.025 hours per mile, i.e. the reciprocal of the speed, and you know you got to Portage 1h after Gary.
Finally, 40mph or 0.025hpm are both equal to unity i.e. to 1, so all of this boils down to multiplying by 1. See
here.
* yes I know, so how do you maintain 40mph, because if the odometer is broken it is unlikely that the speedometer is working? You're in 5th gear of my 1993 Ford Ranger and the tachometer is steady at 1333rpm on the 205R15 fully inflated tires so you know it's 40mph, okay? Yes, I know you are lugging my engine; it's got 350kmi on it and it does not care, and neither do I
.