Code covered by the BSD License  

Highlights from
Aitken delta squar method

Aitken delta squar method

by

 

this is program about aitken accerlerating method

Aitken.m
%Accelerating Convergence
%11 The following sequences converge to 0. Use Aitken's delta square method
%to generate{pn^} until|pn^|<=5*1E-2

format short g
% p=inline('1/x');%where n>=1
p=inline('cos(1/n)');%where n>=1
%p=inline('1/(x^2)');%where n>=1
% p=inline('sqrt(2*x+3)');%where n>=1

aitken=[0 0 0];
for n=1:1000
    pn=p(n);
    pn1=p(n+1);
    pn2=p(n+2);
    pnhat=pn-((pn1-pn)^2)/(pn2-2*pn1+pn); 
    aitken=[aitken;n,pn,pnhat];
%     if abs(pnhat)<=5*1E-10
%         break;
%     end
end

% if abs(pnhat)>5*1E-2
%     disp('fail to find root with Aitken delta square method');
% else
    disp('                 Aitken delta^2 method')
    disp('         Iteration       pn        pnhat')
    disp(aitken)
% end
    

Contact us