pamela....@gmail.com
unread,Aug 27, 2008, 12:46:01 PM8/27/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to AMPL Modeling Language
Hi all,
I am trying to solve a non-linear system of equations, I am using
Knitro and I have my data in a data file. When I run the program I get
the following error:
"r is not defined"
context: focd1:sum{r in R} (1/(nn*d3))*bid[r,1]+(V[r]-pzero[r])*((1/nn)
+1)
I get that message twice for var focd1, four times for var focd2, and
four times for var focd3. Then I get a message that says "bailing out
after 10 warnings".
Does anyone knows what I am doing wrong (my program is pasted below)?
Thanks,
Pamela
The program
param nn; #:=3 # number of bidders
param nr; #:=100 # number of simulations
set N := 1..nn; # N is the index set of bidders
set R := 1..nr; # R is the vector simulations
## Define input data: This input data is defined in the data file
param V {r in R}; # V[r] is the value of the object at simulation r
param S {r in R, n in N} ; #S[r,n] signal for bidder n at simulation r
param Si {r in R}; #S[r] signal for bidder i (the first bidder) at
simulation r
#variables
var d1;
var d2 <= 0, := 0;# := starting value
var d3 <= 0, := 0;
var pzero{r in R}=(1-nn*d1-d2*sum{n in N}(1/S[r,n]))/(nn*d3);
var bid {r in R, n in N} = d1+d2/S[r,n]+d3*pzero[r];
##When I write bid[r,1], what I want is to sum the first column of the
matrix bid
var focd1 = sum{r in R} (1/(nn*d3))*bid[r,1]+(V[r]-pzero[r])*((1/nn)
+1);
var focd2 = sum{r in R} ((1/Si[r])/(nn*d3))*bid[r,1]+(V[r]-
pzero[r])*(((1/Si[r])/nn)+(1/Si[r]));
var focd3 = sum{r in R} (pzero[r]/(nn*d3))*bid[r,1]+(V[r]-
pzero[r])*((pzero[r]/nn)+pzero[r]);
maximize obj : 1;
subject to
focd11 : focd1 = 0;
focd21 : focd2=0;
focd31 : focd3 =0;
positivebids {r in R, n in N}: bid[r,n] >= 0;