function [f,g] = FUN1(x)
global F_index
   
% Min 4 objectives

E = 29e3; 
L = 60; %ft

A1 = x(1); A2 = x(2); A3 = x(3); xpos = x(4);
t = x(5); a = x(6);
u = x(7); y = x(8);

if F_index == 5,
   f = u^2 + y^2; % total displacement (ft.) squared
end
if F_index == 1,
   f = (A1/sin(t) + A2 + A3/sin(a))*(L/144); % Volume of design in cu. ft.
end
if F_index == 2, 
   f = 0.01*E*sin(t)*(y*sin(t) + u*cos(t))/L; % Stress in left bar
end 
if F_index == 3,
   f = 0.01*E*A2*y/L; % Stress in middle bar
end 
if F_index == 4,
   f =  0.01*E*sin(a)*(y*sin(a) - u*cos(a))/L; % Stress in right bar (ksi)
end  

[fdummy, ce, ci] = FUN(x);

g = [ce;ci];