T3.2
function[f,g]=fun3_2(x);
g=[];
th0=[243 236 220.5 159 230 52]';
th=th0+x;
x0=[150 85 150 145 130 0]';
y0=[140 85 155 50 150 0]';
k=1;
for i=1:5
for j=i+1:6
aij=4*(sind((th(i)-th(j))/2))^2;
bij=2*((x0(i)-x0(j))*(cosd(th(i))-cosd(th(i))));
cij=(x0(j)-x0(j))^2+(y0(i)-y0(j))^2-64;
f(k)=bij^2-4*aij*cij;
k=k+1;
end
end
T3.3
c=[c;zeros(num,1)];
a1=10000*diag(ones(num,1));
[h,l]=size(A);
a2=zeros(h-num,num);
A=[A,-[a1;a2]];
lk=length(c);
[hp,lp]=size(p);
p=[[p,zeros(hp,num)];zeros(1,lp),ones(1,num)];
q=[q;num-1];
[x,minf]=intlinprog(c,lk+1:lk+num,A,B,p,q,zeros(lk+num),[100*ones(1,lk),ones(1,num)]);
end
T3.4