LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 30
Default How to Sum infinite formula

On Apr 26, 4:43*am, Dana DeLouis wrote:
Hi. *Here is a slight addition that you can play with if you wish.
I just modified this portion so we can watch the convergence.
I also eliminated multiplying the answer by 100.
Just format the output as percentage to 3 decimal places does the same
thing!

* * * * *For J = 2 To 20
* * * * * * *.Add "k", Y / Fx.Fact(J) * *' T/j!
* * * * * * *.Add "M", [MMult(M, Orig)] *'Matrix to the next power

* * * * * * *.Add "Old", [Ans]
* * * * * * *.Add "Ans", [Ans + k*M] * * 'Sum
* * * * * * *Debug.Print J; Fx.SumXMY2([Old], [Ans])
* * * * *Next J
* * * * *[A12].Resize(9, 9) = [Ans]
* * *End With
End Sub

The output is:
* 2 *0.03359136055325
* 3 *9.2432006386492E-04
* 4 *1.54269946074966E-05
* 5 *1.72307843099531E-07
* 6 *1.35605071782519E-09
* 7 *7.91983983820038E-12
* 8 *3.54955567034313E-14
* 9 *1.25992350330859E-16
* 10 *3.62323283207642E-19
* 11 *8.61641664106313E-22
* 12 *1.72167126878345E-24
* 13 *2.93590834028579E-27
* 14 *4.50356058499773E-30
* 15 *1.36904585529777E-32
* 16 *4.48415508583941E-44
* 17 *0
* 18 *0
* 19 *0
* 20 *0

We can see that around 8-9 loops is all that's needed.
One can modify the code to exit once the difference gets below a certain
level.

= = = = =
HTH
Dana DeLouis

<snip


checking the convergence is a good idea, would be very helpful in
determining how many loops required as a cut-off point. : ) Thanks a
lot really, you have been very helpful Dana.


Regards,
Min Yeh
 
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
Can you sum over a range with one end fixed and the other infinite [email protected] Excel Discussion (Misc queries) 3 February 9th 09 10:19 PM
Infinite sum formula [email protected] Excel Worksheet Functions 5 May 3rd 07 08:35 PM
infinite rows? Pauline Charts and Charting in Excel 1 September 27th 06 08:16 AM
For Next Infinite Loop Naji Excel Discussion (Misc queries) 5 January 13th 06 06:56 PM
How to calculate NPV of an infinite series? Mike Excel Discussion (Misc queries) 2 September 15th 05 06:10 PM


All times are GMT +1. The time now is 05:52 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"