Search found 16 matches
- 3 years ago
- Forum: Modeling
- Topic: how to model loop in another loop?
- Replies: 2
- Views: 3315
Re: how to model loop in another loop?
Hi You could write this as one condition: loop (it$((UB1-LB1)>TOL and (UB-LB)>TOL)), statement1 statement2 ); If you want to use two loops, you need to make an alias for it: alias(it, ait) loop (it$((UB1-LB1)>TOL), loop (ait$((UB-LB)>TOL), statement1 statement2 ); ); Cheers Renger
- 3 years ago
- Forum: Modeling
- Topic: How to add Constraints inside a loop in GAMS
- Replies: 1
- Views: 2500
Re: How to add Constraints inside a loop in GAMS
Hi You could introduce a flag. Here the idea in code: set lnr /1*10/; parameter flag(lnr); flag(lnr) = 0; flag("1") = 1; equations constrflagged 'The constraint you want to be flagged', .... constrflagged$flag(lnr).. ... model mymodel /all/; loop(lnr, solve mymodel ... ); Cheers Renger
- 3 years ago
- Forum: Solvers
- Topic: Different solutions with MCP and NLP formulation
- Replies: 1
- Views: 3831
Different solutions with MCP and NLP formulation
Hi I am running the famous dice problem from entropy econometrics. I formulated an NLP and an MCP model (Goland, Judge, Miller, Maximum Entropy Econometrics, Chapter 2). If I assume that the average of dice throws is 2, I get the same distribution for the probabilities. If I choose 1.5 as the averag...
- 4 years ago
- Forum: Archive Google Group
- Topic: MCP solver Infeasible
- Replies: 6
- Views: 11754
Re: MCP solver Infeasible
Then you run the model that solves for L and then you just write for the second model L.FX(t) = L.L(t); (you might want to use a result parameter to do this resultsL(t) = L.L(t); L.FX(t) = resultsL(t); Be aware that a variable is fixed for all model solves after the fixture. If you want to "unf...
- 4 years ago
- Forum: Syntax
- Topic: Benchmark checked with iterlim=0 but GAMS does not find solution with iterlim>0
- Replies: 7
- Views: 5725
Re: Benchmark checked with iterlim=0 but GAMS does not find solution with iterlim>0
Hi JM It seems your SAM is not perfectly balanced. 1E-4 shows that there are balance problems. The solver tries to find a solution with the maximum infeasibility below the tolerance level (something like 1E-7), so it can't find a solution because the imbalances are too big and a few imbalances can't...
- 5 years ago
- Forum: Syntax
- Topic: Infeasible solution for Hydro Optimization Problem
- Replies: 1
- Views: 2480
Re: Infeasible solution for Hydro Optimization Problem
Hi If you check your output, you will see that two of the energylim equations are limited. You limit the total production by P4capacity, so there be at least enough capacity to produce energy(g). However, There is no feasible solution because the maximum capacity is less than the demand Cheers Renge...
- 5 years ago
- Forum: Modeling
- Topic: Private ''help'' for academic purposes :-)
- Replies: 2
- Views: 2859
Re: Private ''help'' for academic purposes :-)
Sure, if you write me some papers so that I will receive the Nobel price in a few years.
Cheers
Renger
Cheers
Renger
- 5 years ago
- Forum: Modeling
- Topic: Traffic constraint
- Replies: 1
- Views: 2169
- 5 years ago
- Forum: Tools
- Topic: Reading Data from Excel , except some Cells
- Replies: 6
- Views: 5793
Re: Reading Data from Excel , except some Cells
Hi
For this you can use gdxxrw (there is a comprehensive documentation with lots of examples: https://www.gams.com/latest/docs/T_GDXXRW.html ). If there is no value in the spread sheet, this is no problem.
Cheers
Renger
For this you can use gdxxrw (there is a comprehensive documentation with lots of examples: https://www.gams.com/latest/docs/T_GDXXRW.html ). If there is no value in the spread sheet, this is no problem.
Cheers
Renger
- 5 years ago
- Forum: API
- Topic: Solvers error when calling from MatLab
- Replies: 7
- Views: 14230
Re: Solvers error when calling from MatLab
Hi It would be more useful if you attach the model you are trying to solve then letting us go through 500 lines looking for an error message. And: you could also have done what Fred and I suggested: run a simple gams file with option subsystems And show the output in your post to see if Couenne is i...