Synthax of binary variables
Posted: Wed Mar 14, 2018 7:55 pm
Hey guys,
sorry for the spaming lately, but as I said I'm quite a beginner and thus there are a lot of question, which I can't answer just with the documentary.
I'm now using binary variables in my model. But I got a problem with the execution, which I don't understand.
This is the important code:
i time steps /0*720/;
positive variable m_pb_ts(i) mass flow from power block to thermal energy storage;
positive variable m_pb_rc(i) mass flow from power block to receiver;
binary variable npb(i) not operating power block binary;
m_pb_ts.l('1') = 0;
m_pb_rc.l('1') = 0;
npb.l('1') = 1;
e_npb(i+1) .. npb(i+1) =e= (m_pb_rc(i+1) = 0 and m_pb_ts(i+1) = 0);
I'm expecting npb to be 1 in the beginning, since the mass flows should be zero.
This is what I get after executing:
---- e_npb =E= setting decision variable for not operating power block mode
e_npb(1).. (0)*m_pb_ts(1) + (0)*m_pb_rc(1) + npb(1) =E= 0 ; (LHS = 0)
e_npb(2).. (0)*m_pb_ts(2) + (0)*m_pb_rc(2) + npb(2) =E= 0 ;
(LHS = -1, INFES = 1 ****)
e_npb(3).. (0)*m_pb_ts(3) + (0)*m_pb_rc(3) + npb(3) =E= 0 ;
(LHS = -1, INFES = 1 ****)
Obviously the equation doesn't work.
That is why my question is, whether there is something wrong with my syntax in defining the equation or the variable.
I'm using minlp with scip solver.
Thanks in advance!
Cheers
Max
sorry for the spaming lately, but as I said I'm quite a beginner and thus there are a lot of question, which I can't answer just with the documentary.
I'm now using binary variables in my model. But I got a problem with the execution, which I don't understand.
This is the important code:
i time steps /0*720/;
positive variable m_pb_ts(i) mass flow from power block to thermal energy storage;
positive variable m_pb_rc(i) mass flow from power block to receiver;
binary variable npb(i) not operating power block binary;
m_pb_ts.l('1') = 0;
m_pb_rc.l('1') = 0;
npb.l('1') = 1;
e_npb(i+1) .. npb(i+1) =e= (m_pb_rc(i+1) = 0 and m_pb_ts(i+1) = 0);
I'm expecting npb to be 1 in the beginning, since the mass flows should be zero.
This is what I get after executing:
---- e_npb =E= setting decision variable for not operating power block mode
e_npb(1).. (0)*m_pb_ts(1) + (0)*m_pb_rc(1) + npb(1) =E= 0 ; (LHS = 0)
e_npb(2).. (0)*m_pb_ts(2) + (0)*m_pb_rc(2) + npb(2) =E= 0 ;
(LHS = -1, INFES = 1 ****)
e_npb(3).. (0)*m_pb_ts(3) + (0)*m_pb_rc(3) + npb(3) =E= 0 ;
(LHS = -1, INFES = 1 ****)
Obviously the equation doesn't work.
That is why my question is, whether there is something wrong with my syntax in defining the equation or the variable.
I'm using minlp with scip solver.
Thanks in advance!
Cheers
Max