This repository has been archived by the owner on Apr 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
apply_simulation_parameters.py
49 lines (40 loc) · 1.7 KB
/
apply_simulation_parameters.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
def apply_simulation_parameters(datapath, savfile, snpfile, \
outfile, progressFile):
import psspy
psspy.psseinit(50000)
import os
if datapath:
savfile = os.path.join(datapath, savfile)
snpfile = os.path.join(datapath, snpfile)
psspy.lines_per_page_one_device(1, 10000000)
psspy.lines_per_page_one_device(2, 10000000)
psspy.progress_output(2, progressFile, [0, 0])
ierr = psspy.case(savfile)
if ierr:
psspy.progress_output(1, "", [0, 0])
print(" psspy.case Error")
return
import numpy as np
ierr = psspy.rstr(snpfile)
if ierr:
psspy.progress_output(1, "", [0, 0])
print(" psspy.rstr Error")
return
psspy.lines_per_page_one_device(1, 10000000)
psspy.dynamics_solution_param_2(realar3=0.01)
ierr, mbase1 = psspy.macdat(1, '1', 'MBASE')
print('mbase1 =', mbase1)
ierr, mbase2 = psspy.macdat(2, '1', 'MBASE')
ierr, mbase3 = psspy.macdat(3, '1', 'MBASE')
# add dummy governor without droop and time constants
ierr = psspy.add_plant_model(1,'1',7,r"""IEESGO""",0,"",0,[],[],\
11,[0.0,0.0,0.05,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0])
# print('ierr for add_plant_model =', ierr)
ierr = psspy.add_plant_model(2,'1',7,r"""IEESGO""",0,"",0,[],[],\
11,[0.0,0.0,0.05,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0])
ierr = psspy.add_plant_model(3,'1',7,r"""IEESGO""",0,"",0,[],[],\
11,[0.0,0.0,0.05,0.0,0.0,0.0,0.0,0.0,0.0,1.0,0.0])
psspy.machine_array_channel([-1,6, 1], '1' ,"")
psspy.machine_array_channel([-1,6, 2], '1' ,"")
psspy.machine_array_channel([-1,6, 3], '1' ,"")
return mbase1, mbase2, mbase3