Hello again, I am still working on writing an AC OPF/Economic Dispatch model, using Matpower as a baseline, and I am getting some strange discrepancies between the two. I wrote a little checkpf function (using the mismatch check algorithms from Matpower's Newton power flow implementation) to compare my answers (which I have outputting in Matpower case format to make that easier), and I was hoping someone could help me make sense of that data.
The L-infinity norm of the mismatch ( maxerr=norm( V.*conj(Ybus*V) - Sbus, inf) ) for my model is consistently much higher than Matpower's (on the order of 10x even on some of the simplest cases). For example, on case9.m, I removed the line charging susceptance, Bc, by setting that column to 0 and using runopf in Matpower, then comparing the results to my model. Despite the fact that the maximum differences between real and reactive power and complex voltage at each bus is small (Pg_maxdiff=4.7e-4, Qg_maxdiff=5.82e-4, V_maxdiff=1.98e-6, Vangle_maxdiff=5.36e-7), for my model, maxerr=2.26e-5, but Matpower has maxerr=5.04e-6: a difference of a factor of 4. Is that reasonable to chalk up to noise in my calculations and conversions, or is that an unacceptably high error difference? When line charging is included on case9.m (Using Bc/2=half of the value given in the case file, as that says it is the full line charging susceptance), I have maxerr=1.60e-5 and Matpower has maxerr=3.44e-6. So both models give lower max error, and Pg_maxdiff, V_maxdiff, Vangle_maxdiff are all close to the same order as without line charging (actually, Vangle_maxerr=0 in this case), but Qg_maxdiff=2.69e-2, which is several orders of magnitude larger than the other mismatches. Is this a result of small voltage differences and rounding error in conversions propagating, magnified by the inclusion of the Bc/2 term? I have checked my equations numerous times, ensuring that my derivations are correct, so I am at a loss for what is causing this strangeness. Case9.m has no shunts or transformers, so the error isn't from those elements. Am I missing something fundamental about line charging susceptance? Even in the simplified case, what could be causing the large discrepancy between maxerr values? Thanks again for your help, ~Zev Friedman
