Search found 9 matches

by Youngghee
8 months ago
Forum: API
Topic: Problem occurred when trying to load embpycclib
Replies: 1
Views: 651

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
8 months ago
Forum: Syntax
Topic: Problem occurred when trying to load embpycclib
Replies: 0
Views: 573

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
1 year ago
Forum: Tools
Topic: GDX Table structure
Replies: 2
Views: 9391

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
1 year ago
Forum: Tools
Topic: GDX Table structure
Replies: 2
Views: 9391

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
1 year ago
Forum: Syntax
Topic: Preventing divison by zero
Replies: 2
Views: 889

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
1 year ago
Forum: Syntax
Topic: Using def to define function in Embedded Python
Replies: 1
Views: 667

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 x-y z = plus(x, y) +...
by Youngghee
1 year ago
Forum: Syntax
Topic: Using def to define function in Embedded Python
Replies: 1
Views: 667

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
2 years ago
Forum: Modeling
Topic: $Setglobal using if statement
Replies: 2
Views: 1440

Re: $Setglobal using if statement

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

$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 "Cas...