New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
physics.units - dimensional analysis/nondimensionalization addition #20832
Comments
CC @Upabjojr |
Yes, improvements are welcome. Especially, if the code gets included into SymPy, it's more likely that people will notice it. One only thing about |
Yes and no. The current implementation takes a I would also like to discuss the current interface of nondim. Currently it takes an |
Yes, we have moved to dimension systems in order to make the implementation independent of SI. At the beginning SI was assumed by default, but that was a bad design because it limits the potential applicability of this module. Moving away from SI is not yet 100% complete, I would also like to make it mandatory to declare the unit system you use, instead of assuming a default unit system.
Wouldn't it be simpler to declare the exponent variables and solve for those? Instead of eq = sympy.Eq(t, sympy.Function('f')(m,l,g,theta)) what about: a1, a2, a3, a4 = symbols("a1:5")
eq = sympy.Eq(i, m**a1*l**a2*g**a3*theta**a4) and then solving for the a 's? I'm also interested in expanding the units module by adding support for cross-unit system conversions. For example, you have a formula expressed in natural units and would like to get the equivalent in SI units, how do you convert that? That could be useful. |
This could be very helpful. It's a nice idea to be implemented. |
@Upabjojr Francesco, thanks for your input.
Are you referring to API of nondimensionalization or how it should be implemented internally? If it concerns the API. As I understood the pi-theoreom: every dimensional homogeneous equation
https://github.com/cheind/sympy-nondim/blob/develop/nondim/utils.py Also, https://github.com/cheind/sympy-nondim/blob/develop/nondim/tests/test_buckpi.py |
Looks great! Did this finally reached the official Sympy distribution? |
Hey @jzy3d, no I did not find the time to start integration towards sympy. In case you are interested, please feel free to take the lead. |
Hey!
I have developed a prototype Python package that deals with physical dimensional analysis:
https://github.com/cheind/sympy-nondim
In particular, sympy-nondim calculates from an unknown relation of (dimensional) variables, a new relation of (usually fewer) dimensionless variables.
While dimensional analysis seems to be part of sympy.physics, it seems such a particular application of it is missing. Hence I wanted to know whether there is potential interest in having this as an addition to sympy.physics?
The text was updated successfully, but these errors were encountered: