ur and vr are given 200-dimensional vectors. v0 is scalar.
The output is: Disciplined convex programming error:
Invalid constraint: {convex} <= {convex}
In my opinion, The right-hand side of this inequality is affine, or it’s convex and it’s concave. So I can’t understand the error. How can I fix this?
Are you sure the error message pertains to that line of code?
If ur, v0, vr are all input data, as you say, then the RHS appears is affine in u and v.
Can you show a complete reproducible problem, with all input data? Maybe you can reduce 200 dimensions to 2 dimensions and still exhibit the error message?
The code in your first post is NOT!!! an extract of the complete code. Your first post showed that v is a variable, In your complete code, v is declared an expression, and its elements are set to norm(...) which are convex. That is why the RHS of the inequality is convex, not affine.
Although the RHS is affine with respect to v, it is not affine with respect to the the optimization variables. It is convex with respect to the optimization variables.
I will assume that constraint, and hence your problem, is non-convex unless you show otherwise.
Thank you Mark, now I understand why I got the errors. But how can I fix this? Can I turn v into a variable? I try to use v as a variable before, But I got another quesion. See how-can-i-express-this-constraint-in-dcp-ruleset
If you read the link I posted, you apparently didn’t understand it. Please read it carefully.
You are using norm in a non-convex way, on the RHS of a <= inequality. That is not allowed, and is not a convex constraint unless the RHS convex terms “net out” with something on the LHS.