I found the problem.. it was my mistake. and it works. !
By the way, I appreciate answering my question. And I have several more questions. Could you answer me?
1. I have another constraint in AMPL as below and want to transfer this syntax to my Pyomo model.
subject to xapp_endProcess00 {a in 1..2, t in 1..23}:
T[1] - sum{n in 1..t} xapp_state[1,n] <= M*(1-xapp_state[2,t+1]) ;
T is a parameter (constant number), xapp_state is the binary variable and M is a big number (constant). When a= 1 or 2, it has several different kinds of summation equations. For example, when a=1, the equation is as follows :
t==1 : T[1] - sum{n in 1..1} xapp_state[1,n] <= M*(1-xapp_state[2,2]) ;
t==2 : T[1] - sum{n in 1..2} xapp_state[1,n] <= M*(1-xapp_state[2,3]) ;
.
.
.
t==22 : T[1] - sum{n in 1..22} xapp_state[1,n] <= M*(1-xapp_state[2,23]) ;
t==23 : T[1] - sum{n in 1..23} xapp_state[1,n] <= M*(1-xapp_state[2,24]) ;
Can you explain how to transfer this constraint to the Pyomo syntax?
2. I'd like to see the result of one variable in my abstract model as the matrix format as below.
xapp_state[i,j]: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0 0 0
2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0
3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0
4 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
5 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0;
However, the console window shows the result of the variable as below and it is really hard to identify it. In AMPL, it automatically shows me the matrix format, but, What do I have to do to see the result of the variable as the matrix format?
Variables:
xapp_state : Size=120, Index=onOff_index
Key : Lower : Value : Upper : Fixed : Stale : Domain
(1, 1) : 0 : 0.0 : 1 : False : False : Binary
(1, 2) : 0 : 0.0 : 1 : False : False : Binary
(1, 3) : 0 : 0.0 : 1 : False : False : Binary
(1, 4) : 0 : 0.0 : 1 : False : False : Binary
(1, 5) : 0 : 0.0 : 1 : False : False : Binary
(1, 6) : 0 : 0.0 : 1 : False : False : Binary
(1, 7) : 0 : 0.0 : 1 : False : False : Binary
(1, 8) : 0 : 0.0 : 1 : False : False : Binary