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 for Programming
 LabTalk Forum
 Find X intercept , Y intercept and maximum
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

akash8393

India
7 Posts

Posted - 02/08/2018 :  03:00:48 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver.9.3 and Service Release 2016 (Select Help-->About Origin):
Operating System:

How do find the x intercept and y intercept and maximum value of non monotonic curves.My curves do look like the one's in the following link.
https://www.google.co.in/search?q=hysteresis curves&rlz=1C1CHBF_enUS774US774&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjJxt6e65XZAhUEvo8KHcxNAdsQ_AUICigB&biw=1536&bih=734#imgrc=4vkPmDU4WEmBEM:" target="_blank"> https://www.google.co.in/search?q=hysteresis curves&rlz=1C1CHBF_enUS774US774&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjJxt6e65XZAhUEvo8KHcxNAdsQ_AUICigB&biw=1536&bih=734#imgrc=4vkPmDU4WEmBEM:

Hideo Fujii

USA
1582 Posts

Posted - 02/15/2018 :  11:49:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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