|
|
| File Information |
| Description |
Estimates the sum of an alternating series. Three linear methods for convergence acceleration are implemented.
EXAMPLES:
% log(2) = 1 - 1/2 + 1/3 - 1/4 + ...
altsum(1./(1:20))
ans =
0.693147180559945
% pi = 4 - 4/3 + 4/5 - 4/7 + ...
altsum(4./(1:2:39))
ans =
3.141592653589794
% Euler-Mascheroni constant
k = 2:20;
altsum(log(k)./k)/log(2) + log(2)/2
ans =
0.577215664901533
% Divergent series
altsum(1:9,'euler')
ans =
0.250000000000000
For a review of several acceleration methods see
http://numbers.computation.free.fr/Constants/Miscellaneous/seriesacceleration.html |
| MATLAB release |
MATLAB 7.5 (R2007b)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Updates |
| 07 Sep 2009 |
Description update. |
| 16 Sep 2009 |
Two acceleration methods added. |
| 27 Oct 2009 |
Description update |
| 27 Sep 2011 |
New contact info |
|
Contact us at files@mathworks.com