Reputation: 310
In Matlab, I have given a network in the MATPOWER case file format (see the MATPOWER doc).
I now want to check, if it is AC-feasible. To that end, I employed runpf
(see the MATPOWER doc):
define_constants;
mpc = loadcase(case_file_path);
results = runpf($mpc);
On most of my cases, I got the result that it is feasible. Now I wanted to check the branch violations of the infeasible ones. However, I noticed that there are also branch violations on the ones that are marked as feasible (which for me does not make sense from a physical POV).
I calculated the violations as follows:
pfs = results.branch(:, PF);
qfs = results.branch(:, QF);
pts = results.branch(:, PT);
qts = results.branch(:, QT);
Sfs = sqrt(pfs.^2 + qfs.^2);
Sts = sqrt(pts.^2 + qts.^2);
active = mpc_target.branch(:, 11) > 0.5;
rates = mpc_target.branch(:, 6); % the 6th column gives the rateA of the branch
violations_n = sum((Sfs .* active > rates) | (Sts .* active > rates));
My guess is that the function does not enforce the limits in the network, but that is what I need.
What I tried so far:
In the description of runpf
it is mentioned, that the pf.enforce_q_lims
option exists. I tried to set it to true (in the hope that this will somehow lead to an adherence of the flow limits as well), but the result remained unchanged.
I found another function runcpf
. This function DOES have the option cpf.enforce_flow_lims
. However, the function seems to perform a continuation power flow, which I am guessing is not what I want since I need a base case and a target case (I am not an electrical engineer, so I have limited knowledge). Nevertheless, I ran the function (with both cases being the base case and the aforementioned option activated), but the result remained the same: the same violations occurr.
I am unsure how to proceed. Is this simply not possible with MATPOWER due to restriction I am not aware of? This seems impractical to me however.
Upvotes: 0
Views: 44
Reputation: 125
The behavior you're observing is actually expected - runpf
performs a power flow calculation to determine if a solution exists that satisfies Kirchhoff's laws and the specified power injections/demands, but it does not enforce branch flow limits by default. This is because branch flow limits are typically considered as operational constraints rather than physical laws.
If you need to find a solution that respects branch flow limits, I would recommend you to use MATPOWER's OPF functionality instead. The OPF will try to find a solution that satisfies power flow equations, respect branch flow limits, keep voltages within bounds, respect generator limits and minimize generation cost.
You can read more about it here: https://matpower.org/docs/ref/matpower5.0/opf.html
Upvotes: 1