% Clear Old Variables
yalmip('clear'); C1=[]; C2=[]; C3=[]; C4=[];
Z0=sdpvar(nx); Z1=sdpvar(nu,nx); for ii=1:nz mu(ii)=sdpvar(1); end
C1=[Z0 >= 0, mu>=0];
C2=[[Z0-Gd*Sigw*Gd' (Ad*Z0-Bd*Z1); (Ad*Z0-Bd*Z1)' Z0] >= 0];
Izz=eye(nz);
for ii=1:nz rho_i=Izz(ii,:);
C3=[C3,[mu(ii) rho_i*(Dx*Z0-Du*Z1);(Dx*Z0-Du*Z1)'*rho_i' Z0]>=0];
end
% muj < zeta_maxj
for ii=1:nz C4=[C4, mu(ii) <= zeta_max(ii)]; end
Constraints=[C1,C2,C3,C4];
options = sdpsettings('verbose',0,'solver','mosek');
sol = optimize(Constraints,[],options);
if sol.problem == 0 % problem is feasible
Z0feas=value(Z0), Z1feas=value(Z1),
for ii=1:nz mufeas(ii)=value(mu(ii)); end
ZZfeas=(Dx*Z0feas-Du*Z1feas)inv(Z0feas)(Dx*Z0feas-Du*Z1feas)'
LLfeas=Z1feas/Z0feas, eig(Ad-Bd*LLfeas)
Sigx=dlyap(Ad-Bd*LLfeas,Gd*Sigw*Gd')
Sigz=(Dx-Du*LLfeas)Sigx(Dx-Du*LLfeas)'
qlabels=char('Mass Position (m)','Manipulated Variable (N)');
q_ossop=zeros(1,nz);qstar=zeros(1,nz); sigzmax=sqrt(zeta_max);
qmin=-sigzmax;qmax=sigzmax; SigmaZ=Sigz; alpha=1;
qqmin=1.0e+07 * [-3.8788 0 -0.0043]';qqmax=-qqmin;
xnum=2; ynum=1;
EDORplot(xnum,ynum,1,'y',q_ossop,qstar,qmin,qmax,SigmaZ,alpha^2,qlabels)
axis([qqmin(xnum) qqmax(xnum) qqmin(ynum) qqmax(ynum)]); box on;
set(gca, 'XTick', [-0.4:0.1:0.4]); set(gca, 'YTick', [-0.6 :0.1:0.6]);
set(gca,'FontName','Times New Roman','Fontsize',18)
elseif sol.problem == 1 % problem is infeasible
display('Infeasible Problem');
else
display('Hmm, something went wrong!'); sol.info; pause
end
2 Comments
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/461059-error-using-matlab-graphics-axis-axes-set-value#comment_703318
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/461059-error-using-matlab-graphics-axis-axes-set-value#comment_703318
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/461059-error-using-matlab-graphics-axis-axes-set-value#comment_703326
Direct link to this comment
https://au.mathworks.com/matlabcentral/answers/461059-error-using-matlab-graphics-axis-axes-set-value#comment_703326
Sign in to comment.