_________________________________________________________________________
ERROR: Rule failed when generating expression for objective obj:
AttributeError: '_SumExpression' object has no attribute 'exp'
ERROR: Constructing component 'obj' from data=None failed: AttributeError:
'_SumExpression' object has no attribute 'exp'____________________________________________________________________________
It seems like pyomo can't handle an expression with sum and exp function together. I can obtain an output without error if I just use python (i.e. instead of writing an expression in pyomo form, I tried to check by just plugging in a vector for model.x and it worked). Also, if I remove "np.exp", it works perfectly. I don't think this is an error caused by Python but related to how pyomo handles summations. Is there any way I can solve this problem?
Thanks!
Sophie
import pyomo.environ as aml
m = aml.ConcreteModel()
m.x = aml.Var()
m.c = aml.Constraint(expr=aml.exp(m.x+m.x)==1)
--
You received this message because you are subscribed to the Google Groups "Pyomo Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyomo-forum...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.