Find maximum of quadratically constrained quadratic problem using MATLAB
5 次查看(过去 30 天)
显示 更早的评论
Hey,
I am trying to solve for maximized SNR at receiver of a two hop network. First hop channel coefficients are denoted by N*N matrix g and second hop channel coefficients are denoted by N*N matrix h. We have an N size array of phase tuning varibales using which we have to maximize frobenious norm of h*diag(exp(1j.*phi))*g.
with constraints that each diagnoal element should be unit modulas.
I have written the code as below. MATLAB wasn't allowing to combine complex data with optimization variable so I separted the real and imaginary part.
N=4;
h=sqrt(0.5)*(randn(N,N)+1j*randn(N,N));
h1=real(h);h2=imag(h);
g=sqrt(0.5)*(randn(N,N)+1j*randn(N,N));
g1=real(g);g2=imag(g);
k=optimproblem;
p=optimvar('p',N);
phi1=diag(cos(p));
phi2=diag(sin(p));
k.ObjectiveSense='maximize';
k.Objective=sum(h1*phi1*g1-h2*phi2*g1-h1*phi2*g2-h2*phi1*g2,'all')^2 +sum(h1*phi1*g2-h2*phi2*g2-h1*phi2*g1+h2*phi1*g1,'all')^2;
k.Constraints.intercept1 = (0<=p);
k.Constraints.intercept2 = (p<=2*pi);
sol0.p=zeros(1,N);
sol=solve(k,sol0);
cNew=sol.p;
It seems to be a non convex QCQP, can someone please help in solving this. Above code is using fmincon but it is not giving correct results.
7 个评论
Bruno Luong
2022-10-12
编辑:Bruno Luong
2022-10-12
Your original code with the objective function expressed with real/imag of phi doesn't seem to return the frobenious norm
N=4;
h=sqrt(0.5)*(randn(N,N)+1j*randn(N,N));
h1=real(h);h2=imag(h);
g=sqrt(0.5)*(randn(N,N)+1j*randn(N,N));
g1=real(g);g2=imag(g);
p=2*pi*rand(N,1);
phi1=diag(cos(p));
phi2=diag(sin(p));
sum(h1*phi1*g1-h2*phi2*g1-h1*phi2*g2-h2*phi1*g2,'all')^2 +sum(h1*phi1*g2-h2*phi2*g2-h1*phi2*g1+h2*phi1*g1,'all')^2
M = h*diag(exp(1i*p))*g;
norm(M,'fro')^2
trace(M*M')
采纳的回答
Torsten
2022-10-11
编辑:Torsten
2022-10-11
Is this the simplified version of the problem you are trying to solve ?
It seems fmincon gives the correct solution.
N = 4;
h = sqrt(0.5)*(randn(1,N)+1i*randn(1,N));
g = sqrt(0.5)*(randn(N,1)+1i*randn(N,1));
phi0 = zeros(N,1);
lb = zeros(N,1);
ub = 2*pi*ones(N,1);
obj = @(phi)-(h*diag(exp(1i*phi))*g)*(h*diag(exp(1i*phi))*g)';
[sol,fval] = fmincon(obj,phi0,[],[],[],[],lb,ub)
phi1 = -(phase(h)+phase(g.'));
obj(phi1)
15 个评论
Bruno Luong
2022-10-14
编辑:Bruno Luong
2022-10-14
The issue is NOT fmincon but it seems the formulation of the simplified problem, which is constant (=abs(h*g)) regardless the value of phi on the admissible set, so it does not give what you think is good.
The formulation and expectation, and intuition of what is right is on your side, not MATLAB so noone can help you. You told us that the fro norm is the SNR of your system. Obviously either that is wrong or either phi has no a right control of your SNR. Only you can make sense of it (or not).
更多回答(1 个)
Bruno Luong
2022-10-11
The problem of least-square minimization under quadratic constraints is known to might have many local minima. So if you use fmincon or such without care on first guess initialization it could converge to local minima.
You could use my FEX https://fr.mathworks.com/matlabcentral/fileexchange/27596-least-square-with-2-norm-constraint?s_tid=srchtitle
where one of the method use reformulation as quadratic-eigenvalue could overcome such numerical issue.
4 个评论
Torsten
2022-10-11
You've put the constraints in the objective function.
This way, you get an unconstraint optimization problem with general objective.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Linear Least Squares 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

