When i try to run i have this error: Symbol dimension mismatch! do you know why?
Nonnegative Variable
X(J) Production level of technology j
Y(FEEDSTOCK) Amount of feedstock purchased
IC(INTERMEDIATES)
IP(iNTERMEDIATES)
PP(PRODUCTS)
BP(BYPRODUCTS)
;
variable
z cost
;
Equations
feedstockcons
intcon(INTERMEDIATES) Technology capacity
intpro (iNTERMEDIATES)
propro (PRODUCTS)
bypro (BYPRODUCTS)
availa(FEEDSTOCK)
Technology(J)
Demanda Demand satisfaction
material(INTERMEDIATES)
obj1 objective function cost
;
feedstockcons(FEEDSTOCK)… Y(‘HARDWOOD’) =e= -sum((J), n(feedstock,j)*X(J)) ;
intcon(INTERMEDIATES)… IC(INTERMEDIATES) =e= -sum((J), n(intermediates,j)*X(J));
intpro(iNTERMEDIATES)… IP(iNTERMEDIATES) =e= sum((J), n(intermediates,j)*X(J));
propro (PRODUCTS)… PP(PRODUCTS) =e= sum((J), n(products,j)*X(J));
bypro(BYPRODUCTS)… BP(BYPRODUCTS)=e= sum((j),n(byproducts,j)x(j));
Technology(J)… X(J) =L= capacity(J);
Demanda… PP(‘ETHANOL’) =g= demand(‘ethanol’);
material(iNTERMEDIATES)… IC(iNTERMEDIATES)=l=IP(iNTERMEDIATES);
availa(FEEDSTOCK)… Y(FEEDSTOCK)=l=availability(FEEDSTOCK);
obj1… Z=E= PP(‘ethanol’).4572+Y(‘hardwood’)*comprice(‘hardwood’)+sum(J, unitproduction(j)*X(J))-comprice(‘aa’)*BP(‘aa’)-comprice(‘electricity’)*BP(‘electricity’)
Model transport /all/;
SOLVE TRANSPORT USING LP Minimizing Z ;
file emp / ‘%emp.info%’ /; put emp ‘* problem %gams.i%’/;
$onput
randvar demand discrete 0.4 80 0.5 100 0.1 130
stage 2 PP BP X demand
stage 2 feedstockcons intcon intpro propro bypro Technology Demanda material availa
$offput
putclose emp;
Set scen Scenarios / s1*s3 /;
Parameter
s_demand(scen) Demand realization by scenario
s_PP(scen) Units sold by scenario;
Set dict / scen .scenario.‘’
demand .randvar .s_demand
PP .level .s_PP /;
solve transport min z use emp scenario dict;
–
To unsubscribe from this group and stop receiving emails from it, send an email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Gustavo!
It is hard to tell where the error is since here you didn’t copy your
sets definitions (so I can’t see the same error you see).
Without seeing the sets definition and since it is a dimension
mismatch, it strikes me as odd that you write the variable or
parameter n over four different sets (feedstock, intermediates,
products, byproducts). Is this correct ? n would need to be declared
over a superset of all these stuff for this to work in my vision.
Regards
Claudio
On Wed, Jan 29, 2014 at 2:13 PM, Gustavo Gallardo
wrote:
When i try to run i have this error: Symbol dimension mismatch! do you know
why?
Nonnegative Variable
X(J) Production level of technology j
Y(FEEDSTOCK) Amount of feedstock purchased
IC(INTERMEDIATES)
IP(iNTERMEDIATES)
PP(PRODUCTS)
BP(BYPRODUCTS)
;
variable
z cost
;
Equations
feedstockcons
intcon(INTERMEDIATES) Technology capacity
intpro (iNTERMEDIATES)
propro (PRODUCTS)
bypro (BYPRODUCTS)
availa(FEEDSTOCK)
Technology(J)
Demanda Demand satisfaction
material(INTERMEDIATES)
obj1 objective function cost
;
feedstockcons(FEEDSTOCK)… Y(‘HARDWOOD’) =e= -sum((J), n(feedstock,j)*X(J))
;
intcon(INTERMEDIATES)… IC(INTERMEDIATES) =e= -sum((J),
n(intermediates,j)*X(J));
intpro(iNTERMEDIATES)… IP(iNTERMEDIATES) =e= sum((J),
n(intermediates,j)*X(J));
propro (PRODUCTS)… PP(PRODUCTS) =e= sum((J), n(products,j)*X(J));
bypro(BYPRODUCTS)… BP(BYPRODUCTS)=e= sum((j),n(byproducts,j)x(j));
Technology(J)… X(J) =L= capacity(J);
Demanda… PP(‘ETHANOL’) =g= demand(‘ethanol’);
material(iNTERMEDIATES)… IC(iNTERMEDIATES)=l=IP(iNTERMEDIATES);
availa(FEEDSTOCK)… Y(FEEDSTOCK)=l=availability(FEEDSTOCK);
obj1… Z=E= PP(‘ethanol’).4572+Y(‘hardwood’)*comprice(‘hardwood’)+sum(J,
unitproduction(j)*X(J))-comprice(‘aa’)*BP(‘aa’)-comprice(‘electricity’)*BP(‘electricity’)
Model transport /all/;
SOLVE TRANSPORT USING LP Minimizing Z ;
file emp / ‘%emp.info%’ /; put emp ‘* problem %gams.i%’/;
$onput
randvar demand discrete 0.4 80 0.5 100 0.1 130
stage 2 PP BP X demand
stage 2 feedstockcons intcon intpro propro bypro Technology Demanda material
availa
$offput
putclose emp;
Set scen Scenarios / s1*s3 /;
Parameter
s_demand(scen) Demand realization by scenario
s_PP(scen) Units sold by scenario;
Set dict / scen .scenario.‘’
demand .randvar .s_demand
PP .level .s_PP /;
solve transport min z use emp scenario dict;
–
“gamsworld” group.
To unsubscribe from this group and stop receiving emails from it, send an
email to gamsworld+unsubscribe@googlegroups.com.
To post to this group, send email to gamsworld@googlegroups.com.
Visit this group at http://groups.google.com/group/gamsworld.
For more options, visit https://groups.google.com/groups/opt_out.
\