Just a quick check : the celsius-farenheit conversion is in this form. The Kelvin/Celsius conversion is in this form. Calories and Joules. And so on. Am I missing any? I’m referring to conversions between a unit and another identical unit of the same kind. (as in energy, power, torque, mass, etc from one set of units to another)
Most unit conversions are just x*constant. This is because most unit conversions involve multiplication by different forms of 1. The ones that aren’t like this are because the scale shifts, as in going from ion concentrations to pH or because the scales don’t start at 0, as with temperature. So there are some counterexamples to your idea, but they are somewhat specialized.
Decibels might be a counterexample, depending on how you look at it. If you’re converting a power P to a power in decibels P[sub]db[/sub], then:
P[sub]db[/sub] = 10 log[sub]10/sub
For dimensions like mass or distance where you can add two measurements together, we expect that if we convert measurements to another unit before doing the addition and convert back afterwards, we get the same numerical result that we would get just adding the original measurements together.
E.g. if we have two distances d1 = 2 km and d2 = 5km, we could say that d3 := d1 + d2 = 7km. Or we could convert to miles and say that d1 = 1.25mi, d2 = 3.125mi, so d3 = 4.375mi, which, if you convert it, is 7km.
So it doesn’t matter whether you did the addition in km or miles (or angstroms or light-years) – you end up with the same result. The only way this round tripping can happen is if the unit conversion amounts to multiplying by a constant.
Temperature gets a pass because adding two temperatures together isn’t a meaningful operation. The same with more exotic scales like pH or Richter.
If you count the usual concept of fuel economy/consumption as “the same kind,” then there’s a counterexample:[ul][]x miles per gallon = 112903/(480x*) ≈ 235/x liters per 100 km[/ul]Converting mpg to km/L follows the normal rules.
[quote=“Kimble, post:5, topic:725984”]
If you count the usual concept of fuel economy/consumption as “the same kind,” then there’s a counterexample:[ul][li]x miles per gallon = 112903/(480x) ≈ 235/x liters per 100 km[/ul]Converting mpg to km/L follows the normal rules.[/li][/QUOTE]
Lots more examples if you include this kind of thing. Conductance–measured in mhos/siemens–is just the inverse of resistance, measured in ohms. Frequency, in hertz, is just inverse wavelength (in meters) times the speed of light.
From a mathematical point of view, as long as all the variables have an exponent of 1 (i.e. no exponential functions) then yes, they’re just simple ratios. And if they do have exponents then they’re not particularly relatable units (i.e. comparing length with area).
Reason I was asking is for an upcoming project they want some unit conversions (not specified exactly, depends on more details of the system not yet handed over in the documents) done via a microcontroller at high speeds. A particular microcontroller has a MAC (multiply-accumulate) and a multiple subtract instruction, which implements (in integer math) the above. So I was thinking I could possibly make the unit conversions faster this way.
It’s often important that for quantities A,B and C, if A+B = C in some units then it is desirable for A+B = C in other units. This means that in conversions between units will be often in the form of f(x) = ax + b where a and b are constants.
Of course that’s not to say that there aren’t counterexamples.
Arguably, all “proper” units are by definition convertible to other units of the same kind through multiplication alone since, as RadicalPi said, the conversion factors are really just different ways of expressing the number 1.
Celsius and Fahrenheit are weird ones because they are both units and scales. 0 C is 273 kelvin, but it is also 273 degrees Celsius above absolute zero. The unit of a degree Celsius is perfectly cromulent, and convertible to a degree Fahrenheit through a 9/5 multiplier, but if you have a given temperature on the Celsius scale, you then need to account for the offset.
It’s all a bit weird since in normal speech we don’t differentiate between a unit and its scale, and so “100 C” ends up being ambiguous, since it could mean the boiling point of water or an interval of 100 degrees. Usually the difference will be apparent in context, but not always.
I suspect the ax+b operation will be sufficient for you, but it really does depend on the spec and what they consider to be a real unit.
Ditto for kelvin-celsius. In that case, the scale is the same, but the 0 point is different. So you do need the instruction x*y ± z
The conversions OP describes, ax + b, are called linear transformations, meaning the conversion function is a simply polynomial with degree of 1 (i.e., no exponents higher than 1). In specifying conversions “between a unit and another identical unit of the same kind”, OP is pretty much specifying, by definition, that he is only talking about this sort of conversion. A graph of such a conversion is a straight line with some particular slope, where a is that slope (hence the jargon “linear”). Conversion of temperatures, Celsius to/from Fahrenheit, is an example of this.
If the constant b is furthermore zero, then we have a homogeneous transformation. As others have noted above, most of the sorts of conversions OP is talking about are of this kind. A notable fact about such conversions is that the ZERO value on each scale is equal to the ZERO value on the other scale. A graph of such a conversion is a straight line of slope a that furthermore passes through the origin (0, 0).
Wherever the conversion is NOT like one of the above (for example, borschevsky’s remark about converting power to decibels), then you are not really exactly dealing with conversion of “identical unit of the same kind”, unless you count conversion from a linear scale to a logarithmic scale to be units of the same kind.
Doesn’t this work only for homogeneous conversions (as defined just above), where the conversion is f(x) = ax without any constant b term?
Thank-you.
Ok, so far we’ve got Reciprocal and Logarithmic exceptions. Just out of interest, can anyone think of a non-linear coversion of a different class?
The Richter scale used to measure the magnitude of earthquakes is another logarithmic scale. That said, it appears that all seismic scales are logarithmic so arguably there’s no conversion to a linear scale.
Well, you could convert, say, Richter to joules. It’s very seldom done, but you could.
For a more common example, stellar magnitudes are also logarithmic, and it’s very often useful to convert between bolometric magnitude and watts.
And for yet another nonlinear scale, that doesn’t fit any particular formula, there’s the Mohs hardness scale, which is set by ten reference points, with interpolation in between. 1-9 (talc through corundum, IIRC) is pretty close to linear (i.e., Mohs 4 really is about twice as hard as Mohs 2, and Mohs 6 is about three times as hard, and so on), but diamond is off the scale, being dozens of times harder than a 9.
Also come to think of it, there are other scales that work the same way, with interpolation between some number of reference points. Stellar spectral types are the same way, with OBAFGKM corresponding to different temperatures.
Picking upon this …
The more fundamental the attribute being measured, the more likely we’ll have a linear scale and linear units. Which implies simple Y=mx+b conversions.
The higher up the abstraction scale, the more likely that other considerations intrude. So there are many scales that are logarithmic or exponential. But typically they’re measuring some quantity which is itself not a fundamental unit, but a consequential effect of the application of fundamental units. e.g. deciBels of sound pressure are a consequential effect of joules of energy applied to a gaseous (or liquid) medium.
A higher level yet are the categorical units as **Chronos **points out. Mohs hardness & stellar magnitude are good examples. Others might be the Saffir-Simpson scale for hurricanes and the various Fujita scales for tornadoes. Now we’re measuring a consequence of a consequence of fundamental units in action. So in general competing versions of these scales have complex or arbitrary conversion functions to the other competing version(s).
Light can be characterized in terms of its wavelength or of the energy of the photons. These aren’t relatable by a linear transformation – they’re inversely related. Photon energy is proportional to the frequency of the light wave, and the frequency times the wavelength gives you the speed of light in the medium, which is a constant.
So it’s not trivial to convert between wavelength and energy/frequency. It’s even worse trying to relate bandwidth (in wavelength) at a certain wavelength to bandwidth (in frequency) at a given frequency. You have to factor in the wavelength itself. They used to have little special slide rules that laser jocks used to relate between the two kinds of bandwidths.
Nitpick/clarification: it can make sense to add temperatures, or at least, two quantities expressed in thermal degrees. There are two kinds of temperatures: absolute ones and relative ones. Absolute ones are the answer to the question “What’s the temperature outside?” But relative ones make sense, too: “Turn the thermostat up 2 degrees.” The latter is certainly adding temperatures: the result will be the thermostat set to a new value that is the old value plus two, where both are in terms of degrees (C or F), but only the first is absolute (or to put it better, relative to an implicit reference.) It’s common to compute temperatures as sums of terms, such as initial temperature plus increase in heat constant times specific heat, the latter term being in degrees.
It’s true of decibels, too. Whenever we’re talking about absolute decibels, we’re careful to cite the scale, such as dB SPL or dBu or dBV or (rarely these days) dBm. Each of these is decibels relative to some standard (respectively, in sound pressure level, volts modern pro scale, volts older “pro-am” scale, or milliwatts). But once we’ve established what scale we’re talking about, we can then talk about raising or lowering by dimensionless dB, since dB convey a ratio and is therefore dimensionless. (For that reason, the ones without a reference aren’t really even “units”. They’re just ratios.)
You can’t convert dB to any other measurement unless the reference is specified (dB SPL, dBu, etc.)
dB could be applied to just about any type of measurement where exponential scales are useful (e.g., values of growth stocks, hardness of materials.) The fact that they aren’t is merely a matter of history.
Why are dB used for sound and audio signals? For the simple reason that it’s the way our ears+brains work. There’s a sort of log function going on in our perception, so that the amplitude or power has to increase logarithmically to get an apparent linear increase in volume. This is true for light as well, but I have no idea how lighting engineers discuss lighting values.
The B is for bel, named after Alexander Bell. We use decibels (dB) simply because they’re handy; a 1 dB increase is barely noticeable; a 10dB increase is twice as loud to most people.