dollar condition problem

Problems with modeling
Post Reply
irem
User
User
Posts: 5
Joined: 1 year ago

dollar condition problem

Post by irem » 7 months ago

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

Re: dollar condition problem

Post by Fred » 7 months ago

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: 5
Joined: 1 year ago

Re: dollar condition problem

Post by irem » 7 months ago

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