Origin Ver. and Service Release (Select Help-->About Origin): 9.1
Operating System: Windows 7
Hello all,
Some background: I'm modeling contaminant transport in a lake. The contaminant arrives at the point of interest, peaks, and then washes out of the system. I'm looking at time and concentration.
I'm defining the arrival time of the contaminant as when the concentration first exceeds a particular value. Following the suggestions in an old forum thread (http://www.originlab.com/forum/topic.asp?TOPIC_ID=1720), I was able to have success using the following in the Set Column Values dialog:
range r1 = 1!Col(1); // time
range r2 = 1!Col(2); // concentration
THRESH = 0.1; // threshold value for arrival of contaminant
temp = (r2>THRESH)?1:0;
irel=list(1,temp); del temp;
rdays = r1[irel];
My problem: I've decided to characterize the peak by looking at how quickly the contaminant reaches certain percentages of the peak value. I want "fraction of the peak" (o.1, 0.2, ... 0.9, 1.0) in the first column of a new sheet and the time in the second column. I'm guessing that I can modify the above code to do this, but I have been unsuccessful so far. Here is what I have:
range r1 = 1!Col(1); //time
range r2 = 1!Col(2); //concentration
range r3 = Col(1); //fraction of peak (0.1 to 1.0)
limit r2;
peak = limit.ymax;
peaki = limit.imax;
rTHRESH = (peak * r3);
temp = (r2>rTHRESH)?1:0;
irel=list(1,temp); del temp;
rdays = r1[irel];
So, can I do this in the Set Column Values dialog and, if so, how? If needed, I could use the first code and have one column for each fraction of the peak, but that's rather brute force would not be very efficient.
Thanks much for your help,
-M