function [fval,time]=socpsdo(A,a,b,beta,delta,n)

A0=[0 a' ;a A];
A1=[0 zeros(1,n);zeros(n,1) eye(n)];
A2=[1 zeros(1,n) ;zeros(n,1) zeros(n,n)];
A3=[sqrt(delta)*beta -sqrt(delta)*b'/2;-sqrt(delta)*b/2 zeros(n)];
Ace=cell(1,n);
for i=1:n
    row=zeros(1,n);
    row(i)=beta/2;
    cor=zeros(n);
    cor(i,:)=-b';
    Ace{i}=[0 row;row' cor];
    Anew(i,:)=Ace{i}(:)';
end

k.l=1;
k.q=n+1;
k.s=n+1;
pars.fid=0;
tic
[X,FVAL]=sedumi([1 zeros(1,n+1) A1(:)';zeros(1,n+2) A2(:)';0 -1 zeros(1,n)  A3(:)';zeros(n,2) -eye(n) Anew],[delta;1;zeros(n+1,1)],[zeros(n+2,1);A0(:)],k,pars);
time=toc;
fval=A0(:)'*X(n+3:end); 


