Search found 1038 matches

by bussieck
1 year ago
Forum: Modeling
Topic: Can a binary variable be used for CGE simulations?
Replies: 1
Views: 1176

Re: Can a binary variable be used for CGE simulations?

CGE is not a model type in GAMS but a class of economic models (https://en.wikipedia.org/wiki/Computable_general_equilibrium) that are often implemented as MCP or NLP GAMS model types. NLP model types can be combined with discrete variables resulting into the MINLP type. All variable types in GAMS c...
by bussieck
1 year ago
Forum: API
Topic: ModuleNotFoundError: No module named '_gams2numpy'
Replies: 9
Views: 45644

Re: ModuleNotFoundError: No module named '_gams2numpy'

This now sounds like a version mix up. Which GAMS system is active? Why did the GAMS installation files end up in the USER_BASE directory rather than the site-package directory of the conda environment? I also see that you had interaction with GAMS support and ran python setup.py install from the Po...
by bussieck
1 year ago
Forum: Syntax
Topic: Finding type of an integer variable
Replies: 2
Views: 1389

Re: Finding type of an integer variable

The trick is to represent x as 2*y + z where y is another integer variable and z a binary. x can even be continuous but will automatically assume integer values. z=1 tells you that x is odd, z=0 tell you that x is even. You can use the binary variable z in some logic constraints to enforce your othe...
by bussieck
1 year ago
Forum: API
Topic: ModuleNotFoundError: No module named '_gams2numpy'
Replies: 9
Views: 45644

Re: ModuleNotFoundError: No module named '_gams2numpy'

Was the "python setup.py install" successful? Perhaps you can share the output of the command. What about setting the SETUPTOOLS_USE_DISTUTILS environment variable? -Michael
by bussieck
1 year ago
Forum: API
Topic: ModuleNotFoundError: No module named '_gams2numpy'
Replies: 9
Views: 45644

Re: ModuleNotFoundError: No module named '_gams2numpy'

What anaconda version, what Python version? See https://conda.io/projects/conda/en/late ... vironments to produce a spec list. Please share this and give the exact sequence of command that resulted in the failure.

-Michael
by bussieck
1 year ago
Forum: API
Topic: Cannot get gdxcc module in the right path (Python API)
Replies: 2
Views: 4805

Re: Cannot get gdxcc module in the right path (Python API)

There is currently no "pip" for the GAMS modules. So not clear what you mean by "pip install". The install of the GAMS modules works by "cd <gams_sysdir>\apifiles\Python\api_39 && python setup.py install" as you can read from https://www.gams.com/latest/docs/API...
by bussieck
1 year ago
Forum: Syntax
Topic: Loop and summation upper limit
Replies: 12
Views: 3377

Re: Loop and summation upper limit

If you look at the constraint, it needs to be indexed by t and j. Your GAMS code indexes by t, j, and tp. I see no reason for tp. Moreover, when you sum over a tuple (tp,k) your syntax was just wrong. Here is the (IMHO) correct version of Eqn11: Eqn11(PL(j),t).. sum((tp,k)$(ord(tp)<=ord(t)),NU(j,k,t...
by bussieck
1 year ago
Forum: Syntax
Topic: Loop and summation upper limit
Replies: 12
Views: 3377

Re: Loop and summation upper limit

Send the entire model because compilation errors often relate to other code pieces.

-Michael
by bussieck
1 year ago
Forum: Modeling
Topic: how to write the quadratic and logarithmic model in GAMS
Replies: 9
Views: 2228

Re: how to write the quadratic and logarithmic model in GAMS

In the "else" or false_expression part of the function: ifthen(expression, true_expression, false_expression). -Michael
by bussieck
1 year ago
Forum: Syntax
Topic: Load dimension are different error
Replies: 4
Views: 1635

Re: Load dimension are different error

I think this comes pretty close: https://www.gams.com/latest/docs/T_GDXX ... DSHEET_PAR. Experiment and see how to adjust it to your own situation. Good luck.

-Michael