I am trying to solve a power flow problem with MATPOWER using the DC model
and trying to verify that the solution fits the DC power flow equations
(eqn. 4.7 in the MATPOWER user manual). I have a minimal working example
that goes as follows:

close all
clear all
clc

option = mpoption('model','DC');
mpc = loadcase('case14');

result = runpf(mpc, option);

[Bbus, Bf, Pbusinj, Pfinj] = makeBdc(result);
theta = result.bus(:,9);
diff = Bbus*theta-Pbusinj;

disp(diff)

If my understanding of subsection 9.5.2 (pg. 102) and eqn 4.7 (pg. 30) are
correct, diff should be a vector of all zero values, or close to it.
However, that doesn't appear to be the case; diff(1) is about 125, for
example. Is there a mistake in my understanding of the way the code is
meant to operate?

Thanks for your time,
Alex

Reply via email to