Knitro does not terminate (infinite calculation)

31 views
Skip to first unread message

Lothar Löwer

unread,
Feb 13, 2024, 10:05:03 AMFeb 13
to Artelys Knitro forum
Here the description of a colleague who also performs grid calculations with AMPL and Knitro:

I do MINLP with Knitro and have problem where Knitro does not terminate. This obviously is due to some nonlinear constraints causing errors:
````
--- ERROR evaluating gradient for constraint 209
--- ERROR evaluating gradient for constraint 210
--- ERROR evaluating gradient for constraint 213
--- ERROR evaluating gradient for constraint 255
--- ERROR evaluating gradient for constraint 256
--- ERROR evaluating gradient for constraint 259
--- ERROR evaluating gradient for constraint 209
--- ERROR evaluating gradient for constraint 210
--- ERROR evaluating gradient for constraint 213
--- ERROR evaluating gradient for constraint 255
--- ERROR evaluating gradient for constraint 256
--- ERROR evaluating gradient for constraint 259
    770       9                           -inf               50.070
```
This set of logged errors are infinitely recurring.
The causing constraints are upper and lower bounds of variables that depend exponentially and polynomially on other variables of the optimization problem, e.g.
```
var q_vm_curve_min {g in GEN_ID} =
    +742.7682
    +943.3072 *vm[gen_bus[g]]^1
    -6036.3994*vm[gen_bus[g]]^2
    +765.2930 *vm[gen_bus[g]]^3
    +8904.5685*vm[gen_bus[g]]^4
    -322.8118 *vm[gen_bus[g]]^5
    -6979.7737*vm[gen_bus[g]]^6
    -4056.3356*vm[gen_bus[g]]^7
    +9249.7007*vm[gen_bus[g]]^8
    -3210.5435*vm[gen_bus[g]]^9;

var q_vm_curve_max {g in GEN_ID} =
    0.4843 * exp(-9.2671 * exp(-9895.9584 * (vm[gen_bus[g]] - 0.9210)))
    +0.0473
    -0.3164*vm[gen_bus[g]]^1
    +0.8525*vm[gen_bus[g]]^2
    -1.0855*vm[gen_bus[g]]^3
    +0.3668*vm[gen_bus[g]]^4
    +0.7973*vm[gen_bus[g]]^5
    -1.2409*vm[gen_bus[g]]^6
    +0.8066*vm[gen_bus[g]]^7
    -0.2629*vm[gen_bus[g]]^8
    +0.0352*vm[gen_bus[g]]^9
```
The curves are tuned for a range 0.9 < vm < 1.1 and probably the values of the derivatives outside this range increase so much that Knitro logs the errors.
I am therefore reformulating the problem.

What still concerns me: Why does knitro calculate forever?

I once canceled a calculation after 5 hours (without errors, similar problems are solved within a few seconds). I told Knitro to abort after 25s:
`option knitro_options "ms_enable=1 ms_maxtime_real=25 outlev=2 maxtime_real=25";`
Adding `maxtime_real=25` did not help either.
Does anyone have an idea how knitro is always forced to abort after 25s?

Best regards,
Lothar

Florian Fontan

unread,
Feb 13, 2024, 10:27:11 AMFeb 13
to kni...@googlegroups.com

Hi Lothar,

 

What version of Knitro are you using?

Could it be possible for you to share your model with us so we can investigate on it directly?

 

Regarding the evaluation errors, maybe the honorbounds option could help

https://www.artelys.com/app/docs/knitro/3_referenceManual/userOptions.html#honorbnds

 

Best,

 

Florian

 

De : 'Lothar Löwer' via Artelys Knitro forum <kni...@googlegroups.com>
Envoyé : mardi 13 février 2024 12:25
À : Artelys Knitro forum <kni...@googlegroups.com>
Objet : [Knitro] Knitro does not terminate (infinite calculation)

--
You received this message because you are subscribed to the Artelys "Knitro Nonlinear Optimization Solver" google group.
To post to this group, send email to kni...@googlegroups.com
To unsubscribe from this group, send email to knitro-un...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/knitro?hl=en
Thank You,
Artelys
http://www.artelys.com/en/optimization-tools/knitro
---
You received this message because you are subscribed to the Google Groups "Artelys Knitro forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knitro+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/knitro/586e7a1e-aa88-43e7-a747-c4b59c4ce773n%40googlegroups.com.

Lothar Löwer

unread,
Feb 14, 2024, 9:08:17 AMFeb 14
to Artelys Knitro forum
Florian, thank' a lot for the fast reply.

Due to confidential issues, unfortunatelly it isn't possible to share the model. It is knitro version 13.2.0. The colleague tried your idea with "honorbounds" without any effect.

Best regards,
Lothar

Florian Fontan

unread,
Feb 14, 2024, 9:38:57 AMFeb 14
to kni...@googlegroups.com

Hi Lothar,

 

Do you set explicit bounds for vm? If not, that’s why honorbounds has no effect. That’s worth trying.

 

I noticed that you set the time limit with maxtime_real and ms_maxtime_real. But for a MINLP, you should use mip_maxtime_real.

 

Best,

 

Florian

 

De : 'Lothar Löwer' via Artelys Knitro forum <kni...@googlegroups.com>
Envoyé : mercredi 14 février 2024 10:38


À : Artelys Knitro forum <kni...@googlegroups.com>

Objet : Re: [Knitro] Knitro does not terminate (infinite calculation)

Lothar Löwer

unread,
Feb 16, 2024, 9:46:30 AMFeb 16
to Artelys Knitro forum
Again, Thank's for the fast reply.

My colleague told me that using ms_maxtime worked so far. But to use mip_maxtime in future will be a good idea.
Nevertheless, he also informed me that he deleted the grid /grid calculation resulting into this problem. Thus, the issue can be closed.

Best regards,
Lothar
Reply all
Reply to author
Forward
0 new messages