Cannot solve error 148

Hello,

I am trying to calculate welfare losses of drought. Therefore I am building my model step by step.
However, when I try to solve for the variable “Old_demand(j,y,a)” it says I am using the variable differently then I have declared it (error 148). I cannot seem to solve this error. It is probably very simple but I cannot work it out.

Thank you for your help.
dynamisch maken code.gms (2.72 KB)

Hi
You have made the following errors:

solve IMPREX USING DNLP maximize Old_demand(j,y,a);

You are maximizing several variables at the same time (and if this would be possible, you should have written it like

solve IMPREX USING DNLP maximize Old_demand;

The maximand should be one-dimensional if you want to use (D)NLP, e.g.

OBJ =E= sum((j,y,a) , Old_Demand(i,y,a));

solve IMPREX USING DNLP maximize OBJ;