Hi Thomas,
The parameter mu_init does not adjust the tolerance for the constraints. It changes the initial value of the barrier parameter. This barrier parameter starts out reasonably large (default: 0.1), and it is gradually reduced as the problem is solved. The value of the barrier parameter, in essence, determines how close a variable can be to its bound at the solution. If the barrier parameter is small, the variable can move close to its bound, however, the subproblem is harder to solve (more curvature from the barrier term).
I have one question and one comment:
1) For the variables you are trying to fix to zero, do you also have a bound? I.e. do you have x >= 0 and x = 0. This may cause problems with Ipopt. Since it is a barrier method, the x >= 0 constraint is not typically satisfied exactly at the solution, but is usually more like x >= eps. If this is the case, you may want to remove the lower bound for the variables you are trying to fix to zero.
2) I still suggest that you use a build action to fix the variables to zero instead of using a constraint. I believe that this does exactly what you want without any of the numerical difficulties. Your code from below would look something like the following (not tested since I don’t have the full model).
def SS_entry_exp_def(m, ss, t):
if value(m.p[m.n_inc[ss],t])**2>=value(m.p_ss[ss,t])**2: #Expander
return m.PW_SS_exp_i[ss, t]==((m.z_gas*m.R_id*m.T_avg*(m.gamma/(m.gamma-1)))/m.M_molar*10**3*m.m_in_ss[ss,t])/m.eta_c*10**-6*((m.p_ss[ss,t]**2/m.p[m.n_inc[ss],t]**2)**(m.gamma/(m.gamma-1))-1)/m.t_period
else:
def SS_entry_exp_def_BA(m):
for ss in m.ss:
for t in m.t:
if value(m.p[m.n_inc[ss],t])**2 < value(m.p_ss[ss,t])**2: # not the chance in inequality
m.PW_SS_exp_i[ss,t] = 0
m.PW_SS_exp_i[ss,t].fixed = 0
m.SS_entry_exp_con_BA=BuildAction(rule=SS_entry_exp_def_BA)