Code covered by the BSD License  

Highlights from
ALTSUM

Be the first to rate this file! 1 Download (last 30 days) File Size: 1.77 KB File ID: #25200
image thumbnail

ALTSUM

by Jonas Lundgren

 

02 Sep 2009 (Updated 27 Sep 2011)

Convergence acceleration of alternating series.

| Watch this File

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.
Please login to add a comment or rating.
Updates
07 Sep 2009

Description update.

16 Sep 2009

Two acceleration methods added.

27 Oct 2009

Description update

27 Sep 2011

New contact info

Tag Activity for this File
Tag Applied By Date/Time
sum Jonas Lundgren 09 Sep 2009 01:38:45
approximation Jonas Lundgren 09 Sep 2009 01:39:14
mathematics Jonas Lundgren 17 Sep 2009 01:08:34
acceleration Jonas Lundgren 17 Sep 2009 01:09:04
convergence Jonas Lundgren 17 Sep 2009 01:09:20
series Jonas Lundgren 17 Sep 2009 01:09:33
alternating Jonas Lundgren 17 Sep 2009 01:09:47

Contact us at files@mathworks.com