Fmincon failure in optimizing an objective function which includes determinant of a matrix.
1 view (last 30 days)
Show older comments
Shankul Saini
on 24 Nov 2022
Commented: Shankul Saini
on 24 Nov 2022
Here, fmincon is not working with the below mentioned objective function, and same was working when i was finding the frobenious norm of the matrix. Can someone please help me out in this?
Nr=4;No=1;
N = 4;
h = sqrt(0.5)*(randn(N,N)+1i*randn(N,N));
g = sqrt(0.5)*(randn(N,N)+1i*randn(N,N));
phi0 = zeros(N,1);
lb = zeros(N,1);
ub = 2*pi*ones(N,1);
obj = @(phi)-det(eye(Nr)+((g*diag(exp(1i*phi))*h)*(g*diag(exp(1i*phi))*h)')/No);
[sol,~] = fmincon(obj,phi0,[],[],[],[],lb,ub);
0 Comments
Accepted Answer
Bruno Luong
on 24 Nov 2022
Make sure your objective function returns real numerical output
Nr=4;No=1;
N = 4;
h = sqrt(0.5)*(randn(N,N)+1i*randn(N,N));
g = sqrt(0.5)*(randn(N,N)+1i*randn(N,N));
phi0 = zeros(N,1);
lb = zeros(N,1);
ub = 2*pi*ones(N,1);
obj = @(phi)-det(eye(Nr)+real(((g*diag(exp(1i*phi))*h)*(g*diag(exp(1i*phi))*h)'))/No);
[sol,~] = fmincon(obj,phi0,[],[],[],[],lb,ub);
More Answers (0)
See Also
Categories
Find more on Nonlinear Optimization in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!