5-Bus Test System
The 5-bus test system is a minimal power system suitable for learning PyRAMSES and experimenting with dynamic simulation concepts. It is small enough to trace every computation step while still demonstrating the full simulation workflow.
Repository: SPS-L/5_bus_test_system
Quick Start
Section titled “Quick Start”import pyramsesimport os
# Configure the test casecase = pyramses.cfg()case.addData('dyn.dat') # dynamic model datacase.addData('lf1solv.dat') # power-flow solutioncase.addData('solveroptions.dat') # solver settingscase.addDst('nothing.dst') # no pre-defined disturbancescase.addObs('obs.dat') # observables to recordcase.addTrj('output.trj') # trajectory output file
# Remove stale output files from previous runsfor f in os.listdir('.'): if f.endswith('.trj') or f.endswith('.trace'): os.remove(f)
# Run simulation with exciter setpoint changeram = pyramses.sim()ram.execSim(case, 0.0)ram.addDisturb(1.0, 'CHGPRM EXC G Vo 0.05 2') # +0.05 pu step on Vo at t=1 sram.contSim(60.0)ram.endSim()
# Extract and plot resultsext = pyramses.extractor(case.getTrj())ext.getSync('G').P.plot() # active powerext.getSync('G').Q.plot() # reactive powerDownload
Section titled “Download”The test system files are available in the 5_bus_test_system repository.
See Also
Section titled “See Also”- PyRAMSES Examples — Complete Python simulation workflow with this test system