The problem you describe is essentially the power flow problem. The only
difference is that if it solves successfully, you also know that the reactive
power generation limits, branch flow constraints, and bus voltage limits are
also satisfied. If it does not solve successfully (e.g. "Numerically Failed"
error), it is likely that the power flow solution would violate one of these
constraints.
In terms of implementation, I don’t see any reason you need to use
add_userfcn() for this. You can simply modify the VMIN and VMAX limits at PV
buses and the PMIN and PMAX limits in the gen matrix to the desired fixed
values and run a standard OPF. In fact, the latest version of MATPOWER (v6.0)
includes the new 'opf.use_vg’ option to enforce generator setpoint voltages
automatically. So all you’d need to do is set that option to 1 and then set the
PMIN and PMAX columns of the gen matrix to equal the desired fixed power output.
But, like I said, if it solves successfully, the solution should be exactly
what you'd get from runpf().
Ray
> On Feb 28, 2017, at 3:27 PM, Raz Feldman <[email protected]> wrote:
>
> Hello,
> I am trying to solve an OPF problem where all the PV nodes are fixed to a
> certain power and voltage by an equality constraints, and only the slack bus
> is left free.
>
> The power consumed by the loads (including losses) is more than the fixed
> values of the generators but less than the total power generated including
> the slack bus.
>
> I used the MATPOWER options as instructed in the manual (6.0b1):
> mpc = add_userfcn(case_alg, 'formulation', @userfcn_reserves_formulation);
>
> where the userfcn is set to enforce the rules mentioned above.
> I watched the results to see that the rules are indeed enfoeced and they are.
>
> My problem is that I get the following Warning: Matrix is singular to working
> precision.
>
> and the MATPOWER output "Numerically Failed".
>
> I have tried playing with my network parameters and relaxing constraints but
> didn't succeed making the MATPOWER converge.
>
> Any suggestion helping on the topic?
>
> Best regards,
> Raz