# A question about equal constraint in GP

(morteza) #1

hi . I have a equal constraint in GP as follow:
p1(t)*I1(t)==r1;
p2(t)*I2(t)==r2;
p3(t)*I3(t)==r3;
p4(t)*I4(t)==r4;
p5(t)*I5(t)==r5;
pb(t)==r6
r1+r2+r3+r4+r5+r6=r7;
r7==pl(t);
that p1(t), p2(t),p3(t),p4(t),p5(t),I1(t),I2(t),I3(t),I4(t),I5(t),r1,r2,r3,r4,r5,r6,r7,pb(t) are variables that defined and pl is a constant vector. but cvx showes error:
Disciplined convex programming error:
Invalid constraint: {log-convex} == {log-affine}

Error in == (line 12)
b = newcnstr( evalin( ‘caller’, ‘cvx_problem’, ‘[]’ ), x, y, ‘==’ );

Error in project (line 96)
r1+r2+r3+r4+r5+r6==r7

(Mark L. Stone) #2

In GP mode, if a, b, c,d,e are variables and f is a constant, you can have
`a*b == e` .
or
`a*b == f`

You can not have
`a*b+c*d == e`
or
`a*b+c*d == f`` or`a*b+c == e`or a*b+c == f` .

Per http://web.cvxr.com/cvx/doc/gp.html#constraints

Three types of constraints may be specified in geometric programs:

• An equality constraint, constructed using ==, where both sides
are monomials.
• A less-than inequality constraint <= where the left side is a
generalized posynomial and the right side is a monomial.
• A greater-than inequality constraint >= where the left side is
a monomial and the right side is a generalized posynomial.
(morteza) #3

#4

Code show as below:

When I use “<=”, it can be accepted by cvx, but “>=” is refused by CVX.
Disciplined convex programming error:
Invalid constraint: {log-convex} == {log-affine}
How should I change it to ensure that the use of “>=” can be accepted
Thanks again！

(Mark L. Stone) #5