Prod operator

7 views
Skip to first unread message

R Reddy

unread,
Mar 21, 2018, 3:53:37 PM3/21/18
to AMPL Modeling Language
Hi, 

I have a constraint with product operator (please see the picture). I am using the prod (or product operator).

Below is the syntax I am using: 
s.t. Constraint3 {j in V}:
1- product {i in W} 1-p[i,j]*x[i] >= g[j];

However, I keep getting the following error, when I try to run the program (yes, W is defined):

i is not defined
context:  1- product {i in W}  >>> 1-p[i,j]*x[i] <<<  >= g[j];

Could you please help me out.

Thank you
pic_amp.png

AMPL Google Group

unread,
Mar 21, 2018, 5:49:25 PM3/21/18
to am...@googlegroups.com
You should put bracket around your expression product {i in W}(1-p[i,j]*x[i]) .

--
Paras Tiwari
am...@googlegroups.com
{#HS:545936261-3324#}
--
You received this message because you are subscribed to the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ampl+uns...@googlegroups.com.
To post to this group, send email to am...@googlegroups.com.
Visit this group at https://groups.google.com/group/ampl.
For more options, visit https://groups.google.com/d/optout.



R Reddy

unread,
Mar 22, 2018, 7:02:42 PM3/22/18
to AMPL Modeling Language
Thanks! It's working now
Reply all
Reply to author
Forward
0 new messages