Hi akash8393,
Ok, so you want the intercepts of a hysteresis curve. I'm sure the following sample is not the best,
but at least it should work. Here, I assume that your curve starts at the lower left corner, going
around (0, 0), points go further enough at both plateaus,and XY data is stored in column 1 and 2.
Please try the following:
////////////////////////////////////////////////////
[GetIntercept]
worksheet -a 1; //Add one column
wks.col3.type=4; //Set it as X column
sum(col(1)); //Get stats of column 1 for X
nn=sum.n; //Number of rows
xmin=sum.min; //Minimum of col(1)
ximax=sum.imax; //Row# of max of col(1)
xmax=sum.max; //Maximummum of col(1)
sum(col(2)); //Get stats of column 2 for Y
ymin=sum.min; //Minimum of col(2)
col(4)=col(2); //Copy Y column to 4th column
for(ii=1; ii<=nn; ii++) { //Loop over data rows
if(ii<=ximax) { //If data is before first part
col(3)[ii]=col(1)[ii]; //X is the same
}
else { //If data is before first part
col(3)[ii]=2*xmax-col(1)[ii]; //Add X offset after max
}
}
col(5)[1]=0; //Lower corner X
col(5)[2]=2*xmax; //Higher corner X
interp1 -r 0 ix:=col(5) iy:=col(4) method:=linear; //Interpolation
yIntercept1=col(6)[1]; //Obtained first Y intercept
yIntercept2=col(6)[2]; //Obtained second Y intercept
[Main]
Type Max: $(max(col(2))); //Max of Y
range rc1=col(1); //X column
range rc2=col(2); //Y column
run.section(,GetIntercept); //Get the Y intercepts
type Y-Intercept: $(yIntercept1) and $(yIntercept2);
newsheet;
col(1)=rc2; //Put Y as X
col(2)=rc1; //Put X as Y
run.section(,GetIntercept); //Get the X intercepts
type X-Intercept: $(yIntercept1) and $(yIntercept2);
////////////////////////////////////////////////////
You get the result messages from the sample data below:Max: 3.5057959908529
Y-Intercept: -2.4483369391089 and -1.4887507644216
X-Intercept: 1.4052534667203 and 0.63421215889161

Hope this helps.
--Hideo Fujii
OriginLab