"bandoning compound command to accept declaration of Pmax"

778 views
Skip to first unread message

eurost...@gmail.com

unread,
Feb 27, 2017, 8:18:41 AM2/27/17
to AMPL Modeling Language
Dear All,

Hope you are all fine. I am getting the following error in my model file which I dont know where it is coming from and why:

*************************************************************
amplin, line 17 (offset 250):
	Abandoning compound command to accept declaration of Pmax.
context:  param  >>> Pmax:=0.5; <<< 		
ng commands.
Executing on neos-7.neos-server.org
 Error (2) in /opt/ampl/ampl -R amplin
*************************************************************

I searched this group as well. But I dont understand how can I debug it and from where I have done any fault. In my model file I have these declarations
for the param Pmax:

In Model File

param Pmax:=0.5;

#using it as a constraint here
subject to Max_Power_All {ma in M,kh in K}: sum{f in U} P[m,k,u] <= Pmax;

In Data File

for {is in K,kl in M} {
  let rate[kl,is] := B*(1+((Pmax/NPRBs[kl,is])*h[kl,is])/NoB);
   
};

These are the locations where Pmax is present. But what is that error.

Robert Fourer

unread,
Feb 28, 2017, 10:33:28 AM2/28/17
to am...@googlegroups.com
AMPL gives the "Abandoning compound command to accept declaration of ..." error when you try to define a model component -- such as param Pmax in this case -- inside an "if" statement or a "for" or "repeat" loop. To fix this problem you will need to move your definition of Pmax outside of such statements. There does not seem to be an error like this in the statements you show, so I suggest that you reply to am...@googlegroups.com with your complete files as attachments.

Bob Fourer
am...@googlegroups.com

=======
Reply all
Reply to author
Forward
0 new messages