dollar condition problem

Problems with modeling
Post Reply
irem
User
User
Posts: 6
Joined: 5 years ago

dollar condition problem

Post by irem »

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: 372
Joined: 7 years ago

Re: dollar condition problem

Post by Fred »

Hi,

Your parentheses do not match. You need

Code: Select all

...)$(...
instead of

Code: Select all

...)($...
.

I hope this helps!

Fred
irem
User
User
Posts: 6
Joined: 5 years ago

Re: dollar condition problem

Post by irem »

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) ;
Post Reply