Hi all,
I am trying to understand a Pyomo error and would appreciate some advice. As a small example, this is what I am trying to do:
model.B = Set()
model.H = Set()
model.IncidenceMatrix = Param(model.B, model.H, default=0.0) #IncidenceMatrix is just a mapping b/w B and H. 1 indicates mapping.
In the datafile, I write:
param IncidenceMatrix :=
'w' '30067' 1
'x' '30056' 1
'y' '30089' 1....
While reading in the data, Pyomo's error resembles this -> "ERROR: Constructing component 'GenIncidenceMatrix' from data={('x', 30056): 1, ('y', 30089): 1, .......} failed:
RuntimeError: Failed to set value for param=IncidenceMatrix, index=('x', 30056), value=1.
source error message="Error setting parameter value: Index '('x', 30056)' is not valid for array Param 'IncidenceMatrix'"
The actual datasets I am using are much larger (attached is the actual console output), but the gist of what I'm trying to do is the same. Can someone try and explain what this error means and where to start troubleshooting. Thanks!