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
 Best method to find maximum value?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

autopilot

26 Posts

Posted - 02/08/2009 :  10:57:47 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 7.5
Operating System: winxp pro

Hello,

I would like to get the suggestion from a professional about what method to use in order to find the peak value of a given 2D graph (X is abscissa, Y is ordinate)?
I need to know X value when Y is maximum.
Function is simply column A(X)-abscissa and column B(Y)-ordinate.

Thanks a lot.

autopilot

26 Posts

Posted - 02/08/2009 :  10:59:41 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
just forgot to add, that I will use this method in a labtalk or origin c script to automate maual peak picking process.
Go to Top of Page

Deanna

China
Posts

Posted - 02/09/2009 :  01:06:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

The following script can get the X value when Y is maximum (suppose the worksheet that has the data is active):

//Set the index numbers for X and Y columns
xx=1;
yy=2;

%a = %(%h,yy); //Get the Y dataset name
limit %a;
%b = limit.imax; //The index of the maximum value

//Type results
type Peak X: %(%h, xx, %b);
type Peak Y: %(%h, yy, %b); 



Note that the maximum Y is not necessarily the peak position.

Deanna
OriginLab Technical Services
Go to Top of Page

autopilot

26 Posts

Posted - 02/09/2009 :  10:21:16 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
hey,

thanks a lot for your reply, this is great, I will try this script.
One question about what do you actually mean about peak and maximum positions? You mean that the "limit" function will only take the maximum value in the column regardless of the oscillation in function values?

Thanks.
Go to Top of Page

autopilot

26 Posts

Posted - 02/09/2009 :  10:52:46 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Actually the script works flawlessly, thanks once again.

I am proceeding further with the maximum finder script. Originally I was planning to implement the FFT, Adjacent averaging or Savitzky-Golay smoothing in order to get rid of the OSCILLATIONS in Y value of the function. And then only to find maximum value of the function.

Please advise me, whether there is more sophisticated method to find maximum value when many peaks are present around???

Thanks a lot.
Go to Top of Page

easwar

USA
1964 Posts

Posted - 02/09/2009 :  11:21:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

It may work better if you send a sample data file/Origin Project to tech so they can look at your data and make recommendations.

Easwar
OrignLab
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