11-29-2013 05:54 AM
Hello Uday,
Please find zip file attached herewith which contains my VI and two other .csv documents namely , "Superheated enthalpy" which contaiNs table of all enthalpy values and "Superheated Property Chart" which contains pressure and temp.columns respectively.
I read both these files in labview and then pass them to Interpolate 2D function.
Kindly let me know if I am wrong or doing something foolish & correct me with the same.
Post yours solutions in version 8.2.1
Thanks & Regards,
Snehal Upadhye
CLAD
11-29-2013 10:59 AM
Hi Snehal,
when you want to interpolate in a 2D array you should also provide a 2D array!
- Your Z data consist of just one column! That should be a "rectangular" array instead.
- Your X/Y data are just mixed up in two columns with some text garbage in between. There should be just a vector of X and Y data each! X vector can be pressure (from 1 to 60), Y data is temperature (-20 to 300)...
Please format your data in a more regular format and create a 2D array of Z data...
11-29-2013 09:42 PM
Hello GerdW,
Thanks for reply.
Though my front panel indicator shows that my Z value is only one column ; but in fact its a 2D array only , as I have used Read from spreadsheet file function whose output is a 2D array. This output has been given to the Z input of Interpolate 2D fuction.
For my convenience I have just reduced my front panel indicator "Enthalpy's" size to just a one column, oherwise it was just a rectangular array only.
If my Z value would not have been a 2D array then Interpolate 2D function wouldn't have accepted it !!!
Yeah I know there are some garbage values in my X and Y inputs as I have just copied down this .csv file; but these values are interpreted as "Zero" in labview ; so atleast interpolation with value "0" is possible.
These are just my points of view. Kindly correct me if I am wrong.
I kindly request you to modify my given VI according to what you are trying to suggest me as I am not exactly getting your point by just reading your suggestions.
Thanks & Regards,
Snehal Upadhye,
CLAD
12-01-2013 01:08 PM
Hi Snehal,
even when you read your Z data as 2D array it might just have one column of data (just a "x by 1" 2D array). That's not what the interpolation function expects...
When you have (for example) 10 pressure values and 20 temperature values you need to have a Z array containing 10 by 20 values! Please format your data in such a way...
12-02-2013 05:36 AM
Hello GerdW,
Thanks for reply.
I am getting what you are trying to say, but I am totally unable to implement that in my code.
I tried several possible ways with which your suggestion can be implemented ; but could not succed.
May be its quite possible that whatever I have been trying so far can be totally wrong and there could be a completely different solution for this than to use Interpolate 2D function.
I am attaching Excel file given to me (From which I'll have to format my values) in which all the pressure,temp.and enthalpy values are tabulated; so that you can have some idea how interpolation can be done with those.
Kindly post some soultion as all my efforts are coming back to square one again and again.
Thanks & Regards,
Snehal Upadhye
CLAD
12-02-2013 05:42 AM
12-03-2013 06:26 AM
Hi GerdW,
Thank you so much for suggestion.
It worked except for certain readings i.e. - for every Pressure value enthalpy values corresponding to Temp. -10 & 0 are not according to what is written there in LUT. They are totally different.
for instance; for temp. -10 and pressure 2 Enthalpy=399.77 but its is showing 1.
for temp. 0 and pressure 2 Enthalpy= 401.210 but its showing 2
Same happens with each value of pressure corresponding to temp.values -10 & 0
This code is fully working otherwise.
P.F.A here which includes my code and .csv file (LUT)
Best Regards,
Snehal Upadhye
CLAD
12-03-2013 06:46 AM - edited 12-03-2013 06:47 AM
Hi Snehal,
the interpolation function has an error output. And you should always check that output.
In your case you get an error -20077: "values not ascending".
- That's because your X/Y values aren't strictly ascending, as the pressure vector ends with a zero. To get this VI running I used some ArraySubset functions to correct your data reading...
- When loading the CSV data you should use ArraySubset anyway to provide the different parts of that table, as it consists of X and Y vector as well as a Z data array...
- I made all those values default to get rid of the CSV file...
12-03-2013 10:50 PM
HI GerdW,
Thank you so much for all the help throughout.
It seems that my problem has been solved with this solution.
Best Regards,
Snehal Upadhye
CLAD
12-04-2013 02:01 AM