1P1Q Screening vs. AC Power Flows

1P1Q Screening vs. AC Power Flows

A Comparison Study for a Generator Disturbance

1P1Q screening estimates the complex voltage V vector following a disturbance.

My Approach:

This project considers either an outage if generator 2 or generator 3 , but not both, affecting the voltage.

The program flow and algorithm is as follows:

  1. Run pre-contingency fast-decoupled XB version power flow analysis
  2. Obtain base case complex voltage vector V
  3. Ask the user to select a valid generator (either 2 or 3) to be out
  4. Delete the user selected generator from the gen data structure
  5. Edit the radial branch reactance and resistance of the generator out to be near infinity*
  6. Determine Bp,Bpp,Sbus,Ybus,Yf,Yt
  7. Determine bus types (pv, pq values)
  8. Perform 1P half=iteration
    Compute real power mismatch and delP
    Determine swing bus
    Remove swing bus from Bp matrix
    Creates temporary Vm voltage magnitudes and removes the swing bus
    Computes delTheta
    Augments delTheta for the swing bus
    Updates the complex voltage
  9. Perform 1Q half-iteration
    Determines the swing bus
    Removes swing and pv buse(s) from Bpp and Vm matrices
    Computes Reactive Power Mismatch
    Computes delVmag
    Augment the delVmag for the swing and pv bus(s)
    Update the complex voltage
  10. Compute Branch flows
    Reads data and converts to internal bus numbering
    Calculates complex power at from branch
    Calculates complex power at the to branch
  11. Display Branch flows
    Prints the post-contingency branch flows at from and to ends in MATLAB

* The author found out that to approximate the 1P1Q bus flows to that of the AC solution, that the outage generator branch had to be modeled as “almost-off” so that power would not want to flow there. The pre-contingency solution considered it in service, however, when the generator is out, there is no load and incentive for the power to flow down the node to the bus. The AC solution correctly assigned a 0 flow to the post-contingency solution, but in the 1P1Q process, without the branch impedances taken to infinity, there would be >0 (big number) of branch flow on that branch, which does not make sense. By changing the branch impedance to near infinity, it corrects the current calculations and hence the power flows.

My Summary:

The 1P1Q method produced a good estimation for the generator outage compared to the AC solution. The most error in approximation came on the radial branch leading to the swing bus and the branch leading to the load. The method estimated both the MW and MVAR in good approximation. The results of the bus, Vmagnitude, and Vangles (in radians) were outputted in MATLAB after each 1P and 1Q half-iteration for a generator outage. The updated estimated complex V was then used to calculate the complex power branch flows. The post-contingency branch flows for the 1P1Q method is outputted at the end of the 1P1Q program. A separate program called “program3ac.m” runs the AC portion of the power flow analysis. It is important that before you run the AC solution, that the generator to be out, is commented out of the gen[] data structure in the wscc9bus.m file and saved. The AC solution looks only at the structure of the bus. The results of the AC power flow program will display the same complex branch power flows which are in good approximation to the 1P1Q method flows. The comparison of the flow values between 1P1Q and AC was done in excel. The excel file is attached for your reference.

Demos

The demonstration of Matlab code, output, and tables are discussed in the project report that you can download in PDF format here. An Excel comparison sheet (results) of the project is here.

Results Tables

Generator 2 Outaged

FROM TO 1P1Q FROM MW AC FROM MW Errors 1P1Q FROM MVAR AC FROM MVAR 1P1Q FROM MVA ACFROM MVA Errors
1 4 240.07 234.43 5.63 44.66 43.85 244.19 238.50 5.69
2 7 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
3 9 84.55 85.00 0.45 -1.25 -0.39 84.56 85.00 0.44
4 5 143.23 144.26 1.03 19.61 20.11 144.57 145.66 1.09
4 6 88.52 90.17 1.65 -6.66 -6.56 88.77 90.41 1.64
5 7 15.11 17.20 2.09 -29.65 -29.56 33.28 34.20 0.92
6 9 -2.69 -1.15 1.54 -27.17 -27.34 27.30 27.37 0.07
7 8 16.32 17.03 0.72 0.39 0.32 16.32 17.04 0.71
8 9 -82.36 -83.00 0.64 -19.41 -19.81 84.61 85.33 0.72
FROM TO 1P1Q TO MW AC TO MW Errors 1P1Q TO MVAR AC TO MVAR 1P1Q TO MVA ACTO MVA Errors
1 4 -240.07 -234.43 5.63 -12.91 -13.55 240.41 234.83 5.59
2 7 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
3 9 -84.55 -85.00 0.45 5.24 4.42 84.71 85.11 0.40
4 5 -141.19 -142.20 1.00 -20.21 -20.44 142.63 143.66 1.03
4 6 -87.25 -88.85 1.60 -2.82 -2.66 87.29 88.89 1.60
5 7 -14.97 -17.03 2.07 -0.38 -0.32 14.97 17.04 2.07
6 9 2.72 1.18 1.54 -9.86 -9.66 10.23 9.73 0.49
7 8 -16.29 -17.00 0.71 -15.31 -15.19 22.35 22.80 0.45
8 9 83.16 83.82 0.66 4.68 5.24 83.30 83.98 0.69

 

Generator 3 Outaged

FROM TO 1P1Q FROM MW AC FROM MW Errors 1P1Q FROM MVAR AC FROM MVAR 1P1Q FROM MVA ACFROM MVA Errors
1 4 160.00 155.63 4.37 24.39 22.93 161.85 157.31 4.54
2 7 163.29 163.00 0.29 3.66 3.19 163.33 163.03 0.30
3 9 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
4 5 73.51 73.07 0.44 18.57 18.20 75.82 75.30 0.52
4 6 82.44 82.56 0.12 -8.25 -8.45 82.85 82.99 0.14
5 7 -53.96 -52.51 1.45 -18.45 -18.48 57.03 55.66 1.36
6 9 -9.91 -8.53 1.38 -27.65 -27.73 29.37 29.01 0.36
7 8 109.46 109.61 0.16 -3.90 -3.98 109.53 109.68 0.16
8 9 8.37 8.64 0.27 -31.56 -31.57 32.65 32.73 0.08
FROM TO 1P1Q TO MW AC TO MW Errors 1P1Q TO MVAR AC TO MVAR 1P1Q TO MVA ACTO MVA Errors
1 4 -160.00 -155.63 4.37 -10.44 -9.75 160.34 155.93 4.41
2 7 -163.29 -163.00 0.29 12.21 12.62 163.75 163.49 0.26
3 9 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
4 5 -72.93 -72.49 0.43 -31.80 -31.52 79.56 79.05 0.51
4 6 -81.35 -81.47 0.12 -2.46 -2.27 81.39 81.50 0.11
5 7 54.89 53.39 1.50 -8.38 -8.64 55.53 54.08 1.44
6 9 9.97 8.59 1.39 -9.94 -9.94 14.08 13.14 0.95
7 8 -108.49 -108.64 0.15 -3.51 -3.43 108.55 108.70 0.15
8 9 -8.32 -8.59 0.27 9.94 9.94 12.96 13.14 0.18

 

My Solution Code

You can view and download the GitHub repository here.

You can also download a zip archive of the project code here.