Unfortunately, I do not believe runuopf() will work for this problem, since it uses heuristics to de-commit units one at a time based only on binding Pmin limits, not on binding reactive power limits, which is what you would need. I suppose you could modify uopf() to look at both, but in the end you still have a very crude and inefficient heuristic for dealing with the binary decisions, with no guarantees on the final optimality gap.
The proper way to solve this problem would be to create an interface in MP-Opt-Model for a mixed-integer nonlinear programming solver. Knitro has these capabilities, but they have not (yet) been implemented in MP-Opt-Model’s Knitro interface. We have nlps_knitro(), but we need a minlps_knitro(). There is also a suggestion in the issue tracker to include an interface for Bonmin<https://github.com/MATPOWER/mp-opt-model/issues/1> which also handles MINLP problems. Both would be very welcome and useful additions. Any chance you have time to work on this? I’d be happy to lend my support. Ray On Sep 9, 2020, at 7:47 AM, yangyang <980182...@qq.com<mailto:980182...@qq.com>> wrote: Dear Alireza SalimAmini Thank you for your care and blessing. I think I have implemented this using runuopf(), a built-in function of matpower to do mixed unit commitment and OPF. In such cases where geneators are used to model shunt capacitors and reactors, just add a few generators whose real power generation Pg is zero and reactive power generation Qg set at a constant value. The Qmax and Qmin in generator data has to be identical with the set Qg. Notably, the Pmax and Pmin cannot be set to zero because runuopf() will merely deal with generators whose Pmin is greater than zero (see source codes of uopf() ). To get "shunt" generators involved as candidates of unit commitment programming only calls for Pmin and Pmax set at a very small number numerically, say, 1e-6 and 1e-5. This minor active power injection will hardly affect the power flow but can get "shunt" generators involved. ------------------ 原始邮件 ------------------ 发件人: "MATPOWER discussion forum" <a.salimam...@gmail.com<mailto:a.salimam...@gmail.com>>; 发送时间: 2020年9月9日(星期三) 下午2:22 收件人: "MATPOWER discussion forum"<matpowe...@list.cornell.edu<mailto:matpowe...@list.cornell.edu>>; 主题: Re: optimal power flow with unit commitment using mixed integer programming hi i wish u are healthy at this conditions( Covid19) i think if you adjust Qmin and Qmax of capacitors at 'gen' matrix equal to 6Mvar, it will help , and you can use status ( it is a column in gen matrix as came below) of that capacitor a variable for reactive power balance. '8 GEN_STATUS status, > 0 - in service, <= 0 - out of service' On Wed, Sep 9, 2020 at 6:34 AM yangyang <980182...@qq.com<mailto:980182...@qq.com>> wrote: Dear all, I am working on optimal power flow whose objective is the cost of generation plus the quadratic deviation of voltage magnitudes to 1.0. The special part of the optimization lies in it that it has to include shunt capacitors and reactors in this network apart from conventional generators, which can control reactive power and voltages. In this network, the capacitors and reactors are modelled as discrete constant reactive power loads, whose values are like 0, -6MVar, -12MVar, -18MVar, etc. I think a practical implementation is to take these shunt capacitors as a bunch of generators whose active power generation is set to 0 and reactive power generation set to constant values. Say, a chain of 6*6MVar shunt capacitors at one bus can be viewed as 6 generators at this bus whose active gen is 0 and reactive gen is 6MVar. On my opinion, these shunt capacitor or reactor generators should not change their active and reactive generation in OPF but only decide which generators should be on, just like unit commitment, while other conventional generators will change their active and reactive generation continously as conventional OPF. I dont know if it is practical using matpower. Despite the miqps_matpower function and the new-released mp-opt-model, it seems that no one has done so ever. Would you please help me with it? Thank you for you kind patience and consideration.