pen, P_linha, sumPen and sumPen2 are variables; lim_linhas is a parameter;

This is basically what I'm trying to do:

Code: Select all

```
penCalc(l,t,ind).. pen(l,t,ind) =e= (P_linha(l,t,ind) - lim_linhas(l))*10000;
penCalc2(l,t,ind).. IF (pen(l,t,int) =l= 0) THEN pen(l,t,int) = 0;
penCalc3(l,ind).. sum(t, pen(l,t,ind)) =e= sumPen(l,ind);
penCalc4(ind).. sum(l, sumPen(l,ind)) =e= sumPen2(ind);
```

Code: Select all

```
penCalc(l,t,ind).. pen(l,t,ind) =e= (P_linha(l,t,ind) - lim_linhas(l))*10000;
penCalc2(l,t,ind).. pen(l,t,ind) $ (pen(l,t,int) =l= 0) = 0;
penCalc3(l,ind).. sum(t, pen(l,t,ind)) =e= sumPen(l,ind);
penCalc4(ind).. sum(l, sumPen(l,ind)) =e= sumPen2(ind);
```

Code: Select all

```
penCalc(l,t,ind)$(P_linha(l,t,ind) - lim_linhas(l) > 0).. pen(l,t,ind) =e= (P_linha(l,t,ind) - lim_linhas(l))*10000;
penCalc2(l,t,ind)$(P_linha(l,t,ind) - lim_linhas(l) < 0).... pen(l,t,int) =e= 0;
penCalc3(l,ind).. sum(t, pen(l,t,ind)) =e= sumPen(l,ind);
penCalc4(ind).. sum(l, sumPen(l,ind)) =e= sumPen2(ind);
```

Any feedback is appreciated,