Plotting Unitful Functions

sometimes units are raised to arbitrary non-integer exponents

m^(2/3) is perfectly valid (m = meters), though not if added to something with units of m^(7/2). When the units don’t work out, there is either a mistake in the calculation or an implicit assumption somewhere, e.g., “x must be measured in meters”. A common example is empirical fits (which this might be an example of), where what people do is eyeball a curve and then design a formula that matches it. What people sometimes forget is that the coefficients that emerge from this process must make sense from the standpoint of units.

An alternative to introducing units to 150 and 23400 is instead to realize that when we say “x must be measured in meters,” what we’re actually saying is that we divide by 1m before applying the formula for x. That is to say, x = xu / (1u"m"), where xu is the user-supplied value with arbitrary units of length.

5 Likes