Page 1 of 1

emmbeded code, calling functions

Posted: Thu Oct 28, 2021 5:40 pm
by lucasVDH
Hi

Hoping someone can help me with the following question:

When using embedded code, is it possible to run external python scripts or call functions from them?
I've tried with a very simple example which can actually easily be done in GAMs (without the need for embedded code) but I would like to do some complex operations later on which aren't easily implemented in GAMs.
The error I get now is "unknown symbol" at the end of the embedded code (code in attachment but without the test_script.py file because it won't let me upload it).

python script looks as followed:

def phb_reactor(glu):
phb = 0.4*glu
return phb

def co_culture(glu):
prop = 0.53*glu
ace= 0.11*glu
return prop,ace


If anyone knows more about this I'd love to hear from you!

Kind regards
Lucas

testPython.gms
(2.38 KiB) Downloaded 145 times

Re: emmbeded code, calling functions

Posted: Mon Nov 01, 2021 12:53 pm
by bussieck
You can't use embedded Python code to extend your mathematical model. You can only use embedded Python code for data manipulation. -Michael