Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from andes import system, filters
# from andes.routines import powerflow, timedomain
import os
# os.chdir('/home/hcui7/repos/andes_github/cases')
# case = 'ieee14_syn.dm'
# os.chdir('../../cases/curent')
# case = 'NA_50_50_50_HVDC3.dm'
os.chdir('../../cases/curent')
case = 'WECC_WIND0.dm'
sys = system.PowerSystem(case)
assert filters.guess(sys)
assert filters.parse(sys)
sys.setup()
sys.pflow.run()
sys.tds.init()
# timedomain.run(sys)
# bus list in NPCC
wecc_bus = list(range(1, 181)) + list(range(2183, 2192))
# In the test case ``NA_50_50_50_HVDC3.dm``, all NPCC generators are classical model
# ====== commented out ======
# 6-th order generator model on NPCC buses. All should be None.
# sys.Syn6a.on_bus(npcc_bus)
# ===========================
def __init__(self, event, t, case, save_file, e_idx):
sys = system.PowerSystem(case)
assert filters.guess(sys)
assert filters.parse(sys)
sys.setup()
sys.pflow.run()
sys.tds.init()
self.sys = sys
self.event = event
self.t = t
self.e_idx = e_idx
self.case = case
self.save_file = save_file
self.input_check()
self.e_count = self.t.__len__()
self.e_string = []
self.line_bus = sys.Line.bus1
from andes import system, filters
from andes.routines import powerflow, timedomain
import os
# os.chdir('/home/hcui7/repos/andes_github/cases')
# case = 'ieee14_syn.dm'
os.chdir('/home/hcui7/repos/andes_github/cases/curent')
case = 'NA_50_50_50_HVDC3.dm'
sys = system.PowerSystem(case)
assert filters.guess(sys)
assert filters.parse(sys)
sys.setup()
sys.pf_init()
powerflow.run(sys)
sys.td_init()
# timedomain.run(sys)
# bus list in NPCC
npcc_bus = list(range(100114, 100124)) + list(range(101001, 101120))
# In the test case ``NA_50_50_50_HVDC3.dm``, all NPCC generators are classical model
# ====== commented out ======
# 6-th order generator model on NPCC buses. All should be None.
# sys.Syn6a.on_bus(npcc_bus)
# ===========================
from andes import system, filters
from andes.routines import powerflow, timedomain
import os
from andes.plot import do_plot
os.chdir('../../cases/curent')
case = 'NA_50_50_50_HVDC3.dm'
sys = system.PowerSystem(case)
assert filters.guess(sys)
assert filters.parse(sys)
sys.setup()
sys.pf_init()
powerflow.run(sys)
sys.td_init()
sys.TDS.tf = 2
timedomain.run(sys)
Syn6a_omega = sys.Syn6a.omega
Syn6a_omega = [i + 1 for i in Syn6a_omega]
x, y = sys.varout.get_xy(Syn6a_omega)
-------
PowerSystem
Andes PowerSystem object
"""
t0, _ = elapsed()
# enable profiler if requested
pr = cProfile.Profile()
if profile is True:
pr.enable()
system = PowerSystem(case, **kwargs)
# guess format and parse data
if not filters.guess(system):
return
if not filters.parse(system):
return
# dump system as raw file if requested
if dump_raw:
filters.dump_raw(system)
system.setup()
# show data
if show_data is not None:
if len(show_data) == 0:
show_data = sorted(system.devman.devices)