- #1
- 2,006
- 981
Greg Bernhardt submitted a new PF Insights post
Make Units Work for You
Continue reading the Original PF Insights Post.
Make Units Work for You
Continue reading the Original PF Insights Post.
Thanks,Greg Bernhardt said:Great first Insight @scottdave!
These techniques can definitely be applied to more complex calculations. It is probably more critical to use these methods in those situations.Charles Link said:I have an additional comment or two. I like the way @scottdave shows the conversion by multiplying by 1, as in the example with ## 1=\frac{2.54 \, cm}{1 \, inch} ##. There is one other thing that I find useful in doing some of the more difficult conversions, and that is to write the quantity such as length ## \vec{L} ## as a vector. In that case ## \vec{L}=L_{cm} \hat{cm}=L_m \hat{meter} ##. We can solve for ## L_{cm} ## in terms of ## L_m ## if we know that ## 1 \hat{meter}=100 \hat{cm} ##. In that case ## L_{cm}=100 \, L_m ##. This kind of thing comes in handy, e.g., in converting E&M (electricity and magnetism) quantities in c.g.s. to M.KS. and visa versa. This is a more advanced application, but on occasion, it is useful also on simpler conversions.
Interesting point, @Mister T. I see where you are coming from. The point that I intended was it is easier to figure out if the factor by going through and setting 2.54 cm equal to 1 inch. Then, you can have either (2.54 cm) / (1 in) or (1 in) / (2.54 cm), depending on which way you need to go. I believe this is easier than trying to remember "If I want to convert from centimeters to inches, then divide by 2.54".Mister T said:Let's try getting the LaTeX coding right one more time ...
I meant to say that I prefer not using expressions like $$frac{2.54 mathrm{cm}}{1 mathrm{m}}=1$$
But instead prefer $$frac{2.54 mathrm{cm}}{1 mathrm{m}}$$
Mister T said:I like everything about your article, but there is one point of contention I would like to make. Setting these ratios equal to ##1## is a matter of preference, and I prefer to follow the advice of Arnold Arons and :sedulously avoid" it.
What you wrote would be a source of confusion for anyone.Mister T said:I understand the motivation for using it, which is to imply that it's okay to use it as a multiplicative factor in the same way that it's okay to use ##1## as a multiplicative factor. But expressions like $$frac{2.54 mathrm{cm}{1 mathrm{m}}=1$$ can be a source of confusion for learners.
Except that 2.54 cm is NOT equal to 1 m.Mister T said:I think it better to simply state that multiplying by the factor $$frac{2.54 mathrm{cm}{1 mathrm{m}}$$ is a perfectly acceptable practice.
If you accept, say, that 2.54 cm represents the same lengh as 1 inch, then we can write 2.54 cm = 1 in, recognizing that we're talking about the same length measure, but with different units. It follows that the ratio ##\frac{2.54 \text{ cm}}{1 \text{ inch}}## is dimensionless and equal to 1. Being 1, we can multiply whatever we want by it without changing the underlying value of what it is multiplying.Mister T said:After all, it is not the same thing as multiplying by ##1## because it has the effect of changing the units.
Mister T said:But I realize that this is entirely a matter of preference. I have a colleague who disagrees, stating that students are likely to encounter it presented that way. But I disagree.
Reference https://www.physicsforums.com/insights/make-units-work/
scottdave said:Interesting point, @Mister T. I see where you are coming from. The point that I intended was it is easier to figure out if the factor by going through and setting 2.54 cm equal to 1 inch. Then, you can have either (2.54 cm) / (1 in) or (1 in) / (2.54 cm), depending on which way you need to go. I believe this is easier than trying to remember "If I want to convert from centimeters to inches, then divide by 2.54".
It seems that LaTeX works differently in the comment section than in regular posts? At least on this browser.
That would be a way to think about it, or as vectors of certain lengths, as @Charles Link stated in his post.DS2C said:This is so useful for me. I've watched a bunch of videos on it and this explains it much better. So are you treating the units like variables essentially?
"Make Units Work for You - Comments" refers to the practice of using comments in programming code to clearly indicate the units of measurement being used within the code. This helps to ensure accuracy and consistency in calculations and conversions.
Using comments for units helps to avoid confusion and errors in programming code. It also makes the code more readable and easier to understand for other developers who may need to work with the code in the future.
Some common units used in programming include length (e.g. inches, meters), time (e.g. seconds, minutes), mass (e.g. grams, kilograms), and temperature (e.g. Celsius, Fahrenheit). There are also many other specialized units used in different fields and industries.
Units should be written in all capital letters and enclosed in curly braces, with a space between the value and the unit. For example, {5 METERS} or {100 KILOGRAMS}.
Yes, there are various online tools and libraries that can assist with converting units and formatting them in comments. Some popular ones include the Units.js library and the ConvertUnits website.