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
 All Forums
 Origin Forum
 Origin Forum
 claculation of overlap area under two curves

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
oyais Posted - 08/05/2013 : 03:35:18 AM
PLease let me know how to calculate overlap or common area under two curves using origin 8.5

oyais
13   L A T E S T    R E P L I E S    (Newest First)
lkb0221 Posted - 05/21/2015 : 5:03:55 PM
Hi, everyone

There is a blog posted for this topic.
http://blog.originlab.com/graphing/fill-area-under-intersection-of-two-curves

Zheng
OriginLab
Hideo Fujii Posted - 11/07/2014 : 4:32:00 PM
Hi misz_waza,
1) Arrange your data as in the worksheet columns A, B, C, and D in my sample. 
2) Add three extra empty columns - E, F, and G.
3) Using Set Column Values tool, calculate the column E with the formula.
   Similarly, fill the column F. 
  http://www.originlab.com/doc/Origin-Help/Wks-SetColVal-QuickStart
4) Calculate the column G by integrate from the column F.
  http://www.originlab.com/doc/Origin-Help/Math-Integrate
Hope this helps.

--Hideo Fujii
OriginLab
misz_waza Posted - 11/06/2014 : 5:25:56 PM
Hi Hideo and Originlab tech support,
I can't really get it the step that you did to find the area under the curve.Can you explain step by step?Attach is the graph that I want to find the area?I want to find the area for the black colour..
Hope you can help me.

Thanks a lot
waza
Hideo Fujii Posted - 08/23/2013 : 4:35:42 PM
Hi,

Here is what Greg has meant.

Col(E) is the Set Column Values' result of interpolated Y values based on the X dataset of the
second curve in Col(C). Its formula, "col(Y1)(col(X2))"uses a dataset(col(Y1)) as a function,
taking col(X2) as the argument.
(Note: You can make and use a separate X column with a range of your choice before this col(E).)
Also, see http://wiki.originlab.com/~originla/ltwiki/index.php?title=Script:Interpolation .

Col(F) is the Set Column Values' result of taking the lower values of col(D) vs. col(E) using min( ) function.

col(G) is the Integration result from col(F) (vs. col(C) as X).
Graph1 shows plots of col(B), col(D) and col(G). Col(G) plot has "Fill Area Under Curve" option.



Hope this has explained well.

--Hideo Fujii
OriginLab
oyais Posted - 08/12/2013 : 02:45:50 AM
@Christyli,
have u checked my data and pls update me about the calculation of common area under the two curves.

oyais

oyais
oyais Posted - 08/10/2013 : 06:16:26 AM
i have forwarded data on the given mail
@rlewis pls help with programming... i am not able to do it

oyais
rlewis Posted - 08/09/2013 : 01:13:07 AM
I've tested the function and could find no error ...
What is/are the nature of the error/errors that you found ??
oyais Posted - 08/08/2013 : 10:41:44 PM
@rlewis, programme showed errors.. i couldnt do it
@ Greg. I am sorry Greg could get u..
Kindly explain your procedure with an example and yes my dta doesnot have common x.If you wish i can forward the origin file to u via email.
Thanks!!

oyais
greg Posted - 08/08/2013 : 12:05:10 PM
If your data shares the same X column, then the solution is simple:

Add a column to your worksheet.
Select the column and press Ctrl+Q (opens Set Values dialog).
Enter this expression, using your two Y column numbers or names:
min(col(B),col(C))
Click OK, then integrate that column to get the area.

If your data does not share the same X column, then you first need to create a common X column then use Analysis : Mathematics : Interpolate/Extrapolate Y form X to create new Ys and do the above with this data.
oyais Posted - 08/08/2013 : 12:51:13 AM
is it necessary to do programming if yes pls lemme know how to use origin c programming to input this function

oyais
rlewis Posted - 08/06/2013 : 6:29:19 PM
If you are willing to do a little OriginC progamming the following OC function should do ...

double GetCommonArea(Curve CurveA, Curve CurveB)
{
	Dataset dsX, dsY;
	vector<double> xCurveA, yCurveA, xCurveB, yCurveB;
	if(CurveA.CopyData(xCurveA, yCurveA) == true && CurveB.CopyData(xCurveB, yCurveB)==true)
	{
		if(dsX.Create(xCurveA.GetSize()) == true && dsY.Create(xCurveA.GetSize())==true)
		{
			for(int i=0; i<xCurveA.GetSize(); i++)
			{
				dsX[i]=xCurveA[i];
				double yVal=(Curve_yfromX(&CurveB,xCurveA[i]));
				dsY[i]=min(yCurveA[i],yVal);
			}
			Curve CommonArea(dsX,dsY);
			if(CommonArea.IsValid()==true)
			{
				return (area(CommonArea));
			}
		}
	}
	return NANUM;
}

oyais Posted - 08/06/2013 : 03:01:12 AM
Sir i need to calculate the common area or overlap area(highlighted area as in fig.) under two curves as shown in the fig attached . I also have similar graphs but i have unable to calculate common area please guide.

oyais
Shirley_GZ Posted - 08/05/2013 : 05:48:38 AM
Hi Oyais,

The Integrate gadget can be used here.

First, use this gadget to calculate the area under each curve, area1 and area2(without baseline by default, integrate from the straight line y=0). Then go to the Preferences dialog, set the baseline as one of the curves to calculate the absolute area between these two curves, area3.

overlapping area = (area1 + area2- area3)/2

Area1:


Area2:


Area3:


Shirley

Originlab Technical Service Team

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000