Hey guys, so I’m pretty new to GAMS and am trying to figure this out on a rush.

Can anyone point me in the right direction?

I am getting

Dimension different - The symbol is referenced with more/less

indices as declared

at the cost equation and

Uncontrolled set entered as constant

ub the r1 and r2 equations… I can’t solve it for nothing

Thanks in advance!

```
Sets
i months / 1, 2, 3 /
j months / 1, 2, 3 /;
Parameters
cp(i) production cost in month i
/ 1 1.08
2 1.11
3 1.10
/
rh(i) number of necessary workers in month i
/ 1 3
2 4
3 6
/
cap(i) production capacity in month i
/ 1 25
2 20
3 25
/
q(j) number of motors to deliver in month j
/ 1 10
2 15
3 25
/
Scalar ca cost to store motors for a month /0.15/ ;
variables
mc(i,j) cost of production of motors in month i to be delivered in month j
x(i,j) number of motors produced in month i to be delivered in month j;
free variables
wf workforce
z cost of production
hr human resources;
Equations
cost cost
human_resources human resources
r1 restriction1
r2 restriction2 ;
cost .. z =e= sum((i,j), (cp(i)+(j-i)*ca)*x(i,j)) ;
human_resources .. hr =e= sum(i, sum(j, rh(i)*x(i, j))) ;
*lower than
r1.. sum(j, x(i,j)) =l= cap(i) ;
*greater than
r2.. sum(i, x(i,j)) =g= q(j) ;
Model
motors 'temp' /all/;
Solve motors using mip minimizing mc;
Display mc, x;
```