Problem 46031. Construct dimensionless parameters

Write a function to construct dimensionless parameters from a list of variables, a matrix indicating their dimensions, and a vector identifying the variables to use to make the other variables dimensionless. More details are given in "Problem statement" below.
Dimensional analysis and the Buckingham π theorem
The Buckingham π theorem is a key result exploited in dimensional analysis in engineering, physics, and applied mathematics. It states that if a problem involves m variables and n physical dimensions (e.g., length, time, mass), then the problem can be described with m-n dimensionless groups, called π groups. In other words, the "physics does not depend on a specific unit system".
To find the dimensionless groups, we follow these steps:
  1. Choose n variables that cannot form a dimensionless group by themselves
  2. Form the product of one of the remaining m-n variables with the variables in step 1, each raised to different exponents
  3. Determine the exponents that would make the product (or group) dimensionless
  4. Repeat steps 2 and 3 for the remaining variables
Suppose we are interested in the drag F (i.e., a force) on a cylinder of length L and diameter d immersed in a fluid of density ρ and dynamic viscosity μ flowing at velocity V. Because the problem involves 6 variables and 3 dimensions (length, time, and mass), it can be described with 3 dimensionless groups. For step 1 above, choose V, d, and ρ. We could choose other lists of 3, but notice that we could not choose V, d, and L because d and L form a dimensionless group themselves (and we have no way of removing mass dimensions.)
For step 2, start with the drag F. Following the step, we get
pi_1 = F V^{a1} d^{a2} rho^{a3}
where a1, a2, and a3 are exponents. Because pi1 must be dimensionless and because the dimensionless of F, V, d, and ρ are ML/T^2, L/T, L, and M/L^3, respectively, we can solve a system of three equations to find the exponents and write
pi1 = F V^{-2} d^{-2} rho^{-1}
which is related to a quantity in fluid mechanics called the drag coefficient. We then repeat steps 2 and 3 with the two remaining variables and find
pi2 = L/d
pi3 = mu/(V d rho)
or a geometric ratio and the inverse of the Reynolds number.
Problem statement
Write a function that constructs dimensionless parameters from a cell array vars with the variable names, a matrix dims with the exponents for the dimensions in rows (length, time, mass) for each variable in the columns, and a vector indx indicating the variables chosen in step 1 above. The function should return a cell array Pi with the dimensionless groups in strings and a vector a of size m x m-n with the exponents of the normalizing variables. For the example above, the input could be specified as
vars = {'F', 'V', 'd', 'L', 'rho', 'mu'};
indx = [2 3 5];
dims = [ 1 1 1 1 -3 -1;
-2 -1 0 0 0 -1;
1 0 0 0 1 1];
and the output would be
Pi = {'F V^{-2} d^{-2} rho^{-1}', 'L d^{-1}', 'mu V^{-1} d^{-1} rho^{-1}'}
a = [-2 0 -1;
-2 -1 -1;
-1 0 -1]
Further specifications:
  • If the variables chosen in indx will not work (i.e., the number is incorrect or some form a dimensionless group themselves), return a = NaN and Pi = {'Error in choosing normalizing variables'}.
  • If the exponent of a variable is zero, omit the variable from the string.
  • If the exponent of a variable is one, keep the variable but do not show the exponent.
  • If the exponent of a variable is a positive integer, indicate it with a caret (^) and no braces.
  • If the exponent is anything else, indicate it with a caret and braces.
  • If the exponent is not an integer, express it as a fraction. Hint: MATLAB has a function that will help.

Solution Stats

71.43% Correct | 28.57% Incorrect
Last Solution submitted on Dec 03, 2023

Problem Comments

Solution Comments

Show comments

Problem Recent Solvers4

Suggested Problems

More from this Author241

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!