Fixed Point methode

by

 

solving any function using fixed point method

fixedpoint.m
clc
clear
disp(' Newton Raphson method program ')
disp(' By: Mohammed Kayed Al-Mostafa ')
disp(' Al - Balqa'' Applied University,')
disp(' Faculty of Engineering Technology')
disp(' Amman-Jordan , Date: 21/12/2012 ')
disp(' ----------------------------------')
disp(' Press any key to continue')
pause
clc
x1=input('x1=');
x2=input('x2=');
x3=input('x0=');
n=input('number of iteration =');
x=sym ('x');
g(x)=input('g(x)=');
z(x)=diff(g(x));
if abs(z(x1))>abs(z(x2))
    v=double(abs(z(x1)));
    r=1;
else
    v=double(abs(z(x2)));
    r=2;
end
if v>=1
clc
    fprintf('|g''(x%g)|= %g >= 1 \nso this formula is not converges',r,v)
else
    clc
    fprintf('g''(x) = %s \n',char(z(x)))
    fprintf('|g''(x%g)|= %g < 1 \nso this formula is converges\n',r,v)
    fprintf('-------------------------------------\n')
    for i=1:n
        x3=double(g(x3));
        fprintf('| the iteration number#%g | %g |\n',i,x3)
    end
        fprintf('-------------------------------------\n')
end

Contact us