https://github.com/cheind/py-dimensional-analysis
Dimensional analysis and modeling in Python
https://github.com/cheind/py-dimensional-analysis
Last synced: 11 months ago
JSON representation
Dimensional analysis and modeling in Python
- Host: GitHub
- URL: https://github.com/cheind/py-dimensional-analysis
- Owner: cheind
- License: mit
- Created: 2021-01-06T10:12:01.000Z (over 5 years ago)
- Default Branch: develop
- Last Pushed: 2021-09-08T16:17:39.000Z (almost 5 years ago)
- Last Synced: 2024-10-16T04:06:31.030Z (over 1 year ago)
- Language: Python
- Size: 977 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# py-dimensional-analysis
This Python package addresses physical dimensional analysis. In
particular, `py-dimensional-analysis` calculates from a given system of
(dimensional) variables those products that yield a desired target
dimension.
The following example illustrates how the variables mass, force, time
and pressure must relate to each other in order to produce the dimension
length\*time.
``` python
import danalysis as da
si = da.standard_systems.SI # predefined standard units
s = da.Solver(
{
'a' : si.M, # [a] is mass
'b' : si.L*si.M*si.T**-2, # [b] is force (alt. si.F)
'c' : si.T, # [c] is time
'd' : si.Pressure # [d] is pressure
},
si.L*si.T # target dimension
)
print(s.solve())
```
Which prints
Found 2 variable products of variables
{
a:Q(M),
b:Q(L*M*T**-2),
c:Q(T),
d:Q(L**-1*M*T**-2)
}, each of dimension L*T:
1: [a*c**-1*d**-1] = L*T
2: [b**0.5*c*d**-0.5] = L*T
This library is based on (Szirtes 2007), and also incorporates ideas and
examples from (Santiago 2019; Sonin 2001).
## Solver
The solver is based on the Buckingham’s *π* theorem. For more information, see (Szirtes 2007).
## References
Santiago, Juan G. 2019. *A First Course in Dimensional Analysis:
Simplifying Complex Phenomena Using Physical Insight*. MIT Press.
Sonin, Ain A. 2001. “Dimensional Analysis.” Technical report,
Massachusetts Institute of Technology.
.
Szirtes, Thomas. 2007. *Applied Dimensional Analysis and Modeling*.
Butterworth-Heinemann.