Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 12
Default Calculating or estimating the area between to curves

I have seen some great posts about colouring the area between 2 lines but I
need to calculate numerically the area between 2 lines. A close estimate
would do. My curves are smoothed lines but they have many roots to fit a
trendline whose equation I could have integrated. If I use straight lines
between points I have too big an error. Even Simpsons Rule is not accurate
enough at times. Is there a way that Excel can return a figure for the area
under a curve - I could even use the number of pixels it has shaded between
the 2 lines!
  #2   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 182
Default Calculating or estimating the area between to curves

Hello, Broadband!
You wrote on Sun, 13 Aug 2006 01:51:01 -0700:

BA I have seen some great posts about colouring the area
BA between 2 lines but I need to calculate numerically the
BA area between 2 lines. A close estimate would do. My curves
BA are smoothed lines but they have many roots to fit a
BA trendline whose equation I could have integrated. If I use
BA straight lines between points I have too big an error.
BA Even Simpsons Rule is not accurate enough at times. Is
BA there a way that Excel can return a figure for the area
BA under a curve - I could even use the number of pixels it
BA has shaded between the 2 lines!

I think from what you say that you realise that the area between
the two curves is the difference between the areas under them.
You could use the differences between the integrals of the
fitted polynomials. With Excel 2002 as I have or earlier, I
would not use the equation given by the trend line on the chart
but actually fit the curve.

I'm not really quite sure what you mean by Simpson's rule not
being accurate enough. It would seem to me that if you have a
large number of experimental points, it is about as accurate as
you can get. In fact, it uses all the information available
unless you have good reason to believe the real graph is smooth.

James Silverton
Potomac, Maryland

E-mail, with obvious alterations:
not.jim.silverton.at.comcast.not

  #3   Report Post  
Posted to microsoft.public.excel.charting
external usenet poster
 
Posts: 1
Default Calculating or estimating the area between to curves


Not sure I understand why Simpson's rule (or any other Riemann sum)
wouldn't converge to the correct answer in your case. It's been a
while since I took calculus, but it seems to me that it can be proven
that, for a "nice" continuous function, Riemann sums have to converge
to the correct answer in the limit as the number of subdivisions goes
to infinity. Perhaps your problem stems from not having enough data
points to accurately determine the curves, or perhaps you are using too
few intervals in your application of Simpson's rule.

Along the lines of "counting pixels," there's another method of
numerical integration that I think is referred to as "Monte Carlo"
integration. Basically, you bound the functions within a rectangle,
for which you can easily determine the area. Then select several
(thousand?) points at random from within that rectangle. Test each
point to see if it lies within the region of interest. You then end up
with a ratio of points within the region to the total number of points
selected [n(in)/n(tot)]. The area between the curves then is this
ratio multiplied by the area of the selected box. I have no practical
experience with this method, having always used Riemann sums or the
Fundamental Theorom to get the area between two curves. I can't say
for sure if it will be easier for you to implement than Riemann sums or
not, nor am I intimiately familiar with all of the possible pitfalls.


--
MrShorty
------------------------------------------------------------------------
MrShorty's Profile: http://www.excelforum.com/member.php...o&userid=22181
View this thread: http://www.excelforum.com/showthread...hreadid=571133

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to increase chart area without affecting plot area? [email protected] Charts and Charting in Excel 2 April 21st 06 09:05 PM
calculating area under a sin curve Roger L Excel Discussion (Misc queries) 1 February 9th 06 08:24 PM
Extra Row in Defined Print Area Harry Gordon Excel Discussion (Misc queries) 3 November 14th 05 03:06 AM
Fill an area between 2 curves in an Excell chart? syseng Charts and Charting in Excel 6 August 17th 05 04:07 PM
Calculating the Area of objects in Feet and Inches Sip8316 Excel Discussion (Misc queries) 7 May 23rd 05 09:19 PM


All times are GMT +1. The time now is 08:56 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"