I am trying to find the roots of the equation f(x) = 2x^3 – 6x – 1 = 0 Numerically by using FPI ( Fixed – Point – Iteration ) Method with Matlab , the first root is x = -1.641783527 and the 2nd root is x = 1.810037929 , the iteration form for this equation which make it converge to the 1st root is g(x) = (3*x + 0.5 )^(1/3) , i have took the initial value for the 1st root as x = -1.8 , after running the program i do not know why the Matlab leave the 1st root and jump to the 2nd root ? i could not find any logical reason for that ? could any one help me to find where is the problem ? the code of the program is :
clear ; clc ; close all x(1) = -1.8 ; n = 50 ; r = -1.641783527 ; for i=1:n x(i+1) = (3*x(i)+0.5)^(1/3) ; if ( abs(x(i+1) – r )>0.5e-8) x(i) = x(i+1) ; root = x ; iteration(i) = i ; error = abs(root-r); else end end root=root(:) , iteration=iteration(:) , error=error(:) plot(x,'*') , grid xlabel('iteration : n') ylabel('root')
Best Answer