def meanX_definition(model, i):
return m.meanX[i] ==(m.x1[i]+4*m.x2[i]+m.x3[i])/6
m.meanX_const = Constraint(m.N, rule = meanX_definition)
def varX_definition(model, i):
return m.varX[i] ==((m.x1[i]-m.meanX[i])**2+ 4*(m.x2[i]-m.meanX[i])**2+(m.x3[i]-m.meanX[i])**2)/6
m.varX_const = Constraint(m.N, rule = varX_definition)def stdX_definition(model, i):
return m.desvestX[i] == sqrt(m.varX[i])
m.stdX_const = Constraint(m.N, rule = stdX_definition)
def stdX_definition(model, i):
return m.desvestX[i] == m.varX[i]**(0.5)
m.stdX_const = Constraint(m.N_notinitial_notfinal, rule = stdX_definition)
ApplicationError: Solver (ipopt) did not exit normallyOne additional note (because this comes up frequently): Erling is correct that the 2-norm as generally written can cause problems at 0. There is a “standard” reformulation that can have significantly better behavior, for example, instead of:
m.desvestX[i] == sqrt(m.varX[i])
try expressing the constraint as
m.desvestX[i]**2 == m.varX[i]
John
--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/pyomo-forum/bb75710f-758e-4225-a9bf-f28881b53a90%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pyomo-forum/8a9c373ed876492dade7deae3fc1fa84%40ES02AMSNLNT.srn.sandia.gov.