I develop a program using IBM Optimization Studio CPLEX(OPL), I tried to do this line :
If (P_p(t) >= (P_L(t))/(Einv ))
Pb(t) = Pb0+(Eb_c/3600)*(Pp(t)-P_L(t))/Einv)
t Є {t0,t0+1,,t0+nΔt} , Δt: step time
I did something like that :
maximize ....
subject to {
....
forall(j in NH: Pp[j] >= Pl[j]/Einv)
Pb[j] == Pb0 + (Eb_c/3600)*(Pp[j]- Pl[j]/Einv);
...
}
that give me this error : "decision variable (or expression) not allowed", and I tried a lot of solution but it's does not work, the problem that I can not find in any document, an expression or a way to do that?!
EDIT
But I don't have anything to add to explain this, the firt code I wrote in my topic, I should create it using studio CPLEX.
I tried to minimise the cost of power produced by a system, so inside subject to, I have to check a if condition for every time of simulation during period T, and if the if condition is correct then do the next line of code else we will pass to another value of Pb(t)?!
The issue is to use sample time T inside if condition and inside subject to!