The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 Calculating values from look-up table
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

mikefeehts110

New Zealand
Posts

Posted - 02/25/2013 :  10:51:20 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Any advice regarding making a look-up table as follows:
Assume I have two data-sets xi,yi and xj,zj. Each data set uses an independant set of (and possibly a different number of) values. What I want to be able to do is take each xj,zj point and use the xi,yi data to interpolate a yj value to 'replace' the xj value.

If this isn't clear, the following example may help:
Lets say I have a data-set of magnetic field B vs operating current I for an electromagnet - an (I,B) data-set. Then I measure current I as a function of time T - an (I,T) data-set. What I want is to plot a (B,T) graph, so for each point Ii,Ti I want to use the I,B data-set to interpolate a Bi data point (this could be a linear interpolation between neighbouring points from the I,B set for example).

snowli

USA
1386 Posts

Posted - 02/26/2013 :  2:55:24 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

If your datasets are organized in one worksheet, here is what you can do:

1. For (I, B) dataset, put I data in column A. Put B data in col B.
2. For (I, T) dataset, Put I data are in column C. Put T data in column D. (Note: If I is a function of T, you can right click column C and choose Set Column Values. Set the formular related to column D).
3. Highlight columns A and B and choose Analysis: Mathematics: Interpolate/Extrapolate Y from X.
--> A dialog opens. The interpolate will be done on column A and B so Input is filled with is column A and B automatically.
4. Choose arrow next to X Value to Interpolate and choose Column C.
5. You can choose Recalculate to be Auto. Click OK.
--> A new column is added to the worksheet, with interpolated B.
6. Now don't highlight any column, click the data plot, e.g. scatter plot.
--> Plot Setup dialog opens. You can check column E (the interpolated B) as X. check column D (T) as Y and to plot (B,T).

Note: Since the Recalculation is set to Auto, if column A, B, and C are changed, the interpolation result will update automatically.

Thanks, Snow Li
OriginLab Corp.
Go to Top of Page

mikefeehts110

New Zealand
Posts

Posted - 02/26/2013 :  5:56:06 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks Snow. I have a rather old version of Origin (OriginPro 7.5), so could not find any Analysis:Mathematics:Interpolate... function dealing with datasets (there is a similarly named function if you have an active graph but it has a much simpler action).

However, I was eventually able to find a solution as follows:
if I have a dataset Data1, with columns I1(x),B1(y),T(x),I2(y),B2(y) , with I1,B1,T, and I2 as described previously, then I can populate B2 by entering
Data1_B2=Data1_B1(Data1_I2);
into the scripting window.
Go to Top of Page

jchristian

USA
2 Posts

Posted - 09/12/2017 :  8:07:07 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
mikefeehts110 has an elegant solution that is useful for correcting a population of data. Interestingly, I have seen some "peculiar" behavior in OriginPro2016. For example, sometimes the "equivalent" statement, "Data2_B2=" Data2_I2+Data1_B1[Data2_T], does not execute correctly in the "set column values" window if the xvalue in Data1_T does not start at "1" (but it does execute when the xvalue starts at "1"). In my case, Data2 contains a population of x and y data points, with no functional relation: there is a T(x),I2(y) and LUT corrected B2(y). The LUT in Data1 contains all of the possible xvalues of data2, with a correction factor that depends on the xvalue: I1(x) and B1(y). In my case, the xdata is an integer (from an ADC).

Edited by - jchristian on 09/12/2017 8:22:05 PM
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000