## dollar condition problem

Problems with modeling
irem
User Posts: 5
Joined: 10 months ago

### dollar condition problem

Hi,
I have to use the if statement for my model. But I get an error for this equation. Why didn't I get the error? I'd appreciate it if you could help.

Eq.. const26(m,t).. sum((i,k),A(i,m,k,t))(\$sum(i,d(m,t,i)) gt r(m,t)) =e= sum(i,db(m,t,i)) ;

Error:

**** const26(m,t).. sum((i,k),A(i,m,k,t))(\$sum(i,d(m,t,i)) gt r(m,t)) =e= sum(i,db(m,t,i)) ;
\$37,409

37 '=l=' or '=e=' or '=g=' operator expected
409 Unrecognizable item - skip to find a new statement
looking for a ';' or a key word to get started again

Fred
Posts: 158
Joined: 3 years ago

### Re: dollar condition problem

Hi,

Your parentheses do not match. You need

Code: Select all

``...)\$(...``

Code: Select all

``...)(\$...``
.

I hope this helps!

Fred

irem
User Posts: 5
Joined: 10 months ago

### Re: dollar condition problem

Thanks your answer. I've solved this problem, but I have another problem. I couldn't figure out how to write this equation because the variables for the following constraint cannot be written into the if statement (dollar condition). If the second index of Q is 4, I want that value to be 0 if this index is 10. How can I do it ? I'd appreciate it if you could.

const20(iprime(i),k,t).. Q(i,'4',k,t) =e= 0\$(Q(i,'10',k,t) gt 0) ;