CVX求解二階錐規劃時提示約束非凸Invalid constraint: {convex}
阿新 • • 發佈:2019-01-05
在利用CVX工具箱求解二階錐規劃時,加了一條不等式約束,結果報錯,在google搜到的結果是該約束非凸.
(1)首先對該約束的凸性存在疑惑
(2)如何修改可以把該約束由非凸轉凸?
code如下:
- %%%% Use CVX solve the SOPC problem
- % cvx version
- opt_n = 2*N_global + 1;
- e_b = 1e1;
- e_d = 1e-4;
- e_g = 800;
- cvx_begin
- variable b(opt_n) complex
- minimize( norm(Tb*b-ab))
- subject to
- norm(Td*b) <= sqrt(e_d);
- norm(Tb*b) >= sqrt(e_b);
- norm(b) <= sqrt(e_g);
- cvx_end
報錯結果如下:
- Warning: A non-empty cvx problem already exists in this scope.
- It is being overwritten.
- > In cvxprob (line 28)
- In cvx_begin (line 41)
- In demostration_scatter_without_to_2D_8_27_dft_add_acc (line 59)
- Error using cvxprob/newcnstr (line 192)
- Disciplined convex programming error:
- Invalid constraint: {convex} >= {real constant}
- Error in >= (line 21)
- b = newcnstr( evalin( 'caller', 'cvx_problem', '[]' ), x, y, '>=' );
- Error in demostration_scatter_without_to_2D_8_27_dft_add_acc (line 64)
- norm(Tb*b) >= sqrt(e_b);