Defining Offset Variables - Like degrees C or degrees F - Сообщения
Could we please have a means to define "offset variables" like barg or psig (gauge pressure, i.e. the pressure differential between a measured process and the atmospheric pressure), and also to simplify using differential pressure (difference between two pressures). In the latter case, the pressure differences could be expressed as deltaUnit (ΔPa or Δbar or Δpsi, etc.), like SMath already does for Change temperatures. It would seem to be no more impossible to implement this, for pressures, than the already existing ability to use temperatures in degrees Celsius or degrees Farenheit, which are offsets from Kelvin and Rankine respectively.
Is there any reason why it cannot (or should not) be made available in SMath - apart from the developer's time to do it and his other priorities.
Flow rate is "T/hr"? Shouldn't it be "kg/hr"?
WroteNot required. Temperature is a special definition. If you want to "create" your own definition, it's simple, start with apostrophe (' )and type the new variable. A change in pressure is linear, so define it as ΔPsi:=psi. If you get into absolute values, there are equations that help define it at set elevation (I did this based on ASHRAE), but it's still linear. Hope this makes sense
Forgive me if I am misunderstanding you; what you say makes sense in the context of differential pressure variables; but it seems to me it does not answer the question in relation to offset variables.
The example I suggested was the question of gauge pressures (usually measured relative to atmospheric pressure) and absolute pressures. Most pressure gauges or process pressure sensors give gauge pressure. But many process calculations require absolute pressure values. At sea level, 0 barg = 1.01325 bara; an offset that varies noticeably with altitude and also slightly with weather conditions.
I would like to have an easy way to define atmospheric pressure (nominally 1.01325 bara at sea level), to be able to write a process pressure as say 40 barg, and have SMath understand that the process pressure is 41.01 bara.
This is the same as SMath understanding that 15°C is actually 288.15 K. The Celsius temperature is offset from the Kelvin value by 273.15°; likewise gauge pressure is offset from absolute pressure by the value of the atmospheric pressure.
WroteFor that, we use Δp XTR [Transmitter].
We have lot about atmosphere ... maybe useful otherwise.
Cheers ... Jean
Can you elaborate please. I see dimly what you are suggesting but I can't see how it works in SMath (or Mathcad).
Wrote...
Is there any reason why it cannot (or should not) be made available in SMath - apart from the developer's time to do it and his other priorities.
For instance I don't know if your propose of Δ's it's an standard nor it have the same logic than temperature scales, even I think that it's a great idea. For example Wolfram alpha use psid and kPad for "differential pressure". For see that you can try with "3 kPa + 2 kPad" or "3 psi + 2 psid" at wolframalpha.com and check which logic it follows.
As workaround you can define your own convert function for show pressures, given that you know if a pressure x is absolute or gage:
Notice that UnitsOf returns an error for unknows units, but UoM works. Also I'm not prety sure if if that convertions is correct, but it's justo for show the idea about how to show abs or gauge pressures.
Best regards.
Alvaro.
WroteBTW, (...) ITS-90 specifies triple point of water 0.01 °C, thus: 273.16 °K
0 °K [-273.15] is approximate.
Thank you; yes, I am aware of that.
WroteThe Δp XTR is build with two responding diaphragms, very accurate.
Oh, a physical device, a normal differential pressure sensor. OK. I thought you were referring to a calculation technique; my misunderstanding.
There is a section Non-linear units. Try to understand the logic of how temperature units are defined and extend that to pressure units. Note that the id-attributes refer to line numbers in the language file (in lang\Text_xxx.lang)
Beware that sheets based on non-standard SMath configurations aren't portable. Thus, as soon as you are happy with your hack, you should ask for integration into the standard distribution.
I once added some special units to the file and integrated it in my portable distribution (see link in the signature). Yet these units weren't essential, so I dropped them later in order to limit the maintenance effort of the portable distribution.
Are you a member of ASHRAE? I have function, based on ASHRAE equation (IP units), that calculates the local atmospheric pressure (14.7 psi is only at sea level) based on site elevation. I use this for all of my "gas" calculations.
I really need to learn the ins and outs of the CoolProp plugin, it may have something there too.
Let me see if my manual has the SI formula ...
BTW, when I add atmospheric, I use a defined multiplier of (' )psia. This now allows me to carry the calculations as psia moving forward
p = 101.29 * [(T + 273.1)/288.08]^5.256 from Metric atmospheric correction.
This is similar to the function that I have for IP
As modified in my response above ...
Цитатаp = 101.29 * [(T + 273.1)/288.08]^5.256 from Metric atmospheric correction.
This is similar to the function that I have for IP
I add this to my gauge pressure and modify the units to (' )psia moving forward. Well documented and works like a charm.
New reference German - standard-atmosphere-calculations
Цитатаderived from properties at sea level, with n=5.2561, and where H is the altitude in meters:
P=101325×(1−2.25569×10^−5×H)^5.25616 [Pa]
Metric Atmospheric Adjustment.sm (5 КиБ) скачан 75 раз(а).
WroteYou might try to hack the file "units.xml" in folder "entries" in your SMath installation directory.
There is a section Non-linear units. Try to understand the logic of how temperature units are defined and extend that to pressure units. Note that the id-attributes refer to line numbers in the language file (in lang\Text_xxx.lang)
Hi Martin,
That looks a very promising approach; I think I understand in principle what changes are required; I would need to create a new Non-linear section under Pressure units. This approach may not offer any obvious possibility for setting the offset (atmospheric pressure as an absolute pressure) to anything other than a single fixed value, but the fixed value approach is assumed in most inductrial plants and steam turbine installations - certainly on all that I have worked on in the UK, Ireland and Belgium.
I notice the id-attributes appear to refer to line numbers + 9 in the Text_XXX.lang files; as if the count starts after the first 8 lines, i.e. id attribute1 refers to line 9 in the Text_XXX.lang files. All the .lang files I have inspected have the same number of lines as a header (obvious when you think about it for more than a second).
I have tried making some initial changes in Units.xml to add a definition block for barg and corresponding additions at the end of Text_ENG.lang, but any change to either file leaves SMath unable to load. Is there some other detail, come other file cross-reference, I need to address as well?
WroteNASA is already in correct units.
I have the OIAC flight altitude correction.
I don't deal with flight/space, so first formula is all I need for compressed air or gasses, but I use the IP variant

WroteThis is one of the RARE times I will disagree with BOTH Alvaro and Jean.
p = 101.29 * [(T + 273.1)/288.08]^5.256 from Metric atmospheric correction.
This is similar to the function that I have for IP
Interesting reference. Thank you. In the past I have used this one: https://www.wmo.int/pages/prog/www/IMOP/meetings/SI/ET-Stand-1/Doc-10_Pressure-red.pdf , in particular equation (4) on page 6, to calculate atmospheric pressure for sites at altitudes high enough for the simple assumption of atmospheric pressure = 1.01325 bara to be significantly erroneous.
WroteDid you visit post 19 ?
In post 19, you can offset by whatever ± 0.12345678987654321
I think we are losing sight of the requirement; perhaps I expressed it badly in the OP. It is for a simple means to change the display units of pressure in SMath to gauge pressure, whether barg or psig. Sure, I do all the calculations in absolute units as necessary. But for presentation purposes it is useful to have a simple way to display certain pressures as gauge pressures, even though they are used as absolute pressures in the calculation. I can (I do) make a conversion as needed; but it would be a simplification if it was possible just to define the result pressure unit as a gauge pressure and have the result displayed in gauge pressure units. The calculation would be made internally in the base unit (Pa) but displayed in the unit of choice, occasionally as a gauge pressure - the same as having a result in terms of temperature where one can define the result display unit as °C rather than K, for the benefit of less technical readers.
I am grateful for all the suggestions for calculating pressure changes due to atmospheric pressure. Truely, I appreciate that people here do try to be most helpful.
WroteWroteYou might try to hack the file "units.xml" in folder "entries" in your SMath installation directory.
There is a section Non-linear units. Try to understand the logic of how temperature units are defined and extend that to pressure units. Note that the id-attributes refer to line numbers in the language file (in lang\Text_xxx.lang)
I have tried making some initial changes in Units.xml to add a definition block for barg and corresponding additions at the end of Text_ENG.lang, but any change to either file leaves SMath unable to load. Is there some other detail, come other file cross-reference, I need to address as well?
I think you have to leave the language files untouched. The length of the file and the replacement handling is probably hardwired at compile-time.
This implies that you don't get a correct description in the insert units dialog and in the dynamic assistant.
Yet you can define and use the units as you described in the topic starter post.
Here, I demonstrate this with the german atü unit (Atmosphere Overpressure/Überdruck)
Once you are happy with your definitions, ask the developers to add these units by default. This has happened in the past, so there is a chance.
BTW, I'd expect many new users to fail with correct usage of such units as they aren't aware of the difference between absolute and difference units, much like the frequently popping up questions on temperature and temperature differences.
Page1.sm (12 КиБ) скачан 61 раз(а).
Units.zip (4 КиБ) скачан 64 раз(а).
I had to zip Units.xml, because xml is blocked for attachments.
WroteHere, I demonstrate this with the german atü unit (Atmosphere Overpressure/Überdruck)
Thank you. I have not had time to look at this properly but, at first glance and as you have defined it, the German atü unit does rather look like it is the same as barg (gauge pressure) at sea level. Second look: as before, except for the 101325 multiplier; if the multiplier was 100000 and the offset was 101325, it would be barg.
WroteInteresting reference. Thank you. In the past I have used this one: https://www.wmo.int/pages/prog/www/IMOP/meetings/SI/ET-Stand-1/Doc-10_Pressure-red.pdf, in particular equation (4) on page 6, to calculate atmospheric pressure for sites at altitudes high enough for the simple assumption of atmospheric pressure = 1.01325 bara to be significantly erroneous.
WMO Link, FIXED link above WMO Pressure Reduction Formula. I realized, after Jean posted the graph, I sent a scratch version, so be careful with UoM() function in that example. Using a CAS program like SMath allows us to use actual definitions, like the NASA or ASHRAE formula, which is traceable.
What I was getting at is that you can define your own units. Using the apostrophe (' ), it turns the definition blue like the other defined units ....
Check out defining sound. I asked for help there with decibel (dB ). This "unit" is not built in so I had to define it. Other units, like inches water or feet of water (I'm in the US) I do the same. I have a file that I save as units definitions and then "include" that file in my calculations so I can use "my" custom units
As to your last post, pressure IS linear when it comes to change. As SMath is similar to MathCAD in this regard, see Working with Temperatures
WroteWrotehttps://www.wmo.int/pages/prog/www/IMOP/meetings/SI/ET-Stand-1/Doc-10_Pressure-red.pdf
The link should work now. For some reason the forum software had included the comma in my sentance in the hyperlink; simply removing the comma at the end of the address in the error page makes it work.
Atmospheric Adjustment ASHRAE NASA.sm (24 КиБ) скачан 74 раз(а).
If memory serves, Jean has posted some sheets with ISA references. Differences between ASHRAE and NASA solutions in the Troposphere due "rounding" (e.g. in the exponent).
-
Новые сообщения
-
Нет новых сообщений