# Something about smoothing parameters with ipopt

**URL:** https://discuss.ampl.com/t/something-about-smoothing-parameters-with-ipopt/676
**Category:** Support
**Tags:** solvers
**Created:** [August 7, 2023, 1:25am UTC](https://discuss.ampl.com/t/something-about-smoothing-parameters-with-ipopt/676 "2023-08-07T01:25:57Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![XiaolongQi](https://avatars.discourse-cdn.com/v4/letter/x/0ea827/32.png) [@XiaolongQi](https://discuss.ampl.com/u/XiaolongQi)
#### Post date: [August 7, 2023, 1:25am UTC](https://discuss.ampl.com/t/something-about-smoothing-parameters-with-ipopt/676/1 "2023-08-07T01:25:57Z")

</div>

![1](https://us1.discourse-cdn.com/flex019/uploads/ampl/original/1X/b4e7d24bcb29cfdd2d31e37f17a27b9e1112a9b7.png)  
This is my model, which is not smooth because it contains symbolic functions, absolute values, and if-else statements. I rewrote him into the following ampl code, where beta is the smoothing argument of the symbolic function, Z[2,j,k] is the speed v, and delta is the smoothing parameter of the absolute value.This is my model, which is not smooth because it contains symbolic functions, absolute values, and if-else statements. I rewrote him into the following ampl code, where beta is the smoothing argument of the symbolic function, Z[2,j,k] is the speed v, and delta is the smoothing parameter of the absolute value. Why can’t the optimal solution be obtained by changing the model when the beta becomes 1e-4 or less?

---

<div class="post-metadata">

### Author: ![XiaolongQi](https://avatars.discourse-cdn.com/v4/letter/x/0ea827/32.png) [@XiaolongQi](https://discuss.ampl.com/u/XiaolongQi)
#### Post date: [August 7, 2023, 1:26am UTC](https://discuss.ampl.com/t/something-about-smoothing-parameters-with-ipopt/676/2 "2023-08-07T01:26:16Z")

</div>

var z1{j in Sfe, k in Scp} = sqrt(Z[2,j,k]^2+seta)-delta;  
var z3{j in Sfe, k in Scp} = Sa_P[j,k]-ka_ Z[1,j,k]-Finit;  
var s1{j in Sfe, k in Scp} = 0.5\*(z1[j,k]/sqrt(z1[j,k]^2+4_beta^2)+1);  
var f1{j in Sfe, k in Scp} = -((Sa_ P[j,k]-ka_Z[1,j,k]-Finit-delta)/((Sa_ P[j,k]-ka_Z[1,j,k]-Finit-delta)^2+4_ beta^2)^(1/2))_0.5_ sqrt((z3[j,k]+Fs-sqrt((z3[j,k]-Fs)^2+seta))^2+seta);  
var f2{j in Sfe, k in Scp} = -(Fc+(Fs-Fc)_exp(-(Z[2,j,k]/Vs)^2))_ (Z[2,j,k]-delta)/((Z[2,j,k]-delta)^2+4_beta^2)^0.5-Fv_ Z[2,j,k];  
var Ff{j in Sfe, k in Scp} = f1[j,k]\*(1-s1[j,k])+f2[j,k]\*s1[j,k];

---

<div class="post-metadata">

### Author: ![4er](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/4er/32/530_2.png) [@4er](https://discuss.ampl.com/u/4er)
#### Post date: [August 7, 2023, 12:59pm UTC](https://discuss.ampl.com/t/something-about-smoothing-parameters-with-ipopt/676/3 "2023-08-07T12:59:36Z")

</div>



---

<div class="post-metadata">

### Author: ![4er](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.ampl.com/4er/32/530_2.png) [@4er](https://discuss.ampl.com/u/4er)
#### Post date: [August 7, 2023, 1:05pm UTC](https://discuss.ampl.com/t/something-about-smoothing-parameters-with-ipopt/676/4 "2023-08-07T13:05:33Z")

</div>

This question was already answered in a [different thread](https://discuss.ampl.com/t/on-the-solution-of-complementary-the-smoothing-model-ran-into-problemsrelaxation-conditions/675/8).
