Communities

tag:snake search within a tag
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
created:<1w created < 1 week ago
post_type:xxxx type of post
Q&A

Should I always write units in equation no matter if it looks like variable?

+5
−0

I am not sure if it is suitable in the site. I am asking the question here cause Olin and Celtschk said it here.

They told me to use unit in every "single line" (Nope! They didn't say like it. Olin said to always separate number and units. And Celtschk said to write units in middle lines).

I was doing a simple problem, and I noticed units may disturb my equation.

$$S=ut+\frac{1}{2}at^2$$

I am just putting a random value in $a$ and $t$

$$S=5u+\frac{1}{2} \cdot 2 \ ms^{-2} \cdot 5 \ s$$

I can write that

$$S=5u+\frac{1}{2}\cdot 10 \ ms^{-1}$$

In these equations, ms^{-1} is looking like a value (like as $u$) rather than unit. But if I had put a number instead of $u$ than the equation might look better. But when there's variable the units isn't looking better. What to do in these cases?

Why does this post require moderator attention?
You might want to add some details to your flag.
Why should this post be closed?

In general, or with Mathjax? (2 comments)

+6
−0

In short: Yes. And there are standard ways to distinguish variables from units.

Let me explain in detail. In physics, we deal with physical properties of objects and systems. Those quantities can be split down into quantites, that is, properties that can be quantified. To quantify basically means to tell how large the quantity is.

A quantity always has a certain physical dimension like length or mass (note that this use of “dimension” is separate from the use in geometry; e.g. space has three geometric dimensions, but all those geometric dimension have the same physical dimension, which may be denoted as “length” or ”distance”).

Now to describe a quantity, we give it as multiple of a unit, which is just a predefined quantity of known size. The most obvious example is the kilogram, which until 2019 literally was the mass of the international kilogram prototype. That is, by definition, an object had a mass of one kilogram if its mass was equal to the mass of that prototype. Now most other units (and now, also the mass) are defined in a more indirect way, but the same principle holds: The unit is just a specific quantity. Note that the SI units are not the only units in use; for example, in astronomy, units like the astronomical unit (the average distance between Earth and Sun) or the parsec (the distance from which the Earth radius is seen in an angle of one arc second) are commonly used. But again, those are simply defined quantities.

Now when giving the size of some arbitrary quantity, we give it as multiple of an unit. For example, if we say an object has the mass of 2 kilograms ($2\,\mathrm{kg}$), we say that the mass is twice as large as the kilogram. The numeric factor is sometimes referred to as the value of the quantity, but note that the value only makes sense in combination with a unit, and depends on it. A mass of 2 kilograms is very different from a mass of 2 grams, of 2 atomic mass units, or of 2 solar masses. Rather a mass of 2 kilograms is the same as a mass of 2000 grams. Or as equation: $2\,\mathrm{kg} = 2000\,\mathrm{g}$. Note that if we omitted the units here, we'd get the nonsensical equation $2=2000$.

Now let's come to constants and variables. Constants are, as their name suggests, assumed to be constant. Some are dimensionless (that is, a pure number without any unit, like the mathematical constant $\pi$ or the fine structure constant $\alpha$), others are actual physical quantities (like the vacuum speed of light $c$, which has the dimension of a velocity). Note that the latter can be used as units, if we desire so; indeed every unit is ultimately a constant; the difference between a unit and another constant is simply that we've decided to give quantities as multiples of that unit. Indeed, the speed of light is quite often used as a unit; whenever you give a speed as, say, “half the speed of light”, you are using the speed of light as a unit. As formula, you'd write $v=\tfrac{1}{2} c$.

A variable also denotes a quantity, but one that is not constant. It may depend on the time, or it may be a function of the specific system you are looking at (like the lattice constant of a crystal). Note that if you are looking at only one specific system separately, and the variable is actually fixed by the system (such as the lattice constant if you don't consider varying temperature or pressure), you can treat it as constant in that specific consideration (and possibly even use it as a unit).

So in short, a unit is just a constant that we decided to write other quantities as multiples of, a constant in turn is just a variable that doesn't change in the system under consideration, and a variable is just a symbol denoting some quantity.

Now on omitting units in intermediary steps (more exactly, on run-on equalities, as the one you had in the post I had commented on).

A run-on equality is just a chain of equalities that is true at the same time. That is, $a=b=c=d$ is the same as $a=b \text{ and } b=c \text{ and } c=d$. Therefore omitting units in the middle is exactly the same as omitting units at the beginning or end.

Note that you don't write units on variables as those are already describing quantities. You are writing units on numbers to turn them into quantities. Remember that units are nothing but constants we decided to use as reference, that is, $m=3\,\mathrm{kg}$ means, quite literally, the mass $m$ is the same as 3 times the mass of one kilogram. Omitting the $\rm kg$ gives the equation $m=3$ which makes no sense if $m$ is supposed to denote a mass (a mass cannot be equal to the number 3, it can only be equal to three times another mass).

To make a different example, let's assume you wanted to derive the formula for the kinetic energy of a constantly accelerated object at time $t$. The correct derivation of course is: $$E = \frac{1}{2}mv^2 = \frac{1}{2} m(at)^2$$ Now imagine that someone decided to omit the constant mass factor in the middle, and wrote: $$E = \frac{1}{2}v^2 = \frac{1}{2} m(at)^2$$ I guess you'll immediately recognize that as wrong, as the energy is not $\frac{1}{2}v^2$ but $\frac{1}{2}mv^2$, also where does the $m$ pop up in the last equation again?

Omitting the units in the middle is exactly the same. You are omitting a constant (remember again, an unit is nothing but a constant quantity) in an equation. Omitting a constant from an equation generally will make the equation wrong.

Now there is one apparent problem, and that is that the standard letters used to denote certain quantities are the same as the letters used for certain units (which in general are not even of the same dimension). Well, there are several ways one typically deals with that (apart from the fact that context usually makes it clear what is meant anyway).

First, it is generally a good idea to separate general expressions involving variables from expressions involving explicit values. For example, you'd write all variables on the left hand side of an equation, and all explicit quantities on the right hand side. So e.g. instead of writing $x = 10\,\mathrm{m}/\mathrm{s}\cdot t$ you might write $x/t = 10\,\mathrm{m}/\mathrm{s}$.

Another way to distinguish quantities is to use the fact that units are, by convention, always preceded by numbers. Thus by writing $x = t\cdot 10\,\mathrm{m}/\mathrm{s}$, it is absolutely clear that $t$ is not an unit, while $\mathrm{m}/\mathrm{s}$ likely is intended to be one.

Finally, in typeset material (print, online), there is the convention that SI units are always written in upright (“roman”) typeface, while variables are written in italics. Thus $3m$ denotes three times a mass (if $m$ is a mass appearing in the problem at hand), while $3\,\rm m$ denotes the distance of 3 meters (note also the more subtle typographical convention of leaving a thin space between the number and the unit). You might have noticed that I've consistently used this convention in my answer. To get this effect in LaTeX/Mathjax, use \mathrm{}.

Why does this post require moderator attention?
You might want to add some details to your flag.

+4
−0

You are somewhat misquoting what I said. It would help if you provide a link to the comments you are asking about, but the issue was most likely about lack of units on numeric values, not variables.

A number is dimensionless unless you explicitly provide units. A variable can be defined to have certain dimension, and possibly specific units. Of course, you then need to define your variables properly.

For example, Ohm's law can be expressed:

V = I R

where V is EMF (the electro-motive force), I is current, and R is resistance. Note that this only specifies the dimension of each variable, not the specific units. If it is clearly understood that the variables represent only the physical properties, not specific units, then I think this is OK. I'm not sure what the "right" procedure is. Others here should know this better than I do.

If in doubt, you could always write it as:

V ∝ I R

Again, I'm not sure if that's generally required by convention or not.

However, if the variables are defined to have specific units, then you have to write the equation with whatever conversion constant might be required. For example, if V is EMF in Volts, I current in Amperes, and R resistance in Ohms, then

V = I R

Is correct in all cases. That is because in this case the proportionality constant happens to be 1.

Now let's say you have determined the equation and want to solve for the numeric value of a particular case. Let's say you have 25 mA thru a 140 Ω resistor. In this case, you must show the units:

(25 mA)(140 Ω) = 3.5 V

Just writing

0.025 ⋅ 140 = 3.5

is technically correct, but says absolutely nothing about current, resistance, and voltage. The following is just downright wrong:

0.025 ⋅ 140 = 3.5 V         WRONG!

This equation is claiming that the product of two dimensionless quantities results in a value in Volts.

I looked thru some comments and found one example you might be referring to. Note that this answer was edited after my comment was written. Originally you wrote:

m = 20 g
m = 20 x 103

Clearly both those two statements are inconsistant with each other. The first says that m has dimension of mass, since it has the value of 20 grams. The second says m is dimensionless since it has the value of just a number (20,000). We don't have to look at the numeric values to see that something is wrong.

Why does this post require moderator attention?
You might want to add some details to your flag.