Error: context: param

14 views
Skip to first unread message

khan

unread,
Jan 17, 2017, 6:13:33 AM1/17/17
to AMPL Modeling Language
Dear All,

I have defined the parameter as: 

Definition:
param m:=3;
param Pm_min{m in M};           
param Pm_min := 1 0.2 2 0.3 3 0.5;


But I dont know when I run it using NEOS. It gives me following error message: 

Error:
Error: context:  param Pm_min{m  >>> in  <<< M};           
processing data.
processing commands.


Alessandro Oscar Gilardino Arias

unread,
Jan 17, 2017, 8:36:29 AM1/17/17
to am...@googlegroups.com

You should write in this way

set M :=1..3;

Muhammad umar

unread,
Jan 17, 2017, 2:26:50 PM1/17/17
to am...@googlegroups.com
Thank you very much for your response. I did like this:

param m:=3;
set M:=1..m;

param Pm_min{m in M}; 

This part is in the data file;

param Pm_min := 1 0.2 2 0.3 3 0.5;



-- 
Best Regards 
M. Umar Khan

--
You received this message because you are subscribed to a topic in the Google Groups "AMPL Modeling Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ampl/2q788HRhWdM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ampl+unsubscribe@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.

Robert Fourer

unread,
Jan 18, 2017, 10:50:06 AM1/18/17
to am...@googlegroups.com
You cannot define m as a param ("param m") and then also as an index ("m in M"). If you want m to be a param of your model, then you will have to use a different name for the index -- for example "i in M".

Bob Fourer
am...@googlegroups.com

=======

khan

unread,
Jan 19, 2017, 4:35:02 AM1/19/17
to AMPL Modeling Language, 4...@ampl.com
Thank you very much Bob. issue resolved. :)
Reply all
Reply to author
Forward
0 new messages