Some trick in NLconstraint to avoid NaN or Inf for zero initial condition ?


#1

Hello all,

I am new using JuMP. In my code, I added a thermodynamic model (UNIQUAC). When xNT1 = 0.001 it work well. But when the value is almost zero (1e-11) it doesn’t work and JuMP give me “Warning: Cutting back alpha due to evaluation error”, “WARNING: Problem in step computation; switching to emergency mode.” and others warnings because of the term “ΨNT1/xNT1”.

@NLconstraint(m, log(gamNT1) == ((log(ΨNT1/xNT1) + (z/2.0)*q[1]*log(θNT1/ΨNT1) + lj[1] - (ΨNT1/xNT1)*(xNT1*lj[1]+xNT2*lj[2]+xNT3*lj[3]+xNT4*lj[4])) + (q[1]*(1.0-log(fNT1)-(dNT1))) ) )

I tried to use “ConditionalJuMP.jl” but I am using ipopt solver and it gives me that ipopt “Solver does not support discrete variables”
So, there is some way to avoid that problem?
In MATLAB I just use the if condition.
If xNT1 == 0
gamNT1 = 1
else
log(gamNT1) == ((log(ΨNT1/xNT1) +…,


#2

Sorry, everyone,
I solved the problem.