Sorry, that output should have included the following …

MATPOWER Version 5.0, 17-Dec-2014 -- AC Power Flow (Newton)

 it    max P & Q mismatch (p.u.)
----  ---------------------------
  0         5.074e-11
Converged!

Guess I copied it from a run with ‘verbose’ = 0.

   Ray


> On Jan 29, 2015, at 9:37 AM, Ray Zimmerman <r...@cornell.edu> wrote:
> 
> Hi Dominic,
> 
> I don’t think there is any bug here. First of all, the issue of the power 
> flow converging in 1 iteration as opposed to zero is simply an issue of the 
> termination tolerances. The issue of non-matching reactive power outputs is 
> related to the fact that there are two generators at the same bus, either of 
> which could generate the reactive power. The total reactive power injected at 
> the bus is the same in both solutions, so the power flow equations are 
> satisfied in both cases. The OPF solution has all of the reactive supply at 
> the bus coming from one of the two generators. The power flow code splits the 
> reactive injection between multiple units proportional to the reactive range 
> of each unit.
> 
> The following code (also in attached script file) results in the output below 
> and will hopefully qualm any doubts ...
> 
> define_constants;
> load mpc123b
> mpopt = mpoption('opf.ac.solver', 'MIPS', 'mips.comptol', 1e-10, 
> 'mips.step_control', 1);
> mpopt = mpoption(mpopt, 'out.all', 0);
> r1 = runopf(mpc123, mpopt);
> mpopt = mpoption(mpopt, 'verbose', 2);
> r2 = runpf(r1, mpopt);
> compare_case(r1, r2)
> k = find(r1.gen(:, GEN_BUS) == r1.gen(220, GEN_BUS))
> [r1.gen(k, QG) r2.gen(k, QG)]
> sum([r1.gen(k, QG) r2.gen(k, QG)])
> 
> 
> >> test123
> 
> MATPOWER Version 5.0, 17-Dec-2014 -- AC Optimal Power Flow
> MATLAB Interior Point Solver -- MIPS-sc, Version 1.1, 17-Dec-2014
> Converged!
> 
> MATPOWER Version 5.0, 17-Dec-2014 -- AC Power Flow (Newton)
> ----------------  --------------  --------------  --------------  -----
>  matrix / col         case 1          case 2        difference     row 
> ----------------  --------------  --------------  --------------  -----
> bus
>   VM                       1.1             1.1     2.22045e-16     44
>   VA                   35.2787         35.2787     1.42109e-14    180 *
> 
> gen
>   PG                6.4271e-10     6.38956e-10     3.75491e-12   3414
>   QG               1.02725e-10         494.118         494.118    220 *
> 
> branch
>   PF                   75.2832         75.2832     2.81496e-09   2148 *
>   QF                     8.577           8.577     1.48452e-09   2148
>   PT                  -75.2831        -75.2831     2.81496e-09   2148
>   QT                  -8.65882        -8.65882     1.48449e-09   2148
> 
> k =
> 
>    219
>    220
> 
> 
> ans =
> 
>   867.6421  373.5236
>     0.0000  494.1184
> 
> 
> ans =
> 
>   867.6421  867.6421
> 
> 
> -- 
> Ray Zimmerman
> Senior Research Associate
> B30 Warren Hall, Cornell University, Ithaca, NY 14853  USA
> phone: (607) 255-9645
> 
> <test123.m>
> 
>> On Jan 28, 2015, at 1:42 PM, Hewes, Dominic <dominic.he...@tum.de 
>> <mailto:dominic.he...@tum.de>> wrote:
>> 
>> Dear Matpower Community,
>>  
>> I am observing a strange problem whereby the results from a successful 
>> 'runopf()' do not seem to present a solved power flow case. I want to verify 
>> the power flow solution from an OPF by running a PF with the OPF results as 
>> the mpc struct. Firstly, the 'runpf()' converges in 1 iteration, whereas i 
>> would expect a solved case to converge in 0 iterations- am i mistaken here? 
>> Secondly, when i use the 'compare_case()' command to compare the OPF results 
>> with the resulting PF results, I see that there are large differences 
>> between the solutions. My code is as follows:
>>  
>> resultsOPF=runopf(mpc123);
>> resultsPF=runpf(resultsOPF);
>>  
>> compare_case(resultsOPF, resultsPF)
>>  
>> The comparison shows a maximum reactive power difference of 494 MVAR between 
>> the generator results:
>>  
>> gen
>>   PG               5.00578e-10     9.67145e-09     9.17088e-09    614
>>   QG               7.99959e-11         494.118         494.118    218 *
>>  
>> The OPF command converges successfully with no error warnings, and so I 
>> assumed that running the results struct through a PF command should give the 
>> same power flow solution. Am i mistaken here?  If my thinking is correct, 
>> this would indicate that the optimiser has provided results that do not 
>> represent a feasible power flow solution - is this potentially a bug? I have 
>> tested the same method on the 'case14.m' file and observe that this also 
>> requires 1 iteration to converge and gives very small differences (~2e-7) 
>> between the OPF and PF results.
>>  
>> I am using the latest matpower release (5.0), the TSPOPF 5.0 solver and a 
>> windows 7 machine (see output of mpver at end of email). I have tried with 
>> other solvers and observe the same problem. I am working with a large model 
>> (>5000 bus) that i have attached below. Could the size of my model be the 
>> cause of this problem?
>>  
>> Presently I am not sure whether I am making a simple mistake or if there is 
>> a bug in the solver that is causing the output of inaccurate results.
>>  
>> Has anyone experienced similar problems? I would very much appreciate any 
>> advice on the cause of the problem.
>>  
>> Kind Regards,
>>  
>> Dominic
>>  
>>  
>> mpver
>>  
>> MATPOWER               Version 5.0        17-Dec-2014
>> MATLAB                 Version 8.4        08-Sep-2014   Release: (R2014b)
>> Optimization Toolbox   Version 7.1        08-Sep-2014   Release: (R2014b)
>> MIPS                   Version 1.1        17-Dec-2014
>> SDP_PF                 -- not installed --
>> YALMIP                 -- not installed --
>> BPMPD_MEX              -- not installed --
>> CPLEX                  Version 12.6.0.0                 PCWIN64
>> Gurobi                 -- not installed --
>> GLPK                   -- not installed --
>> IPOPT                  -- not installed --
>> KNITRO                 -- not installed --
>> MINOPF                 -- not installed --
>> MOSEK                  -- not installed --
>> PDIPMOPF               Version 5.0        17-Dec-2014   PCWIN64
>> SCPDIPMOPF             Version 5.0        17-Dec-2014   PCWIN64
>> SDPT3                  -- not installed --
>> SeDuMi                 -- not installed --
>> TRALMOPF               Version 5.0        17-Dec-2014   PCWIN64
>> Architecture:          PCWIN64
>> <mpc123.mat>
> 

Reply via email to