Search found 9 matches
- 3 years ago
- Forum: API
- Topic: Problem occurred when trying to load embpycclib
- Replies: 1
- Views: 3739
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...
- 3 years ago
- Forum: Syntax
- Topic: Problem occurred when trying to load embpycclib
- Replies: 0
- Views: 1586
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...
- 4 years ago
- Forum: Tools
- Topic: GDX Table structure
- Replies: 2
- Views: 31066
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
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
- 4 years ago
- Forum: Tools
- Topic: GDX Table structure
- Replies: 2
- Views: 31066
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...
- 4 years ago
- Forum: Syntax
- Topic: Preventing divison by zero
- Replies: 2
- Views: 2927
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.
LMTD = (ΔT2 - ΔT1)/ Ln(ΔT2/ΔT1)
LMTD = ((ΔT1^1/3 + ΔT2^1/3)/ 2)^3
Maximum 0.3% error to be considered.
- 4 years ago
- Forum: Syntax
- Topic: Using def to define function in Embedded Python
- Replies: 1
- Views: 1839
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 ...
- 4 years ago
- Forum: Syntax
- Topic: Using def to define function in Embedded Python
- Replies: 1
- Views: 1839
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?
Thank you so much in advance!
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
- 5 years ago
- Forum: Modeling
- Topic: $Setglobal using if statement
- Replies: 2
- Views: 4183
Re: $Setglobal using if statement
Thank so much Fred.
Your sample code is working well, It was clear.
Your sample code is working well, It was clear.
- 5 years ago
- Forum: Modeling
- Topic: $Setglobal using if statement
- Replies: 2
- Views: 4183
$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...