Constraint Variable Implementation via EmbeddedCode Facility

Problems with modeling
Post Reply
Jubeyer
User
User
Posts: 41
Joined: 4 years ago

Constraint Variable Implementation via EmbeddedCode Facility

Post by Jubeyer »

Hi,
I was wondering whether anyone can tell me whether it's possible to implement a constraint in GAMS where one of the variable is implemented via the embedded code facility.

To be more specific, is it possible to make the solver iterate the value of the variables which is further passed to some python library to return some values (python libarary is used to avoid some complex nonlinear equations)?

For example,
y=c*z
A*x=b*y are our constraints, but the value of z needs to be processed (calculated) with a python library and fed back to the gams environment. y has its other constraints as well which are implemented completely in GAMS.


In case, if that's not possible, can it be done in a way where the GAMS model gets solved completely and provides the value of z; and the value of z is tested with a python code to check its feasibility; if not feasible then make GAMS solve the model again for a new value? Any sample example will be highly appreciated.

Regards,
Jubeyer
Manassaldi
User
User
Posts: 118
Joined: 7 years ago
Location: Rosario - Argentina

Re: Constraint Variable Implementation via EmbeddedCode Facility

Post by Manassaldi »

Hi, maybe extrinsic functions can help you... but I'm not sure this is what you're looking for.
https://www.gams.com/33/docs/UG_ExtrinsicFunctions.html
Regards,
Juan
Post Reply