Hello all,
I have difficulties in solving my problem. Can someone help me with GAMS Error 148
Error Messages
148 Dimension different - The symbol is referenced with more/less
indices as declared
257 Solve statement not checked because of previous errors
Thank you,
Li
Can someone help me with GAMS Error 148 Topic is solved
Can someone help me with GAMS Error 148
- Attachments
-
- Untitled_1.gms
- (456 Bytes) Downloaded 340 times
Re: Can someone help me with GAMS Error 148
Hi
You are trying to find the minimum of the variable ETA which is defined over the set i using an optimization approach.
In your case, you could just find the minimum of sum(t,p_pvf(i,t)*c_pv(i)):
In your formulation you have a i objective functions: you are trying to minimize each ETA instead of looking for the minimum of all ETA. Multi-
(take a look at https://en.wikipedia.org/wiki/Mathemati ... timization).
If you want to write an optimization problem, you have to write one objective function maximizing or minimizing one variable.
Cheers
Renger
You are trying to find the minimum of the variable ETA which is defined over the set i using an optimization approach.
In your case, you could just find the minimum of sum(t,p_pvf(i,t)*c_pv(i)):
Code: Select all
parameter
mymin
;
mymin = smin(i, sum(t,p_pvf(i,t)*c_pv(i)));
(take a look at https://en.wikipedia.org/wiki/Mathemati ... timization).
If you want to write an optimization problem, you have to write one objective function maximizing or minimizing one variable.
Cheers
Renger
____________________________________
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Enjoy modeling even more: Read my blog on modeling at The lazy economist
Re: Can someone help me with GAMS Error 148
Hi Renger,
Thanks for your answer.
In my purpose, I exactly want to minimize each ETA (ETA(1), ETA(2), ETA(3)) because I want to utilize some distributed algorithm. And p_pvf(i,t) is a variable in my future formulation.
Could you give me some advice to write it under the rule "write one objective function maximizing or minimizing one variable"?
Thank you!
Li
Thanks for your answer.
In my purpose, I exactly want to minimize each ETA (ETA(1), ETA(2), ETA(3)) because I want to utilize some distributed algorithm. And p_pvf(i,t) is a variable in my future formulation.
Could you give me some advice to write it under the rule "write one objective function maximizing or minimizing one variable"?
Thank you!
Li
- Gideon Kruseman
- User
- Posts: 24
- Joined: 6 years ago
Re: Can someone help me with GAMS Error 148
Use the loop function.
Example in the attached file.
Gideon
Example in the attached file.
Gideon
- Attachments
-
- Untitled_2.gms
- (678 Bytes) Downloaded 338 times
Gideon Kruseman
ex-ante and foresight lead @CIMMYT, big data focal point @CIMMYT, coordinator CoP socio-economic data @CGIAR_BigData
ex-ante and foresight lead @CIMMYT, big data focal point @CIMMYT, coordinator CoP socio-economic data @CGIAR_BigData
Re: Can someone help me with GAMS Error 148
It works
Thank you very much!!
Best,
Li
Thank you very much!!
Best,
Li