Closed AlexandreAmice closed 3 days ago
PositiveSemidefiniteConstraint in principle allows a user to have repeated variables in the binding, e.g. a Hankel matrix:
PositiveSemidefiniteConstraint
[x₀, x₁, x₂] [x₁, x₂, x₃] [x₂ ,x₃, x₄]
This does not get parsed correctly by our MosekSolver. A Python reproduction is below:
from scipy.linalg import hankel from pydrake.all import ( MathematicalProgram, ClarabelSolver, MosekSolver, SolverOptions ) prog = MathematicalProgram() n = 3 num_hankel = 2*n-1 x = prog.NewContinuousVariables(num_hankel, "x") X = hankel(x[:n], x[n-1:]) prog.AddPositiveSemidefiniteConstraint(X) prog.AddLinearConstraint(x[1] >= 1) prog.AddLinearCost(np.trace(X)) options = SolverOptions() mosek = MosekSolver() clarabel = ClarabelSolver() result_mosek = mosek.Solve(prog, solver_options=options) result_clarabel = clarabel.Solve(prog, solver_options=options) print(f"{result_mosek.GetSolution(X)=}") print(f"{result_clarabel.GetSolution(X)=}") print(f"{result_mosek.get_optimal_cost()=}") print(f"{result_clarabel.get_optimal_cost()=}")
If one increases the size of the hankel matrix, mosek gets a unknown solver status.
cc @rhjiang for finding this.
No response
What happened?
PositiveSemidefiniteConstraint
in principle allows a user to have repeated variables in the binding, e.g. a Hankel matrix:This does not get parsed correctly by our MosekSolver. A Python reproduction is below:
If one increases the size of the hankel matrix, mosek gets a unknown solver status.
cc @rhjiang for finding this.
Version
No response
What operating system are you using?
No response
What installation option are you using?
No response
Relevant log output
No response