Origin Ver. and Service Release (Select Help-->About Origin): 9
Operating System: Windows 10
I have a dataset that consists of x going from min to max and back to min again. After import, I want to run a script that reports some important merits.
The first task is to devide the dataset in two parts as a forward and backward part by using the maximum as a reference point. I tried using the xindex function which works if the newly defined integer is used as the upper end range parameter. However [parameter:end] for the second set of data does not... Is there any smart way to handle this?
Here the script:
string str3$ = Col(A)[D1]$;
Col(C)=Col(B)/%(str3$);
Col(C)[L]$ = j;
Col(C)[U]$ = mA/scm;
double maxx = max(Col(A));
int ligma = xindex(maxx,Col(B));
dataset Vfor = Col(A)[1:$(ligma)];
dataset jfor = Col(C)[1:$(ligma)];
dataset Vback = Col(A)[$(ligma):end];
dataset jback = Col(C)[$(ligma):end];
The second part consists mainly in taking the values at x=0 and y=0 followed by some calculations. I first worked with the Lookup function, however putting zero it takes some random small value but not the one closest to 0, since i guess the sicentific notation messes this up...
Then i went to use interpolation. I tried different ways of defining this, using the range notation and also the dataset one. In the end, all values are far away from what should be the result.
dataset powerfor = Vfor*jfor;
double pmaxfor = min(powerfor);
double ppmaxfor = abs(pmaxfor);
double jSCfor = jfor(0.000,Vfor);
double VOCfor = Vfor(0.5,jfor);
double FFfor = ppmaxfor/(jSCfor*VOCfor)*(-1);
Col(D)[1]$= PCE (%);
Col(D)[2]= ppmaxfor;
Col(D)[3]$= jSC (mA/scm);
Col(D)[4]= jSCfor;
Col(D)[5]$= VOC (V);
Col(D)[6]= VOCfor;
Col(D)[7]$= FF;
Col(D)
= FFfor;
Col(D)[9]$= Sample;
string str2$ = Col(A)[D3]$;
Col(D)[10]$= str2$;
Col(D)[11]$= Contact;
string str1$ = Col(A)[D4]$;
Col(D)[12]$= str1$;
dataset powerback = Vback*jback;
double pmaxback = min(powerback);
double ppmaxback = abs(pmaxback);
double jSCback = jback(0,Vback);
double VOCback = Vback(0,jback);
double FFback = ppmaxback/(jSCback*VOCback)*(-1);
Col(E)[1]$= PCE (%);
Col(E)[2]= ppmaxback;
Col(E)[3]$= jSC (mA/scm);
Col(E)[4]= jSCback;
Col(E)[5]$= VOC (V);
Col(E)[6]= VOCback;
Col(E)[7]$= FF;
Col(E)
= FFback;
Col(E)[9]$= Sample;
string str2$ = Col(A)[D3]$;
Col(E)[10]$= str2$;
Col(E)[11]$= Contact;
string str1$ = Col(A)[D4]$;
Col(E)[12]$= str1$;
//Col(C)[C]$= $(ppmax,.2) (%) / $(jSC,.2) (mA/scm) / $(VOC,.2) (V) / $(FF,.2);
wcolwidth irng:=col(4) width:=15;
wcolwidth irng:=col(5) width:=15;
wks.col4.type=2;
wks.col5.type=2;
colHide (2) hide;
Col(D)[L]$ = forward;
Col(E)[L]$ = backward;
I am really sorry if I approached it very complicated and it really is simple to solve. However, it is just the third script I did try now.
Thanks a lot for any help already!
Cheers