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
 Time Delay
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

gleeblejim

USA
33 Posts

Posted - 09/18/2012 :  09:07:45 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8.6 and Service Release 3 (Select Help-->About Origin):
Operating System: Win 7

Good Day Origin Crew!

I'm looking to find the time delay between two sets of data, in this case Distance (measured) and PDistance(ideal). The tests will be controlled so the only thing that will change from test to test is Distance. Is there any way in Set Column Values to tell Origin to average the time difference between two columns, for instance when Distance = 2,4,6,8 then find Average(Time of PDistance at # - Time of Distance at #)?

Thank you,
Jim

Drbobshepherd

USA
Posts

Posted - 09/18/2012 :  3:56:03 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Jim,

I am not sure, but it looks like from your example that you are describing a time measurement for a fixed set of distances. Are "Distance" the independent variable, and "Predicted Time at Distance" and "Measured Time at Distance" your dependent variables?

I'm just guessing, but I think you are asking how to use Set Column Values to average a number of datasets and subtract the average from a dataset of predicted values. If you know the number of datasets to average, it isn't difficult. For example, say the following table is your data:

d tPred tMeas1 tMeas2 tMeas3
2 5.000 4.2040 4.5160 4.6230
4 7.777 7.6050 7.5430 7.6120
6 9.500 8.9700 9.0010 9.5960
8 11.00 10.502 10.999 10.755

Add a column. Set Column Values so that Col(F)=

Col(B)-((Col(C)+Col(D)+Col(E)/3))

Apply an appropriate label to this column and you are done. The results should look something like this:

d tPred tMeas1 tMeas2 tMeas3 Avg(tP-tM)
2 5.000 4.2040 4.5160 4.6230 0.55233
4 7.777 7.6050 7.5430 7.6120 0.19033
6 9.500 8.9700 9.0010 9.5960 0.31100
8 11.00 10.502 10.999 10.755 0.24800

If the number of measured datasets is unknown, you should write a LabTalk script to get the number and calculate the average in the advanced Before-Formula-Script window in the Set-Column-Values dialog.

I hope this answered your question?

DrBobShepherd
Go to Top of Page

gleeblejim

USA
33 Posts

Posted - 09/18/2012 :  4:09:03 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Sorry for not clarifying in the original post. In my software Time is always acquired as the X value and everything else is Y. The data file would look like:

Time(X) PDistance(Y) Distance(Y)
(sec) (mm) (mm)
0 0 0
1 1 0.5
2 2 1
3 3 2
4 4 3
5 4 4

And I would like to make a template that has one of the columns automatically find the time delay for the two columns. The attached image shows the area I'm interested in.
Go to Top of Page

Drbobshepherd

USA
Posts

Posted - 09/19/2012 :  12:20:08 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
OK. Try this.

1. Add a column to the 3 you already have. Longname it "Delay".
2. Select the column, and open the Set Column Values dialog.
3. Enter the following in the Before-Formula-Script window:

interp1 ix:=Col(C) iy:=(Col(B), Col(A)) ox:=Col(D); // Interpolate t value on PD curve for each D value.
Col(D)=Col(D)-Col(A); // Calculate delay.
avg=mean(Col(D)); // Calculate mean delay.
Col(D)[C]$=Mean= $(avg,.3); // Type value in Comments, format to 3 decimal places.

4. Click on OK.

I hope this works for you. If it does, you may wish to save it as an Analysis Workbook for future processing.

DrBobShepherd
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 09/19/2012 :  2:32:05 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Jim,

Maybe I'm lazy, but if I were, I will fit your two plots with a sigmoidal function, e.g., Boltzmann (independently, or globally with shared parameters); Then, you can subtract the x coordinates of the centers.
It would work even when the data is noisy.

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 09/19/2012 2:33:50 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