distribution system optimization - knitro solver

31 views
Skip to first unread message

Frederico Marques

unread,
Aug 17, 2021, 6:31:56 PM8/17/21
to AMPL Modeling Language
Hello Robert,

I am new at AMPL optimization and, at the University that I am studying there is no person that can help me with AMPL since I am the first one studying the software. My research focus has the objective to find the optimal radial topology to minimize active power losses in distribution systems.

While I was studying some examples I found a case in this google group very similar to my model but I do not know why my model is running badly. All my bar tensions are not been calculated and when I add the following subject some errors appears, maybe my mistakes can be in the variables or in the parameters declaration:

#subject to estado_chave {(i,j) in Ol}:     
    # NR[i,j] = NB+1;                                                 #Key state (0 - Turned Off (Open) e 1 - Turned on (Closed))
 
I am attaching my files. If you can help me, I will be extremaly grateful   

I hope to hear from you soon.

Sincerely,
Frederico Marques

Modelo_Geral_NL.mod
Modelo_Geral_NL.run
Modelo_Geral_NL.dat

AMPL Google Group

unread,
Aug 19, 2021, 1:46:49 PM8/19/21
to AMPL Modeling Language
When you add this constraint,

subject to estado_chave {(i,j) in Ol}:     
   NR[i,j] = NB+1;

the following error message appears:

error processing constraint estado_chave[14,13]:
        no value for NR[14,13]

You are getting this error message because NR is a parameter of your model, but in your data file you do not give any data for NR. In fact there are no variables in the expression for estado_chave, so it is not a meaningful constraint. If you are trying to assign the value of NB+1 to NR[i,j] for every (i,j) in OI, then you should instead write this assignment statement in your .run file after reading the model and data files:

let {(i,j) in Ol} NR[i,j] := NB+1;

However, I am only guessing at this, and it is possible you are trying to do something else. Currently you are not using NR or NB anywhere else in your model, so it is hard to see the reason for defining them.

When estado_chave is commented out, then the Knitro solver reports the following result:

Knitro 12.3.0: Current infeasible solution estimate cannot be improved.
objective 78651161.37; feasibility error 5.76e+11
96 iterations; 143 function evaluations

So Knitro is unable to find any feasible solution to your other constraints. In this situation, Knitro returns the last infeasible solution that it reached. As you have seen, that infeasible solution is often not very meaningful. In fact, there is no simple and general way to deal with an infeasibility error like this; you may need to study the model and data for a while before you can understand the cause of the infeasibility. It is possible to suggest some good ways to get started, however.

As an initial troubleshooting step, it is often helpful to use AMPL's expand command to see see whether AMPL generated the constraints that you expected. By itself, expand; shows all of the constraints. If there are many of them, you can use, for example, expand C1; to expand all of the constraints that have a particular name. Also you can write, for instance, expand >listing.txt; or expand C1 >listing.txt; to send all of the output to the file listing.txt.

You should also consider using AMPL's drop and restore commands to narrow your search for the cause of the infeasibility. If you drop some constraints and the resulting problem is still infeasible, then you don't need to consider the dropped constraints in looking for the cause of infeasibility. By trying a series of drops, you may be able to determine that infeasibility is being caused by only a small subset of the constraints.


--
Robert Fourer
am...@googlegroups.com
{#HS:1604438339-105959#}

Frederico Marques

unread,
Aug 25, 2021, 6:23:04 PM8/25/21
to AMPL Modeling Language
Thank you a lot Robert!

I will try to do as you told me.

Best
Reply all
Reply to author
Forward
0 new messages