kdavies4 / natu

Natural units in Python
http://kdavies4.github.io/natu/
Other
33 stars 5 forks source link

question: can you tell natu to convert to SI for printing? #32

Open zbeekman opened 7 years ago

zbeekman commented 7 years ago

It's not clear to me how I can get more complicated physical quantities entered in non SI units to display/print in SI units. For example, I want to compute the dynamic viscosity of air using the 2-coefficient formulation of Sutherland's law given in equation A3 in https://ntrs.nasa.gov/archive/nasa/casi.ntrs.nasa.gov/19930091059.pdf. The temperatures are in Rankine, including the Sutherland constant, 198.6, and the units of the viscosity are given as (lb s)/(ft*2) where, presumably lb is lbf, since SI units of dynamic viscosity are usually given as Paseconds. This means that, presumably, the λ coefficient as the first term on the RHS is 2.270E-8 * lbf * s / (ft * ft * (degR**Fraction(1,2))) but I've been getting wacky results and was hoping to use natu to ensure that I'm converting it to SI units correctly, so that I can eyeball lambda and compare with other common values people use.

zbeekman commented 7 years ago

https://en.wikipedia.org/wiki/Viscosity#Effect_of_temperature_on_the_viscosity_of_a_gas has some more info on notation etc. if you need it.

zbeekman commented 7 years ago

OK, I've determined that you can divide by the desired units which will cause a conversion, and then multiply by the desired units which will attache them to the quantity... This seems like a hack, so I'm probably doing something wrong.