On Sun, Aug 9, 2015 at 1:32 PM, Michael Powell
On Sun, Aug 9, 2015 at 11:16 AM, Michael Powell
wrote: Hello,
I'd like to calculate air density at altitude. Studying some notes on wikipedia:
I am trying to derived a "specific gas constant" dimension, and corresponding units: usually in the form of (J/(kg K)).
Mass and temperature dimensions are simple enough to build upon.
However, energy? Not so much, or perhaps there is a better way that I am not grasping.
/// derived dimension for specific gas constant : J M^-1 Theta^-1 typedef derived_dimension
specific_gas_constant_dimension; Which is yielding some errors, this and a host of others:
Error 19 error C2039: 'tag_type' : is not a member of 'boost::units::derived_dimensionboost::units::energy_dimension,1,boost::units::mass_base_dimension,-1,boost:...' I:\Source\Boost.org\boost_1_58_0\installed\x64\include\boost-1_58\boost\units\detail\linear_algebra.hpp 701 1 Kingdom.Physics.Calculators
My guess is for deriving a dimension from a derived dimension? Is there a better dimension to use for the energy component?
Or am I wasting time trying to setup a dimension and I should simply build the units themselves?
Or, do I really need to string together all the dimensions that constitute the energy dimension? or Joules ?
Which, when I "do the math" on the dimensions, I'm not positive, but
the Mass components cancel themselves out (though their actual
quantities might not actually do so...), so I end up with something
like this?
typedef derived_dimension
I suppose, consistent with the m.o. of consistency over convenience ...
Thank you...
https://en.wikipedia.org/wiki/Density_of_air
Symbol is typically Greek Rho, whose dimensions are generally M/L^3; units will probably be kg/m^3, although I am also reading about slugs/ft^3.
Which incorporates a gas constant value:
http://en.wikipedia.org/wiki/Gas_constant
Whose units appear to be Joules/(Volume*Temp).
I'm not seeing anything too terribly exotic there; all these units / dimensions are present in Boost.Units?
As is usually the case, it is interesting to see how the units library "reduces" the units during code writing, compilation. Very impressive indeed.
Thank you...
Best regards,
Michael Powell