Курсовая работа: Численные методы интегрирования и оптимизации сложных систем
F(i+2)=F(i+1)+F(i);
end
j=0;
x1=a; x3=b;
L1=x3-x1;
L2=(F(n-1)/F(n))*L1+((-1)^n)/F(n)*eps;
x2=x3-L2;
x4=x1+x3-x2;
while (abs(x3-x1) > eps)
F2=x2;
F4=x4;
if ((x2 < x4)&&(norm(F2) < norm(F4)))
x1=x1; x3=x4;
x4=x1+x3-x2;
elseif ((x2 > x4)&&(norm(F2) < norm(F4)))
x1=x4; x3=x3;
x4=x1+x3-x2;
elseif ((x2 < x4)&&(norm(F2) > norm(F4)))
x1=x2; x3=x3;
x2=x1+x3-x4;
elseif ((x2 > x4)&&(norm(F2) > norm(F4)))
x1=x1; x3=x2;
x2=x1+x3-x4;
end
j=j+1;
la=x1+(x3-x1)/2;
end
l=la;