I need to use an external python function to create a constraint in a pyomo model, but I do not trust that it works as it should. E.g. if I have the following external function
# External function
def total_cost(length, flow):
return length * floww * 1000
and then I want to call it when creating a pyomo model object but 'length' and 'flow' values are variables within my model, will that work as it should? Anyone has any experience with this?