Minimize f(alpha) = (40 - 90 times alpha)^2 over the interval alpha_1 = 0 and al
ID: 3845481 • Letter: M
Question
Minimize f(alpha) = (40 - 90 times alpha)^2 over the interval alpha_1 = 0 and alpha_u = l. Apply the golden section search method. Use epsilon = 0.1. Identify the optimum point by hand. Also, develop your own Matlab codes for the golden section search method to verify the obtained answer from (a). Solve the following problem by using the developed Matlab codes from (b). The objective function is f(alpha) = 8 times alpha^2 - 8 times alpha + 2. In this case, the initial interval is not given. Thus, you will need to conduct the initial bracketing for the problem (c) first.Explanation / Answer
(a) The optimum point is at = 0.472
(b) Matlab Code
clc;
clear all;
lb=0;
ub=1;
error = 0.1;
iteration = 5;
coeff = double((sqrt(5)-1)/2);
k=0;
x1=lb+(1-coeff)*(ub-lb);
x2=lb+coeff*(ub-lb);
f_x1=(40-90*x1).^2;
f_x2=(40-90*x2).^2;
while ((abs(ub-lb)>error) && (k<iteration))
k=k+1;
if(f_x1<f_x2)
ub=x2;
x2=x1;
x1=lb+(1-coeff)*(ub-lb);
f_x1=(40-90*x1).^2;
f_x2=(40-90*x2).^2;
else
lb=x1;
x1=x2;
x2=lb+coeff*(ub-lb);
f_x1=(40-90*x1).^2;
f_x2=(40-90*x2).^2;
end
k=k+1;
end
% chooses minimum point
if(f_x1<f_x2)
sprintf('x_min=%f', x1)
sprintf('f(x_min)=%f ', f_x1)
else
sprintf('x_min=%f', x2)
sprintf('f(x_min)=%f ', f_x2)
end
(c) The optimum point will be at = -0.090170