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
elsecvxpy.sum(cvxpy.huber(R_sqrt_inv @ (y[n] -C @ x_states[n]), huberM)) forninrange(N)]) # Measurement terms: sum of |R^(-1/2)(y_n - C x_n)|_1
319
-
objective+=cvxpy.sum([cvxpy.norm(Q_sqrt_inv @ (x_states[n] -A @ x_states[n-1]), 1) ifhuberM==0
320
+
objective+=cvxpy.sum([cvxpy.norm(Q_sqrt_inv @ (x_states[n] -A @ x_states[n-1]), 1) ifhuberM<1e-3
320
321
elsecvxpy.sum(cvxpy.huber(Q_sqrt_inv @ (x_states[n] -A @ x_states[n-1]), huberM)) forninrange(1, N)]) # Process terms: sum of |Q^(-1/2)(x_n - A x_{n-1})|_1
321
322
322
323
problem=cvxpy.Problem(cvxpy.Minimize(objective))
323
324
try:
324
325
problem.solve(solver=cvxpy.CLARABEL)
325
-
exceptcvxpy.error.SolverErrorase1:
326
-
print(f"CLARABEL failed ({e1}). Retrying with SCS.")
327
-
try:
328
-
problem.solve(solver=cvxpy.SCS) # SCS is a lot slower but pretty bulletproof even with big condition numbers
329
-
exceptcvxpy.error.SolverErrorase2:
330
-
print(f"SCS failed ({e2}). Returning NaNs.")
331
-
332
-
ifx_states.valueisNone:
333
-
print(f"Solver returned None. Status: {problem.status}")
326
+
exceptcvxpy.error.SolverError:
327
+
print(f"CLARABEL failed. Retrying with SCS.")
328
+
problem.solve(solver=cvxpy.SCS) # SCS is a lot slower but pretty bulletproof even with big condition numbers
329
+
330
+
ifx_states.valueisNone: # There is occasional solver failure with huber as opposed to 1-norm
331
+
warn("Convex solvers failed with status {problem.status}. Returning NaNs.")
0 commit comments