How to find out entered unit of variable? - Сообщения
I have just come across SMath a couple of weeks ago and I enjoy using it more and more. I've finally stumbled across a problem I could not solve so far and would like to know if you SMath cracks have an idea.
I would like to create a wrapper function for some CoolProp functions and use different parameters according to the unit of the input variable (if the relative or mass-specific air humidity was entered):
I have tried the special function UnitsOf(), but it only returns the base unit like the special function UoM() of the variable (I guess because SMath saves the variable internally with the base unit). I am looking for a way to find out, which unit was entered by the user when defining the variable. Does anybody know which function I could use or does anybody have an idea how I could achieve the input unit detection?
Thank you in advance for your help!
unittest.sm (5 КиБ) скачан 38 раз(а).
WroteI would like to create a wrapper function for some CoolProp functions and use different parameters according to the unit of the input variable (if the relative or mass-specific air humidity was entered):
==============================
That's what I know about CoolProp: The package was developed by Valery & al.
MEI [Moscow Engineering Institute]. The package was adapted for Mathcad 11.
It was available from Valery Web. MAS.
Essentially the package like IAPWS is based on standard properties [STP].
Thus you may have to convert the actual properties to STP.
On the other hand, if you are looking for air specific gravity at altitude
or at measured pressure, it comes from another standard. NASA has their own
but the one I'm familiar is ISA [International Standard Atmosphere].
Water is much easier than air !
Jean
I decided to redefine the percent unit so that I can easier enter the g/kg ratio. The disavantages are that I have to use the unit % for relative humidity and that I cannot convert other ratios or efficiencies directly into percentages, but have to do it manually by multiplying it with 100 % (which is okay for me):
(I think CoolProp was mainly developed at the University of Liège in Belgium)
What was the disadvantage of defining a custom unit "g/kg"?
Wrote(I think CoolProp was mainly developed at the University of Liège in Belgium)
Ian Bell, Bell Thermal Consultants
Jorrit Wronski, IPU Refrigeration and Energy Technology, Kgs. Lyngby, Denmark
Sylvain Quoilin, Vincent Lemort, Thermodynamics Laboratory, University of Liege, Liege, Belgium
WroteI would be very cautious with re-definition of built-in units.
This increases the chance for your document to be misunderstood (including by yourself).
What was the disadvantage of defining a custom unit "g/kg"?
Remember: Mike had long comments about CoolProp
WroteI decided to redefine the percent unit so that I can easier enter the g/kg ratio.
The disavantages are that I have to use the unit % for relative humidity and that I cannot convert
other ratios or efficiencies directly into percentages, but have to do it manually by multiplying
it with 100 % (which is okay for me):
Cross check your calculations
https://www.engineeringtoolbox.com/moist-air-properties-d_1256.html
That reminds me to convert my Mathcd Psychro => Smath
-
Новые сообщения
-
Нет новых сообщений