-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgenerate_pf_basecase.py
37 lines (27 loc) · 1.09 KB
/
generate_pf_basecase.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
from pf2rec import *
import os
from GridCal.Engine import *
_version = '2.0.0'
# Absolute path to the folder containing the model information
data_path = os.path.abspath(os.path.join(os.getcwd(), "SMIB"))
grid = None
# Grid model in GridCal
file_handler = FileOpen(os.path.abspath(os.path.join(data_path,
"PSSE_Files",
"SMIB_Base_Case.raw")))
# Creating grid object
grid = file_handler.open()
# Power flow options
options = PowerFlowOptions(SolverType.NR,
verbose = True,
initialize_with_existing_solution = False,
multi_core = False,
tolerance = 1e-12,
max_iter = 99,
control_q = ReactivePowerControlMode.Direct)
pf = PowerFlowDriver(grid, options)
pf.run()
gridcal2rec(grid = grid, pf = pf, model_name = 'SMIB',
data_path = data_path,
pf_num = 0, export_pf_results = False,
is_time_series = False, openipsl_version = _version)