Fmincon failure in optimizing an objective function which includes determinant of a matrix.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Shankul Saini
am 24 Nov. 2022
Kommentiert: Shankul Saini
am 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 Kommentare
Akzeptierte Antwort
Bruno Luong
am 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);
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Nonlinear Optimization finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!