You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am trying to run MOSEK using the following code (with inputs: X_0T: [n, T], X_1T: [n, T], U_0T: [m, T], Qx >= 0, R > 0, N, muf, Sigmaf >= 0 of appropriate dimension):
% Get dimensions
n = size(X_0T, 1);
m = size(U_0T, 1);
T = size(X_0T, 2);
% Define optimization variables
H = sdpvar(T, N + 1);
Sigma = sdpvar(n, n, N + 1);
Pi = sdpvar(T, n, N + 1);
Z = sdpvar(m, m, N);
% Define cost function
meanCost = 0;
covCost = 0;
Qtilde = X_0T' * Qx * X_0T;
Rtilde = U_0T' * R * U_0T;
Stilde = Qtilde + Rtilde;
for k = 1 : N + 1
meanCost = meanCost + H(:, k)' * Stilde * H(:, k);
end
for k = 1 : N
covCost = covCost + trace(Qx * Sigma(:, :, k)) + trace(Z(:, :, k));
end
objective = meanCost + covCost;
% Define constraints
Constraints = [];
% Initial condition
Constraints = [Constraints, Sigma(:, :, 1) >= eye(n)];
% Terminal conditions
terminalMeanConstraint = X_0T * H(:, N + 1) == muf;
terminalCovConstraint = -Sigma(:, :, N + 1) + Sigmaf >= 0;
Constraints = [Constraints, terminalMeanConstraint];
Constraints = [Constraints, terminalCovConstraint];
% Covariance dynamics constraints
for k = 1 : N
cov_dynamics_k = [Sigma(:, :, k + 1) - eye(n) X_1T * Pi(:, :, k);
Pi(:, :, k)' * X_1T' Sigma(:, :, k) ] >= 0;
Constraints = [Constraints, cov_dynamics_k];
end
% Mean dynamics constraints
for k = 1 : N
mean_dynamics_k = X_0T * H(:, k + 1) == X_1T * H(:, k);
Constraints = [Constraints, mean_dynamics_k];
end
% Cost condition
for k = 1 : N
LMI_cost_k = [Z(:, :, k) sqrtm(R) * U_0T * Pi(:, :, k);
Pi(:, :, k)' * U_0T' * sqrtm(R) Sigma(:, :,k) ] >= 0;
Constraints = [Constraints, LMI_cost_k];
end
% Equality constraints
for k = 1 : N + 1
Constraints = [Constraints, Sigma(:, :, k) == X_0T * Pi(:, :, k)];
end
% Solve the Problem
options = sdpsettings('solver','mosek');
sol = optimize(Constraints, objective, options);
I am running into an issue where the optimizer says 'Solver not applicable (mosek does not support semidefinite constraints)'. I am a bit confused by this because all of my inequality constraints are written as LMI's, which MOSEK can handle (I have a similar optimization problem that is dual and feasible, and many of the constraints are exactly the same). So, my question is in particular which constraints that I have in this optimization problem are causing problems for MOSEK? Thank you!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I am trying to run MOSEK using the following code (with inputs:
X_0T: [n, T], X_1T: [n, T], U_0T: [m, T], Qx >= 0, R > 0, N, muf, Sigmaf >= 0
of appropriate dimension):I am running into an issue where the optimizer says 'Solver not applicable (mosek does not support semidefinite constraints)'. I am a bit confused by this because all of my inequality constraints are written as LMI's, which MOSEK can handle (I have a similar optimization problem that is dual and feasible, and many of the constraints are exactly the same). So, my question is in particular which constraints that I have in this optimization problem are causing problems for MOSEK? Thank you!
Beta Was this translation helpful? Give feedback.
All reactions