ccss-sandia / rpowerflow Goto Github PK
View Code? Open in Web Editor NEWSteady-state electric power flow program written in Ruby
Home Page: http://ccss-sandia.github.com/rpowerflow
License: GNU Lesser General Public License v2.1
Steady-state electric power flow program written in Ruby
Home Page: http://ccss-sandia.github.com/rpowerflow
License: GNU Lesser General Public License v2.1
On my system, the bundled 14 bus test case does not seem to converge (the 6 bus case is fine).
If I force it to stop after 20 iterations, the results seem to be plausible:
#<struct Struct::Bus id=1, voltage=1.06000000055872, angle=-4.71494016630225e-09, mw=0.0, mvar=0.0, slack=true, avr=true, susceptance=0.0>
#<struct Struct::Bus id=2, voltage=1.04499999956269, angle=-0.184161940530395, mw=0.183, mvar=-0.127, slack=false, avr=true, susceptance=0.0>
#<struct Struct::Bus id=3, voltage=1.00999999969742, angle=-0.383413699708764, mw=-0.942, mvar=-0.19, slack=false, avr=true, susceptance=0.0>
#<struct Struct::Bus id=4, voltage=0.992435253636291, angle=-0.394286717422354, mw=-0.478, mvar=0.039, slack=false, avr=false, susceptance=0.0>
#<struct Struct::Bus id=5, voltage=0.992927841529518, angle=-0.374416124217786, mw=-0.076, mvar=-0.016, slack=false, avr=false, susceptance=0.0>
#<struct Struct::Bus id=6, voltage=1.06999999904211, angle=-0.864895155376082, mw=-0.112, mvar=-0.075, slack=false, avr=true, susceptance=0.0>
#<struct Struct::Bus id=7, voltage=1.00812572299551, angle=-0.536320001677928, mw=0.0, mvar=0.0, slack=false, avr=false, susceptance=0.0>
#<struct Struct::Bus id=8, voltage=1.08999999941587, angle=-0.536320001677928, mw=0.0, mvar=0.0, slack=false, avr=true, susceptance=0.0>
#<struct Struct::Bus id=9, voltage=0.971797467458968, angle=-0.612332692886332, mw=-0.295, mvar=-0.166, slack=false, avr=false, susceptance=0.0>
#<struct Struct::Bus id=10, voltage=0.975764364423406, angle=-0.664240538394374, mw=-0.09, mvar=-0.058, slack=false, avr=false, susceptance=0.0>
#<struct Struct::Bus id=11, voltage=1.01428071958757, angle=-0.767765110887086, mw=-0.035, mvar=-0.018, slack=false, avr=false, susceptance=0.0>
#<struct Struct::Bus id=12, voltage=1.15390792596165, angle=-1.62113363956345, mw=-0.061, mvar=-0.016, slack=false, avr=false, susceptance=0.0>
#<struct Struct::Bus id=13, voltage=0.840617836145766, angle=-0.746507939658906, mw=-0.135, mvar=-0.058, slack=false, avr=false, susceptance=0.0>
#<struct Struct::Bus id=14, voltage=0.891029874242489, angle=-0.70057286789995, mw=-0.149, mvar=-0.05, slack=false, avr=false, susceptance=0.0>
But if I let it go to 30 iterations things start to look pretty crazy:
#<struct Struct::Bus id=1, voltage=1.06003516311719, angle=1.88173589311591e-05, mw=0.0, mvar=0.0, slack=true, avr=true, susceptance=0.0>
#<struct Struct::Bus id=2, voltage=1.0449408611271, angle=17418306.5729259, mw=0.183, mvar=-0.127, slack=false, avr=true, susceptance=0.0>
#<struct Struct::Bus id=3, voltage=1.00996579021627, angle=10789483.3560132, mw=-0.942, mvar=-0.19, slack=false, avr=true, susceptance=0.0>
#<struct Struct::Bus id=4, voltage=-15713963.2312974, angle=49950564.0665059, mw=-0.478, mvar=0.039, slack=false, avr=false, susceptance=0.0>
#<struct Struct::Bus id=5, voltage=-17871317.3300304, angle=56215062.3127227, mw=-0.076, mvar=-0.016, slack=false, avr=false, susceptance=0.0>
#<struct Struct::Bus id=6, voltage=1.0701378047143, angle=-73223427.6012067, mw=-0.112, mvar=-0.075, slack=false, avr=true, susceptance=0.0>
#<struct Struct::Bus id=7, voltage=41160196.3234325, angle=7734746.19389931, mw=0.0, mvar=0.0, slack=false, avr=false, susceptance=0.0>
#<struct Struct::Bus id=8, voltage=1.08998966085348, angle=7734746.1938986, mw=0.0, mvar=0.0, slack=false, avr=true, susceptance=0.0>
#<struct Struct::Bus id=9, voltage=15647920.6518688, angle=-28586421.4830803, mw=-0.295, mvar=-0.166, slack=false, avr=false, susceptance=0.0>
#<struct Struct::Bus id=10, voltage=15416363.2353067, angle=-37926132.0788068, mw=-0.09, mvar=-0.058, slack=false, avr=false, susceptance=0.0>
#<struct Struct::Bus id=11, voltage=16901697.1985411, angle=-37392794.1367721, mw=-0.035, mvar=-0.018, slack=false, avr=false, susceptance=0.0>
#<struct Struct::Bus id=12, voltage=-2388632.54698258, angle=-9824987.57135228, mw=-0.061, mvar=-0.016, slack=false, avr=false, susceptance=0.0>
#<struct Struct::Bus id=13, voltage=14746581.707827, angle=-41680014.5759168, mw=-0.135, mvar=-0.058, slack=false, avr=false, susceptance=0.0>
#<struct Struct::Bus id=14, voltage=9328481.54405143, angle=-30633105.7909815, mw=-0.149, mvar=-0.05, slack=false, avr=false, susceptance=0.0>
If I let it go to the default 100 iterations, results vary. Sometimes I wind up with output where all of the above bus values are listed as "NaN", other times it crashes out with:
/opt/local/lib/ruby/gems/1.8/gems/rpowerflow-0.5.1/lib/rpowerflow/solvers/full_newton.rb:119:in `lu': singular matrix, status=1 (ZeroDivisionError)
from /opt/local/lib/ruby/gems/1.8/gems/rpowerflow-0.5.1/lib/rpowerflow/solvers/full_newton.rb:119:in `solve'
from /opt/local/lib/ruby/gems/1.8/gems/rpowerflow-0.5.1/lib/rpowerflow/solvers/full_newton.rb:47:in `times'
from /opt/local/lib/ruby/gems/1.8/gems/rpowerflow-0.5.1/lib/rpowerflow/solvers/full_newton.rb:47:in `solve'
from 14_bus_system_test_MAC.rb:103
I'm not sure what causes it to sometimes wind up one way and sometimes the other.
I'm on OS X 10.7.4, ruby 1.8.7 (2012-06-29 patchlevel 370), narray 0.6.0.1.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.