6

Problem Solving with Dimensional Analysis

 1 year ago
source link: https://gregorygundersen.com/blog/2023/02/11/dimensional-analysis/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Problem Solving with Dimensional Analysis

Dimensional analysis is the technique of analyzing relationships through their base quantities. I demonstrate the power of this approach by approximating a Gaussian integral without calculus.

A dimension is a physical quantity that can be measured, while a unit is a specific amount of a physical quantity. For example, time is a dimension, which can be measured in temporal units such as hours or seconds.

Dimensional analysis is the technique of analyzing and simplifying equations by expressing terms using their dimensions rather than their numerical values. Because equations should be dimensionally consistent, meaning that the dimensions on both sides of an equation are equivalent, dimensional analysis is useful for making inferences about functional forms or the dimensions of variables. Note that this is distinct from analyzing units, although that is also a useful problem-solving technique.

In my experience, dimensional analysis is particularly useful when coming at a problem where even the structure or basic terms in the problem are unknown. For example, I often find myself using dimensional analysis when reading unfamiliar code. It does not clarify everything, but it often provides an “initial hook” by allowing me to quickly understand variables’ dimensions or units.

The goal of this post is to demonstrate the power of dimensional analysis by working through the example that first convinced me while reading (Mahajan, 2010): simplifying a Gaussian integral.

Gaussian integral

Consider the integral

I=∫−∞∞​e−ax2dx.(1)

Imagine that we didn’t know calculus. We just think of integrals as sums and dx as “a little bit of x”. And imagine that we had never seen this equation before. Let’s use dimensional analysis to make sense of it.

Perhaps the simplest thing we can say is that both sides of the equation must have the same dimensions. It must be dimensionally valid. Let’s use the notation [x] to denote the dimensions of x rather than its numerical value. We’ll use unity to denote a dimensionless quantity, i.e. [x]=1 means that x is dimensionless. Using this notation, we can express dimensional validity as

[I]=[∫−∞∞​e−ax2dx].(2)

But beyond this, what can we do? The problem is that this problem has no inherent dimensions! If this were a physics problem, perhaps terms would be concretized with units. But here, this is just an abstract mathematical object. However, we can still make progress by assigning an arbitrary dimension to one of the variables and then seeing what that implies. Let’s do this by assigning an arbitrary dimension to x, say L (imagine this is “length”). What does this imply about the dimension of a?

We can see that x and a are related via the exponent. Now note that exponents must be dimensionless quantities. That is because x raised to n is just x multiplied by itself that many times:

xn=x⋅x⋅x⋅⋯⋅xn times.(3)

So n is just a number here, not a dimensioned quantity. In general, the full term xn may have units. If x has dimensions feet, and n=2, then x2 has dimensions ft2 (or area). However, Euler’s number e is actually dimensionless. It’s a mathematical constant, and much like π, it doesn’t make sense to talk about the dimension of e. Thus, we know that −ax2 must have no units, because it’s an exponent, and we know that e−ax2 must be dimensionless because it is merely Euler’s number raised to a dimensionless exponent.

For the exponent to be unitless, this implies that a must have dimension 1/L2, since

[a][x2]=L21​L2=1.(4)

Now that we have the dimensions of a and x, let’s analyze the integral. First, observe that the integral is loosely a summation, and it only makes sense to reason about adding two quantities together if they have the same dimensions, e.g. a length plus a length is another length. So we can think of summation and integration as operations that do not change their arguments’ dimensions. And dx is “a little bit of x” and thus has the same units as x. Here, it has dimension L.

So we can summarize our analysis so far as

[I]=[∫−∞∞​e−ax2dx]=[e−ax2]×[dx]=1×L=L.(5)

Now observe that I is a function of just a. This is because x is a dummy variable, equivalent to xi​ in a sum. So we could write

[f(a)]=[∫−∞∞​e−ax2dx]=L.(6)

What does this imply about the functional form of f? Since a has dimensions L−2, then f(a) must have the functional form

f(a)∼a1​​.(7)

I’ll explain the notation ∼ in the next section, but for now, just think of it as approximately equal. How did we get here? Because both sides of the equation above must be dimensionally consistent, we can see that

[a1​​]=L−21​​=L.(8)

So we used the dimensions of a and f(a) to infer the functional form of f(a)!

Okay, so now for the impressive bit. How good did we do? If we use calculus, we can see that this integral is equal to

∫−∞∞​e−ax2dx=aπ​​.(9)

In my mind, this is pretty cool! Using nothing more than reasoning about the dimensions of our problem and applying some fairly elementary mathematical knowledge, we were able to understand the basic structure of an integral!

Equality up to a dimensionless factor

The notation ∼ means equality up to a factor without dimensions. Equation 7 is equality up to dimensionless factor because we could multiply 1/a​ by a dimensionless factor k and still have Equation 8 hold since

[ak​​]=L−2[k]​​=L.(10)

You might wonder if we could be off by an additive factor, but this is handled by the multiplicative factor k. Why? We cannot add a dimensioned quantity to a dimenionless quantity. (What is 3 feet plus the number 7?) So any additive factor must have dimension L, and is thus absorbed by the dimensionless factor k.

Finally, a note about π in Equation 9. From a purely mathematical point of view, π is just as important as a here. But in many real-world applications, where we want to just use mathematics to make sense of a system, a is typically much more important. It is the dimensioned quantity whose value changes the value of the integral.

Different initial dimensions

One question you might be asking yourself is: did we just get lucky when we picked [x]=L? Wonderfully, no. We could have started anywhere else, and we would have had the same result, because all dimensional analysis is doing is ensuring that equations and their terms are dimensionally consistent.

For example, imagine that we had started with the assumption that the dimension of a was M2/3. Then the same reasoning about exponents implies that

[x]=M−1/3.(11)

The integral then has dimensions M−1/3, and thus so does f(a):

[f(a)]=M−1/3.(12)

So the only dimensionally valid functional form for f(a) is

f(a)∼a​1​,(13)

which is what we inferred previously.

In my mind, this really highlights the power of dimension analysis. If we don’t understand a problem at all, we can still start by assigning arbitrary dimensions and then using those dimensions to make basic inferences about the shape of our problem. And of course, when we do have more context, dimensional analysis is even easier.

A harder problem

Let’s conclude by exploring a similar problem but one in which dimensional analysis fails. Consider the Gaussian integral in Equation 1 but with a=1:

I=∫−∞∞​e−x2dx.(14)

Here, we must immediately infer that −x2 is dimensionless, since it is an exponent, and thus x is dimensionless. In other words, while this problem looks quite similar to our earlier problem, we are immediately stuck. Perhaps we could have a moment of insight and actually introduce a dimensioned quantity a, but that would not help us much, since we could only use dimensional analysis to infer that

f(a)∼a1​​=1.(15)

In fact, the real value of the integral is π​. We would still only be wrong up to a dimensionless factor, but this is not as satisfying as our earlier result. The point here is that dimensional analysis, like any tool, has particular uses and limitations. Despite this, I think it is still a useful tool to have in one’s problem-solving toolbelt.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK