fmincon for matrix optimization
Show older comments
I am trying to solve the following minimization problem:

- where the
is a positive number, Wis a 11-by-3 orthogonal (eigenvector) matrix, and Ω is the 3-by-3 diagonal (eigenvalue) matrix - the free parameters to be optimized are the last column vector (11-by-1) of W, and the last eigenvalue (1-by-1 schaler) in Ω.
Subject to the constraints:

.
I am looking at fmincon, but the problem seems to be not as straight forward as I initially thought. Below is my wroking code.
In particular, I want to know:
1. whether the following structure is correct
2. how to make "myObjectivefunction" to optimise the vector and scaler values at the same time
optimized = fmincon(@(x) myObjectivefunction, initialV,[],[],w',beq,[],[],@nonLinconVec,options);
- optimized is a 12-by-1 vector of outputs. I put the eigenvalue in the first element, and the eigenvector in to (2:end) of the vector (not sure if it's correct or not)
- [w', beq] satisfies the first constraint (verified)
- @nonLinconVec: a separate file for the second constraint (verified)
I truly appreciate your help and suggestions!
4 Comments
David Wilson
on 24 May 2019
Here's my take on your problem.
I've made up my own numbers, and for that reason it doesn't solve very well, and there are a few possible reasons for this.
I've followed your partitioning suggestion with x defined as [lamda3; w3].
The objective function is straight forward, but the nonlinear constraint less so. Below I've used equality constraints, but I suspect that they are too difficult to exactly solve, so a better approach would be to minimise their residuals.
function rc = foptprob()
A = randn(11);
[W,~] = qr(A); % W is orthogonal
omega12 = [1,2]';
lam0 = 6;
target = 105;
W12 = W(:,[1,2]);
x0 = [lam0; W(:,end)]; % start guess
% j = fobj(x0, target, W12, omega12)
% Now try
A = []; B = []; Aeq = []; Beq = []; LB = []; UB = [];
xstar = fmincon(@(x) fobj(x, target, W12, omega12), ...
x0,A,B,Aeq,Beq,LB,UB, @(x) nonlcon(x, W12))
rc = xstar;
end
function j = fobj(x, target, W12, omega12)
lam = x(1);
w3 = x(2:end);
W = [W12, w3];
Omega = diag([omega12(:); lam]);
j = target - trace(W*Omega*W');
end
function [C, Ceq] = nonlcon(x,W12)
% Satisfy the 3 equality constraints
w3 = x(2:end,1);
w1 = W12(:,1); w2 = W12(:,2);
Ceq = [w1'*w3; w2'*w3; w3'*w3 - 1];
C = [];
end
yp78
on 24 May 2019
yp78
on 24 May 2019
Answers (0)
Categories
Find more on Problem-Based Optimization Setup 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!
