Community Tip - New to the community? Learn how to post a question and get help from PTC and industry experts! X
Is there a way to assign units to values in tables?
eg: i would like to use a table for density of air at various pressures and temperatures
t [O C] | -50 | 0 | 50 | 100 | 150 | 200 | 300 | 400 |
ρ [kg/m3] | ||||||||
1 bar | 1.563 | 1.275 | 1.078 | 0.932 | 0.8226 | 0.7356 | 0.6072 | 0.517 |
50 | 83.79 | 65.2 | 53.96 | 46.25 | 40.57 | 36.18 | 29.8 | 25.37 |
100 bar | 175.6 | 131.4 | 107.1 | 91.13 | 79.66 | 70.92 | 58.37 | 49.71 |
200 bar | 340.3 | 253.7 | 205.4 | 174.3 | 152.2 | 135.6 | 111.8 | 95.41 |
300 bar | 449.3 | 350.8 | 288.6 | 246.7 | 216.4 | 193.4 | 160.3 | 137.4 |
Is there a way i could create such a table with respective units for each of the values so that if I use a lookup function to find
hlookup(300K,table, 150bar)=, mathcad interpolates b/w nearest values in the table and gives me an answer
similarly, is there a function for interpolation and extrapolation from table values such that if i try to look up ρ at 50O C & 10MPa) it should automatically interpolate b/w the nearest actual points present in the table and provide a value.
Solved! Go to Solution.
In Mathcad Prime - no problem to have a matrix with different dimension (see too my wish - http://communities.ptc.com/docs/DOC-2151).
In Mathcad 15 no problem to solve your task - attach please your tabel as Mathcad matrix or as Excel sheet and I will do it. Now see please a solution one same task -
It could help to post a worksheet which shows what you have tried so far - no need to retype the tabled values and not necessary to guess which version of Mathcad you would need a solution for.
Is it mandatory that all values have to be in ONE matrix? Then, if you insist on values with units you can not user MC15, as there all values in a matrix must have the same unit.
While it should be possible to write a lookup function which does what you want, I don't believe that you can use any of the provided out of the box. In Mathac Prime you have new modifiers, e.g. "near", but even then there is no interpolation done.
Solution in attach.
See the pictute too:
More compact program with remarks:
Thanks Valery. It's a really neat piece of code.
vijay ram wrote:
Thanks Valery. It's a really neat piece of code.
You welcome!
One question - what is this substance?
And one compliment from me - two reverse function:
Thanks for the inverse functions as well .
The table is for the properties of air. I am using it for calculations related to thermal comfort.
I'm facing a small prob with the code you gave me. If I input the temperature in K, it doesn't work.
Infact even the command
50K/K-273.15= gives an error.
On the other hand
50bar/bar works in non-dimensionalizing it. Why does this happen?
vijay ram wrote:
Thanks for the inverse functions as well .
The table is for the properties of air. I am using it for calculations related to thermal comfort.
At 50-300 bar!!!
vijay ram wrote:
I'm facing a small prob with the code you gave me. If I input the temperature in K, it doesn't work.
Infact even the command
50K/K-273.15= gives an error.
On the other hand
50bar/bar works in non-dimensionalizing it. Why does this happen?
Attach please the sheet!
vijay ram wrote:
The table is for the properties of air.
See please how we can calculate air density with help the WaterSteamPro packadge (www.wsp.ru😞