emmbeded code, calling functions

Problems with modeling
Post Reply
lucasVDH
User
User
Posts: 1
Joined: 2 years ago

emmbeded code, calling functions

Post 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 138 times
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: emmbeded code, calling functions

Post 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
Post Reply