syntax error

6 views
Skip to first unread message

Rupsana Parveen

unread,
Apr 20, 2016, 2:44:27 PM4/20/16
to AMPL Modeling Language
Can anyone tell me why I am getting syntax error here? 

subject to x1bounds12: x1[2]=  (((x21 * 0.62567819)-0.554609929)*1.5)+1.5;
subject to x2bounds11{j in 1..nsample: x2[1,j]= ((((x12[j] * 0.461011466)-0.809929078)*1.5)+1.5);


error message :


mymodel.mod, line 1035 (offset 24129):
syntax error
context:  subject to x2bounds11{j in 1..nsample: x2[1,j]= ((((x12[j] *  >>> 0.461011466)-0.809929078)*1.5)+1.5); <<<   

Is it because of using too many digit after decimal ? If so then why 1st constraint is error free while AMPL is saying second one has syntax error ?




Thanks in advance.

Victor Zverovich

unread,
Apr 20, 2016, 2:51:27 PM4/20/16
to am...@googlegroups.com
Looks like the error is caused by missing '}' in the declaration of x2bounds11.

HTH,
Victor

--
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.

Rupsana Parveen

unread,
Apr 20, 2016, 7:08:33 PM4/20/16
to AMPL Modeling Language
Thanks Victor. I didn't notice it. Thanks for your prompt reply.
Reply all
Reply to author
Forward
0 new messages