Please use a helpful title when posting questions. This thread's title is totally useless!!!! It cannot be used in Searches & will probably not attract too much attention.
Integral solution using Simpson's Rule(numerical integration) in VBA. Using any integral formula, does anybody out there knows how to use VBA to get integral solution using simpson's rule?
Last edited by Isabella; June 9th, 2005 at 17:02. Reason: change title
Please use a helpful title when posting questions. This thread's title is totally useless!!!! It cannot be used in Searches & will probably not attract too much attention.
Hope that Helps
Roy
For free Excel tools & articles visit my web site
If I have helped you and you feel like putting your hand in your pocket please make a donation to Children in Need
About me.
is that ok?
I think you might find you get more help now. Thanks
Hope that Helps
Roy
For free Excel tools & articles visit my web site
If I have helped you and you feel like putting your hand in your pocket please make a donation to Children in Need
About me.
you can find all you want in Numerical Recipes
look at the loowing link:
http://www.library.cornell.edu/nr/bookcpdf/c4-2.pdf
filo65
It's not as stringent as simpson's rule, but here's a numerical integration UDF I wrote using the trapezoid rule. Perhaps it will be good enough for your situation.
VB:Function AUC(xRng As Range, yRng As Range) As Double ' Approximation of the definite integral using the Trapezoid rule Dim xRows As Integer, yRows As Integer Dim xRow As Integer, yRow As Integer Dim LeftRule As Double, RightRule As Double, TrapRule As Double, MidRule As Double xRows = xRng.Rows.Count yRows = yRng.Rows.Count RightRule = 0 LeftRule = 0 TrapRule = 0 For i = 2 To xRows RightRule = RightRule + yRng.Cells(i, 1) * (xRng.Cells(i, 1) - xRng.Cells(i - 1, 1)) LeftRule = LeftRule + yRng.Cells(i - 1, 1) * (xRng.Cells(i, 1) - xRng.Cells(i - 1, 1)) TrapRule = (LeftRule + RightRule) / 2 Next i AUC = TrapRule End Function
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks