Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXCEL: How to calculate integral of product of two functions ?

Status
Not open for further replies.

Hermanator

Technical User
Jan 16, 2002
30
0
0
NL
Hello all,

I am trying to write a macro in Excel that calculates the CIE color coordinates from a given spectrum. For this I have to calculate the integral of the product of two functions:

I = INTEGRAL [ g(X)*h(X) ] dX

Both functions are in my excel sheet as 2 arrays. For instance column A contains the X-values of the data points of function g, column B are the values g(X), column C are the X-values for function h and column D contains the values h(X). To complicate things further, the datapoints for both functions do not have the same values. For instance column A would contain the points X=0,1,2,3 etc while column C contains X values X=0.5, 1.5, 2.5 etc.

If you plot both functions, than the overlap of the 2 functions would be the value that I'm looking for. However, I can't think of a way to calculate this. Is it necessary to interpolate one of the functions, so that they have common X-values?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top