I believe you are correct -- cranking up the line charging didn't noticeably change the error difference, so I'm inclined to believe it is something about ipopt. However, I did adjust the barrier parameter tolerance such that in the final iteration, its value was 1e-20, which resulted again in no noticeable changes to the output.
~Zev Friedman ________________________________ From: [email protected] [[email protected]] on behalf of Ray Zimmerman [[email protected]] Sent: Thursday, July 07, 2011 11:21 AM To: MATPOWER discussion forum Subject: Re: AC Modelling I'm not certain, but I still think it is likely related to numerical accuracy of the solution from Ipopt. I've been playing around with Ipopt's options as well and am having trouble reducing the mismatch like I can with MIPS. The following code shows that MIPS can reduce the max power flow mismatch down to the order of 1e-14, but I have not been able to get Ipopt to do better than about 1e-7. Probably has something to do with limits on how small step sizes can get and how small the barrier parameter can get. opt = mpoption('OUT_ALL', 0, 'VERBOSE', 2, 'OPF_VIOLATION', 1e-15); opti = mpoption(opt, 'OPF_ALG', 580); %% IPOPT optm = mpoption(opt, 'OPF_ALG', 560); %% MIPS ri = runopf('case9', opti); rm = runopf('case9', optm); runpf(ri, opt); %% iteration 0 shows initial power flow mismatch runpf(rm, opt); %% iteration 0 shows initial power flow mismatch compare_case(ri, rm); In any case, I think the differences you are seeing are quite probably not due to modeling differences, but rather due to the accuracy you can get out of Ipopt. If you are concerned about the possibility of a difference in the line charging, simply try it with an exaggerated parameter value and see if the difference between your code and MATPOWER increases. -- Ray Zimmerman Senior Research Associate 211 Warren Hall, Cornell University, Ithaca, NY 14853 phone: (607) 255-9645 On Jul 7, 2011, at 9:46 AM, Friedman, Zev Benjamin wrote: My code just sets up the AC OPF problem as an NLP, then sends that to ipopt for optimization. I have tried tightening and relaxing ipopt's various tolerances, with no noticeable change in the output. Thanks, ~Zev Friedman ________________________________ From: [email protected]<mailto:[email protected]> [[email protected]] on behalf of Ray Zimmerman [[email protected]] Sent: Wednesday, July 06, 2011 3:11 PM To: MATPOWER discussion forum Subject: Re: AC Modelling Presumably your code also uses some iterative algorithm with some termination tolerance to determine what is "close enough". My guess is that your termination criterion needs to be tighter if you want a closer match. By decreasing the termination tolerances , you should be able to make them as close as you like up to the point where you are limited by the precision of the calculations themselves. -- Ray Zimmerman Senior Research Associate 211 Warren Hall, Cornell University, Ithaca, NY 14853 phone: (607) 255-9645 On Jul 6, 2011, at 1:42 PM, Friedman, Zev Benjamin wrote: 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
