Search found 9 matches

by Youngghee
3 years ago
Forum: API
Topic: Problem occurred when trying to load embpycclib
Replies: 1
Views: 3476

Problem occurred when trying to load embpycclib

Good day, GAMS Experts When I run the code including embedded Python. Suddenly I met following error when I run other PC not connected internet. It is clear embpycclib64.dll file is not loaded correctly. Could you let me know how to resolve this error? *** Error executing Python embedded code sectio...
by Youngghee
3 years ago
Forum: Syntax
Topic: Problem occurred when trying to load embpycclib
Replies: 0
Views: 1566

Problem occurred when trying to load embpycclib

Good day, GAMS Experts When I run the code including embedded Python. Suddenly I met following error when I run other PC not connected internet. It is clear embpycclib64.dll file is not loaded correctly. Could you let me know how to resolve this error? *** Error executing Python embedded code sectio...
by Youngghee
4 years ago
Forum: Tools
Topic: GDX Table structure
Replies: 2
Views: 30421

Re: GDX Table structure

Thanks for your information.
After clicking the reset button, Case-1 style was changed to Case-2 style. So, it means there are no option to enforce the case-1 style with two dimension parameter.

- Youngghee
by Youngghee
4 years ago
Forum: Tools
Topic: GDX Table structure
Replies: 2
Views: 30421

GDX Table structure

Hello, When I make GDX table with following code. two different table structure are coming. How could I enforce the case-1 style? set i /i1 * i10/; set j /j1 * J3/; parameter a(i, j); a(i, j) = uniform(1, 10); execute_unload 'gdxlayout1.gdx' a; parameter b(i, j); b(i, j) = uniform(1, 10); execute_un...
by Youngghee
4 years ago
Forum: Syntax
Topic: Preventing divison by zero
Replies: 2
Views: 2865

Re: Preventing divison by zero

You can use following second equation to avoid 'divided by zero' error.

LMTD = (ΔT2 - ΔT1)/ Ln(ΔT2/ΔT1)
LMTD = ((ΔT1^1/3 + ΔT2^1/3)/ 2)^3

Maximum 0.3% error to be considered.
by Youngghee
4 years ago
Forum: Syntax
Topic: Using def to define function in Embedded Python
Replies: 1
Views: 1814

Re: Using def to define function in Embedded Python

My question was clear by myself. the example code is like below. Scalar parA, parB; Scalar parResult; parA = 10; parB = 20; option clear=parResult; embeddedCode Python: x = list(gams.get("parA"))[0] y = list(gams.get("parB"))[0] def plus(x, y): return x+y def minus(x, y): return ...
by Youngghee
4 years ago
Forum: Syntax
Topic: Using def to define function in Embedded Python
Replies: 1
Views: 1814

Using def to define function in Embedded Python

Hello, GAMS experts

Recently, I am studying 'embeddedCode Python:' at GAMS model. is it possible to use 'def' to define new function at Embedded Python?

Code: Select all

GAMS Code

embeddedCode Python:

def my_function(x, y):
  return x+y
  
my_function

endEmbeddedCode

GAMS Code
Thank you so much in advance!
by Youngghee
5 years ago
Forum: Modeling
Topic: $Setglobal using if statement
Replies: 2
Views: 4091

Re: $Setglobal using if statement

Thank so much Fred.
Your sample code is working well, It was clear.
by Youngghee
5 years ago
Forum: Modeling
Topic: $Setglobal using if statement
Replies: 2
Views: 4091

$Setglobal using if statement

Hello, GAMS experts I would like to branch to two different module base on scalar 's'. The following is my GAMS code, however it is not working correctly. Please help me what is problem for this model. If know, let me know what is best solution. scalars s / 100 / ; if (s > 0, $Setglobal optcase &quo...