Giter Site home page Giter Site logo

jpower's Introduction

JPOWER

A Java port of MATPOWER - a software package for solving electrical power flow and optimal power flow problems.

Copyright and License

Copyright (C) 1996-2010 Power System Engineering Research Center (PSERC) Copyright (C) 2010-2012 Richard Lincoln

Licensed under the Apache License, Version 2.0 (the "License") you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

jpower's People

Contributors

rwl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

jpower's Issues

Transformer losses are not considered

Hi,

in jpower are transformer losses due to iron core losses not considered.
In effect, if you set up the branch matrix (jpc.branch) you must set in column 5 br_b (matpower manual page 112).
This value needs to be a complex number. When it's complex the calculation core (in matpower) is able to estimate losses (it's not perfect, but better than nothing).

Is it possible to change this matrix to a complex one and use these values?

Djp_printpf throws NullpointerException

Machine: Core i7 Windows 7 64bit

java -version
java version "1.8.0_51"
Java(TM) SE Runtime Environment (build 1.8.0_51-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)

Running, Djp_t_pf.java and setting "OUT_ALL" to "1.0"

Produces:

1..25

JPOWER Version 0.3.2, 21-May-2012 -- AC Power Flow (Newton)

Newton's method power flow converged in 4 iterations.
Exception in thread "main" java.lang.NullPointerException
at edu.cornell.pserc.jpower.Djp_printpf.printpf(Djp_printpf.java:322)
at edu.cornell.pserc.jpower.pf.Djp_runpf.runpf(Djp_runpf.java:370)
at edu.cornell.pserc.jpower.pf.Djp_runpf.runpf(Djp_runpf.java:409)
at edu.cornell.pserc.jpower.pf.Djp_runpf.runpf(Djp_runpf.java:405)
at edu.cornell.pserc.jpower.test.Djp_t_pf.t_pf(Djp_t_pf.java:86)
at edu.cornell.pserc.jpower.test.Djp_t_pf.main(Djp_t_pf.java:185)

Calculation Problems

Hi,

at the moment I'm comparing results from JPower to MatPower, and for reference I'm using the:
9-Bus-Grid
It's delivered with MatPower and JPower.

Example differences

First of all these two grids differ in their matrixes, some values were different (I didn't kept track) and I changed them. Next step is now comparing the results (see below).

Problems so far:

  1. As you can see, the maximum Q Losses line, is the wrong one
  2. The Branch Data has a sign error in the Q Losses table (on every value!)
  3. The Bus Data is completly messed up.

This all may result from the sign error in the Branch Data table...

JPower

================================================================================
|     System Summary                                                           |
================================================================================

How many?                How much?              P (MW)            Q (MVAr)
---------------------    -------------------  -------------  -----------------
Buses              9     Total Gen Capacity     820,0        -900,0 to 900,0
Generators         3     On-line Capacity       820,0        -900,0 to 900,0
Committed Gens     3     Generation (actual)    320,0              34,9
Loads              3     Load                   315,0             115,0
  Fixed            3       Fixed                315,0             115,0
  Dispatchable     0       Dispatchable          -0,0 of -0,0      -0,0
Shunts             0     Shunt (inj)             -0,0               0,0
Branches           9     Losses (I^2 * Z)         4,95            -51,31
Transformers       0     Branch Charging (inj)     -              131,4
Inter-ties         9     Total Inter-tie Flow   565,0             170,0
Areas              1

                          Minimum                      Maximum
                 -------------------------  --------------------------------
Voltage Magnitude   0,958 p.u. @ bus 9          1,003 p.u. @ bus 6   
Voltage Angle      -4,35 deg   @ bus 9          9,67 deg   @ bus 2   
P Losses (I^2*R)             -                  2,46 MW    @ line 8-9
Q Losses (I^2*X)             -                 -0,81 MVAr  @ line 6-7

================================================================================
|     Bus Data                                                                 |
================================================================================
 Bus      Voltage          Generation             Load        
  #   Mag(pu) Ang(deg)   P (MW)   Q (MVAr)   P (MW)   Q (MVAr)
----- ------- --------  --------  --------  --------  --------
    1  1,000    0,000       -         -     -215,86*   -72,21*
    2  1,000    9,669       -         -     -215,86*   -72,21*
    3  1,000    4,771       -         -     -215,86*   -72,21*
    4  0,987   -2,407       -         -     -215,86*   -72,21*
    5  0,975   -4,017       -         -     -125,86*   -42,21*
    6  1,003    1,926       -         -     -215,86*   -72,21*
    7  0,986    0,622       -         -     -115,86*   -37,21*
    8  0,996    3,799       -         -     -215,86*   -72,21*
    9  0,958   -4,350       -         -      -90,86*   -22,21*
                        --------  --------  --------  --------
               Total:    319,95     34,88    315,00    115,00

================================================================================
|     Branch Data                                                              |
================================================================================
Brnch   From   To    From Bus Injection   To Bus Injection     Loss (I^2 * Z)  
  #     Bus    Bus    P (MW)   Q (MVAr)   P (MW)   Q (MVAr)   P (MW)   Q (MVAr)
-----  -----  -----  --------  --------  --------  --------  --------  --------
   0      1      4     71,95     24,07    -71,95    -20,75     0,000     -3,32
   1      4      5     30,73     -0,59    -30,55    -13,69     0,174     -0,94
   2      5      6    -59,45    -16,31     60,89    -12,43     1,449     -6,31
   3      3      6     85,00     -3,65    -85,00      7,89     0,000     -4,24
   4      6      7     24,11      4,54    -24,01    -24,40     0,095     -0,81
   5      7      8    -75,99    -10,60     76,50      0,26     0,506     -4,29
   6      8      2   -163,00      2,28    163,00     14,46     0,000    -16,74
   7      8      9     86,50     -2,53    -84,04    -14,28     2,465    -12,40
   8      9      4    -40,96    -35,72     41,23     21,34     0,266     -2,26
                                                             --------  --------
                                                    Total:     4,955    -51,31

MatPower

================================================================================
|     System Summary                                                           |
================================================================================

How many?                How much?              P (MW)            Q (MVAr)
---------------------    -------------------  -------------  -----------------
Buses              9     Total Gen Capacity     820.0        -900.0 to 900.0
Generators         3     On-line Capacity       820.0        -900.0 to 900.0
Committed Gens     3     Generation (actual)    320.0              34.9
Loads              3     Load                   315.0             115.0
  Fixed            3       Fixed                315.0             115.0
  Dispatchable     0       Dispatchable          -0.0 of -0.0      -0.0
Shunts             0     Shunt (inj)             -0.0               0.0
Branches           9     Losses (I^2 * Z)         4.95             51.31
Transformers       0     Branch Charging (inj)     -              131.4
Inter-ties         0     Total Inter-tie Flow     0.0               0.0
Areas              1

                          Minimum                      Maximum
                 -------------------------  --------------------------------
Voltage Magnitude   0.958 p.u. @ bus 9          1.003 p.u. @ bus 6   
Voltage Angle      -4.35 deg   @ bus 9          9.67 deg   @ bus 2   
P Losses (I^2*R)             -                  2.46 MW    @ line 8-9
Q Losses (I^2*X)             -                 16.74 MVAr  @ line 8-2

================================================================================
|     Bus Data                                                                 |
================================================================================
 Bus      Voltage          Generation             Load        
  #   Mag(pu) Ang(deg)   P (MW)   Q (MVAr)   P (MW)   Q (MVAr)
----- ------- --------  --------  --------  --------  --------
    1  1.000    0.000*    71.95     24.07       -         -   
    2  1.000    9.669    163.00     14.46       -         -   
    3  1.000    4.771     85.00     -3.65       -         -   
    4  0.987   -2.407       -         -         -         -   
    5  0.975   -4.017       -         -       90.00     30.00 
    6  1.003    1.926       -         -         -         -   
    7  0.986    0.622       -         -      100.00     35.00 
    8  0.996    3.799       -         -         -         -   
    9  0.958   -4.350       -         -      125.00     50.00 
                        --------  --------  --------  --------
               Total:    319.95     34.88    315.00    115.00

================================================================================
|     Branch Data                                                              |
================================================================================
Brnch   From   To    From Bus Injection   To Bus Injection     Loss (I^2 * Z)  
  #     Bus    Bus    P (MW)   Q (MVAr)   P (MW)   Q (MVAr)   P (MW)   Q (MVAr)
-----  -----  -----  --------  --------  --------  --------  --------  --------
   1      1      4     71.95     24.07    -71.95    -20.75     0.000      3.32
   2      4      5     30.73     -0.59    -30.55    -13.69     0.174      0.94
   3      5      6    -59.45    -16.31     60.89    -12.43     1.449      6.31
   4      3      6     85.00     -3.65    -85.00      7.89     0.000      4.24
   5      6      7     24.11      4.54    -24.01    -24.40     0.095      0.81
   6      7      8    -75.99    -10.60     76.50      0.26     0.506      4.29
   7      8      2   -163.00      2.28    163.00     14.46     0.000     16.74
   8      8      9     86.50     -2.53    -84.04    -14.28     2.465     12.40
   9      9      4    -40.96    -35.72     41.23     21.34     0.266      2.26
                                                             --------  --------
                                                    Total:     4.955     51.31

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.