Dimensional analysis
Dimensional analysis is a conceptual tool often applied in physics, chemistry, and engineering to understand physical situations involving a mix of different kinds of physical quantities.  It is routinely used by physical scientists and engineers to check the plausibility of derived equations and computations. It is also used to form reasonable hypotheses about complex physical situations that can be tested by experiment or by more developed theories of the phenomena.
The  Buckingham  theorem is of central importance to dimensional analysis. This theorem describes how every physically meaningful equation involving n variables can be equivalently rewritten as an equation of n  m dimensionless parameters, where m is the number of fundamental dimensions used. Furthermore, and most importantly, it provides a method for computing these dimensionless parameters from the given variables.

# Introduction
The dimensions of a physical quantity are associated with combinations of mass, length, time, electric charge, and temperature, represented by symbols M, L, T, Q, and  (respectively) each raised to rational powers.  As examples, the dimension of the physical quantity speed is "distance/time" (L/T or LT 1), and the dimension of the physical quantity force is "massacceleration" or "mass(distance/time)/time" (ML/T 2 or MLT 2).  In principle, other dimensions of physical quantity could be defined as "fundamental" (such as momentum or energy or electric current) in lieu of some of those shown above. Some physicists have not recognized temperature, , as a fundamental dimension of physical quantity since it essentially expresses the energy per particle per degree of freedom which can be expressed in terms of energy (or mass, length, and time).  Still others do not recognize electric charge, Q, as a separate fundamental dimension of physical quantity, since it has been expressed in terms of mass, length, and time in unit systems such as the electrostatic cgs system. There are also physicists who have cast doubt on the very existence of incompatible fundamental dimensions of physical quantity
The unit  of a physical quantity and its dimension are related, but not precisely identical concepts.  The units of a physical quantity are defined by convention and related to some standard; e.g. length may have units of meters, feet, inches, miles or micrometres;  but any length always has a dimension of L, independent of what units are arbitrarily chosen to measure it.  Two different units of the same physical quantity have conversion factors between them.  For example: 1 in = 2.54 cm;  then (2.54 cm/in) is called a conversion factor (between two representations expressed in different units of a common quantity) and is itself dimensionless and equal to one.  There are no conversion factors between dimensional symbols.
Dimensional symbols, such as L, form a group:  there is an identity, L0=1; there is an inverse to L, which is 1/L or L1, and L raised to any rational power p is a member of the group, having an inverse of Lp or 1/Lp.  The operation of the group is multiplication, with the usual rules for handling exponents (Ln  Lm = Ln+m).
In mechanics, the dimension of any physical quantity can be expressed in terms of base dimensions M, L and T. This is not the only possible choice, but it is the one most commonly used. For example, one might choose force, length and mass as the base dimensions (as some have done), with associated dimensions F, L, M. The choice of the base set of dimensions is thus partly a convention, resulting in increased utility and familiarity. It is, however, important to note that the choice of the set of dimensions is not just a convention; for example, using length, velocity and time as base dimensions will not work well, because there's no way to obtain mass  or anything derived from it, such as force  without introducing another base dimension, and velocity, being derived from length and time, is redundant.
Depending on the field of physics, it may be advantageous to choose one or another extended set of dimensional symbols. In electromagnetism, for example, it may be useful to use dimensions of M, L, T, and Q, where Q represents quantity of electric charge.  In thermodynamics, the base set of dimensions is often extended to include a dimension for temperature, .  In chemistry  the number of moles of substance (loosely, but not precisely, related to the number of molecules or atoms) is often involved and a dimension for this is used as well. The choice of the dimensions or even the number of dimensions to be used in different fields of physics is to some extent arbitrary, but consistency in use and ease of communications are important.
In the most primitive form, dimensional analysis may be used to check the plausibility of physical equations:  the two sides of any equation must be commensurable or have the same dimensions, i.e., the equation must be dimensionally homogeneous.  As a corollary of this requirement, it follows that in a physically meaningful expression, only quantities of the same dimension can be added or subtracted. For example, the mass of a rat and the mass of a flea may be added, but the mass of a flea  and the length of a rat cannot be meaningfully added.  Physical quantities having different dimensions cannot be compared to one another either. For example, "3 m > 1 g" is not a meaningful expression.
Only like-dimensioned quantities may be added, subtracted, compared, or equated. When unlike dimensioned quantities appear opposite of the "+" or "" or "=" sign, that physical equation is not plausible, which might prompt one to correct errors before proceeding to use it. When like-dimensioned quantities or unlike dimensioned quantities are multiplied or divided, their dimensional symbols are likewise multiplied or divided. When dimensioned quantities are raised to a rational power, the same is done to the dimensional symbols attached to those quantities.
Scalar arguments to exponential, trigonometric, logarithmic, and other transcendental functions must be dimensionless quantities. This requirement is clear when one observes the Taylor expansions for these functions (a sum of various powers of the function argument). For example, the logarithm of 3 kg is undefined even though the logarithm of 3 is nearly 0.477. An attempt to compute ln 3 kg would produce
which is dimensionally incompatible, requiring the argument of transcendental functions to be dimensionless.
The value of a dimensional physical quantity Z is written as the product of a unit  within the dimension and a dimensionless numerical factor, n.
Strictly, when like dimensioned quantities are added or subtracted or compared, these dimensioned quantities must be expressed in consistent units so that the numerical values of these quantities may be directly added or subtracted.  But, conceptually, there is no problem adding quantities of the same dimension expressed in different units.  For example, 1 meter added to 1 foot is a length, but it would not be correct to add 1 to 1 to get the result.  A conversion factor, which is a ratio of like dimensioned quantities and is equal to the dimensionless unity, is needed:
The factor  0.3048 \ \frac{\mbox{m}}{\mbox{ft}}  is identical to the dimensionless 1, so multiplying by this conversion factor changes nothing.  Then when adding two quantities of like dimension, but expressed in different units, the appropriate conversion factor, which is essentially the dimensionless 1, is used to convert the quantities to identical units so that their numerical values can be added or subtracted.
Only in this manner is it meaningful to speak of adding like dimensioned quantities of differing units.
Dimensional analysis is also used to derive relationships between the physical quantities that are involved in a particular phenomenon that one wishes to understand and characterize.  It was used for the first time (Pesic, 2005) in this way in 1872 by Lord Rayleigh, who was trying to understand why the sky is blue.

## A simple example
What is the period of oscillation T of a mass m attached to an ideal linear spring with spring constant k suspended in gravity of strength g?
The four quantities have the following dimensions:  T  ;  m  ; k ; and  g . From these we can form only one dimensionless product of powers of our chosen variables, G_1 = T^2 k/m.  The dimensionless product of powers of variables is sometimes referred to as a dimensionless group of variables, but the group, G_1, referred to means "collection" rather than mathematical group.  They are often called dimensionless numbers as well.
Note that no other dimensionless product of powers involving g with k, m, T, and g alone can be formed, because only g involves L . Dimensional analysis can sometimes yield strong statements about the irrelevance of some quantities in a problem, or the need for additional parameters. If we have chosen enough variables to properly describe the problem, then from this argument we can conclude that the period of the mass on the spring is independent of g: it is the same on the earth or the moon. The equation demonstrating the existence of a product of powers for our problem can be written in an entirely equivalent way:  T = \kappa \sqrt{m/k}, for some dimensionless constant .
When faced with a case where our analysis rejects a variable (g, here) that we feel sure really belongs in a physical description of the situation, we might also consider the possibility that the rejected variable is in fact relevant, and that some other relevant variable has been omitted, which might combine with the rejected variable to form a dimensionless quantity. That is, however, not the case here.
When dimensional analysis yields a solution of problems where only one dimensionless product of powers is involved, as here, there are no unknown functions, and the solution is said to be "complete."

## A more complex example
Consider the case of a vibrating wire of length l  vibrating with an amplitude A .  The wire has a linear density of   and is under tension s , and we want to know the energy, E , in the wire.  Now we can easily find that we can form two dimensionless products of powers of the variables chosen,  \pi_1 = E/As and \pi_2 = \ell/A.  Perhaps surprisingly, like the g in the simple example given above, the linear density of the wire is not involved in either.  
The two groups found can be combined into an equivalent form as an equation
where F is some unknown function, or, equivalently as
where f is some other unknown function.  Here the unknown function implies that our solution is now incomplete, but dimensional analysis has given us something that may not have been obvious:  The energy is proportional to the first power of the tension.  Barring further analytical analysis, we might proceed to experiments to discover the form for the unknown function f.  But our experiments are simpler than in the absence of dimensional analysis.  We'd perform none to verify that the energy is proportional to the tension.  Or perhaps we might guess that the energy is proportional to \ell, and so infer that E = \ell s.  The power of dimensional analysis as an aid to experiment and forming hypotheses becomes evident.
The power of dimensional analysis really becomes apparent when it is applied to situations, unlike those given above, that are more complicated, the set of variables involved are not apparent, and the underlying equations hopelessly complex.  Consider for example, a small pebble sitting on the bed of a river.  If the river flows fast enough, it will actually raise the pebble and cause it to flow along with the water.  At what critical velocity will this occur?  Sorting out the guessed variables is not so easy as before.  But dimensional analysis can be a powerful aid in understanding problems like this, and is usually the very first tool to be applied to complex problems where the underlying equations and constraints are poorly understood.

# Huntley's extension
Huntley (Huntley, 1967) has claimed that it is sometimes productive to refine our concept of dimension. Two possible refinements are:
- The magnitude of the components of a vector are to be considered dimensionally distinct. For example, rather than an undifferentiated length unit L, we may have L_x represent length in the x direction, and so forth. This requirement stems ultimately from the requirement that each component of a physically meaningful equation (scalar, vector, or tensor) must be dimensionally consistent.
- Mass as a measure of quantity is to be considered dimensionally distinct from mass as a measure of inertia.
As an example of the usefulness of the first refinement, suppose we wish to calculate the distance a cannon ball travels when fired with a vertical velocity component V_y and a horizontal velocity component V_x, assuming it is fired on a flat surface. Assuming no use of directed lengths, the quantities of interest are then V_x, V_y, both dimensioned as L/T, R, the distance travelled, having dimension L, and g the downward acceleration of gravity, with dimension L/T^2
With these four quantities, we may conclude that the equation for the range R may be written:
Or dimensionally
from which we may deduce that a+b+c=1 and a+b+2c=0 which leaves one exponent undetermined. This is to be expected since we have two fundamental quantities L and T and four parameters, with one equation.
If, however, we use directed length dimensions, then V_x will be dimensioned as L_x/T, V_y as L_y/T, R as L_x and g as L_y/T^2. The dimensional equation becomes:
and we may solve completely as a=1, b=1 and c=-1. The increase in deductive power gained by the use of directed length dimensions is apparent.
In a similar manner, it is sometimes found useful (e.g., in fluid mechanics and thermodynamics) to distinguish between mass as a measure of inertia (inertial mass), and mass as a measure of quantity (substantial mass). For example, consider the derivation of Poiseuille's Law. We wish to find the rate of mass flow of a viscous fluid through a circular pipe. Without drawing distinctions between inertial and substantial mass we may choose as the relevant variables
- \dot{m} the mass flow rate with dimensions M/T
- p_x the pressure gradient along the pipe with dimensions M/L^2T^2
- \rho the density with dimensions M/L^3
- \eta the dynamic fluid viscosity with dimensions M/LT
- r the radius of the pipe with dimensions L
There are three fundamental variables so the above five equations will yield two dimensionless variables which we may take to be \pi_1=\dot{m}/\eta r and \pi_2=p_x\rho r^5/\dot{m}^2 and we may express the dimensional equation as
where C and a are undetermined constants. If we draw a distinction between inertial mass with dimensions M_i and substantial mass with dimensions M_s, then mass flow rate and density will use substantial mass as the mass parameter, while the pressure gradient and coefficient of viscosity will use inertial mass. We now have four fundamental parameters, and one dimensionless constant, so that the dimensional equation may be written:
where now only C is an undetermined constant (found to be equal to \pi/8 by methods outside of dimensional analysis). This equation may be solved for the mass flow rate to yield Poiseuille's law.

# Siano's extension: Orientational analysis
Huntley's extension has some serious drawbacks. It does not deal well with vector equations involving the cross product, nor does it handle well the use of angles as physical variables.  It also is often quite difficult to assign the L, L_x, L_y, L_z symbols to the physical variables involved in the problem of interest.  He invokes a procedure that involves the "symmetry" of the physical problem.  This is often very difficult to apply reliably:  it is unclear as to what parts of the problem that the notion of "symmetry" is being invoked.  Is it the symmetry of the physical body that forces are acting upon, or to the points, lines or areas at which forces are being applied?  What if more than one body is involved with different symmetries?  Consider the spherical bubble attached to a cylindrical tube, where one wants the flow rate of air as a function of the pressure difference in the two parts.  What are the Huntley extended dimensions of the viscosity of the air contained in the connected parts?  What are the extended dimensions of the pressure of the two parts?  Are they the same or different?  These difficulties are responsible for the limited application of Huntley's addition to real problems.
Angles are conventionally considered to be dimensionless variables, and so the use of angles as physical variables in dimensional analysis can give less meaningful results. As an example, consider the projectile problem mentioned above. Suppose that, instead of the x-  and y-components of the initial velocity, we had chosen the magnitude of the velocity v and the angle \theta at which the projectile was fired. The angle is conventionally considered to be dimensionless, and the magnitude of a vector has no directional quality, so that no dimensionless variable can be composed of the four variables g, v, R, and . Conventional analysis will correctly give the powers of g and v, but will give no information concerning the dimensionless angle .
Siano (Siano, 1985-I, 1985-II) has suggested that the directed dimensions of Huntley be replaced by using orientational symbols 1_x,\;1_y,\;1_z to denote vector directions, and an orientationless symbol 1_0\,. Thus, Huntley's L_x becomes L\,1_x with L specifying the dimension of length, and 1_x specifying the orientation. Siano further shows that the orientational symbols have an algebra of their own.  Along with the requirement that 1_i^{-1}=1_i, the following multiplication table for the orientation symbols results:
\begin{matrix}
\mathbf{1_0}&1_0&1_x&1_y&1_z\\
\mathbf{1_x}&1_x&1_0&1_z&1_y\\
\mathbf{1_y}&1_y&1_z&1_0&1_x\\
\mathbf{1_z}&1_z&1_y&1_x&1_0
\end{matrix}
Note that the orientational symbols form a group (the Klein four-group or "viergruppe"). In this system, scalars always have the same orientation as the identity element, independent of the "symmetry of the problem."  Physical quantities that are vectors have the orientation expected:  a force or a velocity in the x-direction has the orientation of 1_x.  For angles, consider an angle  that lies in the z plane.  Form a right triangle in the z plane with  being one of the acute angles.  The side of the right triangle adjacent to the angle then has an orientation 1_x and the side opposite has an orientation 1_y.  Then, since tan() = ly/lx =  + ... we conclude that an angle in the xy plane must have an orientation 1_y/1_x = 1_z, which is not unreasonable.  Analogous reasoning forces the conclusion that sin() has orientation 1_z while cos() has orientation 1_0.  These are different, so one concludes (correctly), for example, that there are no solutions of physical equations that are of the form a sin() + b cos(), where a and b are scalars.
The assignment of orientational symbols to physical quantities and the requirement that physical equations be orientationally homogeneous can actually be used in a way that is similar to dimensional analysis to derive a little more information about acceptable solutions of physical problems.  In this approach one sets up the dimensional equation and solves it as far as one can.  If the lowest power of a physical variable is fractional, both sides of the solution is raised to a power such that all powers are integral.  This puts it into "normal form".  The orientational equation is then solved to give a more restrictive condition on the unknown powers of the orientational symbols, arriving at a solution that is more complete than the one that dimensional analysis alone gives. Often the added information is that one of the powers of a certain variable is even or odd.
As an example, for the projectile problem, using orientational symbols, , being in the x-y plane will thus have dimension 1_z and the range of the projectile R will be of the form:
\left(\frac{L\,1_y}{T^2}\right)^a\left(\frac{L}{T}\right)^b\,1_z^c
Dimensional homogeneity will now correctly yield a=-1 and b=2, and orientational homogeneity requires that c be an odd integer. In fact the required function of theta will be \sin(\theta)\cos(\theta) which is a series of odd powers of \theta.
It is seen that the Taylor series of \sin(\theta) and \cos(\theta) are orientationally homogeneous using the above multiplication table, while expressions like \cos(\theta)+\sin(\theta) and \exp(\theta) are not, and are (correctly) deemed unphysical.
It should be clear that the multiplication rule used for the orientational symbols is not the same as that for the cross product of two vectors.  The cross product of two identical vectors is zero, while the product of two identical orientational symbols is the identity element.

# Philosophical basis
Ultimately, it can be seen that dimensional analysis and the requirement for physical equations to be dimensionally homogeneous reflects the idea that the laws of physics are independent of the units employed to measure the physical variables.  That is, F = ma, for example, is true whether the unit system used is SI, English, or cgs, or any other consistent system of units.  Orientational analysis and the requirement for physical equations to be orientationally homogeneous reflects the idea that the equations of physics must be independent of the coordinate system used.

# Dimensionless constants
The dimensionless constants that arise in the results obtained, such as the C in the Poiseuille's Law problem and the \kappa in the spring problems discussed above come from a more detailed analysis of the underlying physics, and often arises from integrating some differential equation.  Dimensional analysis itself has little to say about these constants, but it is useful to know that they very often have a magnitude of order unity.  This observation can allow one to sometimes make "back of the envelope" calculations about the phenomenon of interest, and therefore be able to more efficiently design experiments to measure it, or to judge whether it is important, etc.

# Dimensionless theories
Paradoxically, dimensional analysis can be a useful tool even if all the parameters in the underlying theory are dimensionless. E.g. lattice models such as the Ising model, can be used to study phase transitions and critical phenomena. Such models can be formulated in a purely dimensionless way. As we approach the critical point closer and closer, the distance over which the variables in the lattice model are correlated (the so-called correlation length, \xi ) becomes larger and larger. Now, the correlation length is the relevant length scale related to critical phenomena, so one can, e.g. surmize on "dimensional grounds" that the non-analytical part of the free energy per lattice site should be \sim 1/\xi^{d} where d is the dimension of the lattice.
It has been argued by some physicists, e.g. Michael Duff  , that the laws of physics are inherently dimensionless. The fact that we have assigned incompatible dimensions to Length, Time and Mass is, according to this point of view, just a matter of convention, borne out of the fact that before the advent of modern physics, there was no way to relate mass, length, and time to each other. The three independent dimensionful constants: c, hbar, and G, in the fundamental equations of physics must then be seen as mere conversion factors to convert Mass, Time and Length into each other.
Just like in case of critical properties of lattice models, one can recover the results of dimensional analysis in the appropriate scaling limit. E.g. dimensional analysis in mechanics can be derived by reinserting the constants \hbar, c, and G (but we can now consider them to be dimensionless) and demanding that a nonsingular relation between quantities exists in the limit c\rightarrow \infty,  \hbar\rightarrow 0 and G\rightarrow  0. In problems involving a gravitational field the latter limit should be taken such that the field stays finite.