I am writing an optimal power flow (OPF) program. OPF is an optimization problem in which some decision variables like Generation, Load dispatch are adjusted in power flow program so as to minimize the objective function (usually cost of generation).
I am using fmincon Matlab function to solve this problem. Like any optimization problem, OPF have some linear and nonlinear constraints. These constraints are added to the problem to guarantee the feasibility of the solution. I wrote these constraint in Matlab, but I am getting infeasible results which is due to constraints. The constraints of this problem are as follows:
enter image description here
In Here I have posted part of my code that I need to supply the constraints to fmincon. Please check if I wrote the constraints are correct .

Note:I used IEEE New England test system to run OPF on it. This test system contains, 39 Buses, 19 Loads,10 Generators, 46 Lines.

  • \$\begingroup\$ It would be helpful if you added some more description of your power system, like no. of generators, no. of buses and their types, loads, etc. \$\endgroup\$ – Adeel May 7 '15 at 8:16
  • \$\begingroup\$ Thanks for your point. The power system data is available in the posted file. I used IEEE New England test system to run OPF on it. This test system contains, 39 Buses, 19 Loads,10 Generators, 46 Lines. @AdeelSabir \$\endgroup\$ – Masan May 7 '15 at 8:23
  • \$\begingroup\$ I personally have not used fmincon. But my suggestion is, if you can test a similar but smaller system, and then work your way up in steps. You can also remove some constraints, then sequentially add them, to single out the constraint that causes infeasibility. \$\endgroup\$ – Adeel May 7 '15 at 8:30
  • \$\begingroup\$ Thanks for your comment. I already added the constraints sequentially and also solved them as a nonlinear system using fsolve to see if the problem is feasible. I think the constraints are feasible. But when I put it in optimization (fmincon) problem it doesn't give the optimal solution. I am now very doubtful if I wrote the constraints correctly in my codes. I also have the same problem in GAMS and that works fine. I checked my script with GAMS and I can't understand why mine doesn't work. @AdeelSabir \$\endgroup\$ – Masan May 7 '15 at 8:39
  • \$\begingroup\$ I've had a similar experience using convex optimization. It sometimes depends on the solver too. A problem can be feasible under one solver and infeasible under another. The degree of feasibility also can differ with different solvers. If you are familiar with YALMIP you can choose from a variety of solvers to solve your problem. I personally found YALMIP to a be much more satisfying experience for convex optimization than MATLAB's default LMI toolbox. \$\endgroup\$ – Adeel May 7 '15 at 8:53

Infeasibility in OPF is quite common, specially if the demand is high. If you are confident that your formulation is correct, you can remove the generator output constraints and use a small value for total demand (and each nodal demand as well). For lightly-loaded system (small demand), your nonlinear network equations are "almost linear" and they should not impose any problems if they are correct.

However, in your case there may be other issues, as you don't seem to be confident about your script correctness.

A good way to investigate what is the cause of infeasibility is relaxing all of your constraints with penalties and "slack" variables. That is, you add variables to each equality/inequality and associate a high cost coefficient to them in the objective function. Now, your problem is always feasible, even if the optimal solution does not actually satisfy your constraints. However, the optimal solution will contain information regarding which constraints could not be met, as the corresponding "slack" variable will be nonzero.

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.