I have 2 issues. Firstly I need to declare the square of a variable with 2 arguments, but sqr(V(i,t)) doesn’t work.
As for the other, I have the following parameter: LPline_max(f,t,seg) and declared the variable LP_line(f,t,seg). However the following equation gives the errors 145 and 148 for both of them.
That makes little sense. What should it mean to declare the sqr of a variable? You can use the sqr of a variable in an expression in an equation or in an assignment statement:
Set i /1*24/
t /1*24/;
Variables V(i,t);
equation e;
e.. sum((i,t), sqr(V(i,t)) =l= 1;
So if the variable only shows up squared in the model then it is a “naming” issue. Just call the variable Vsqr and after the solve you get the value of V by taking sqrt of Vsqr and decide about the sign.