-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloadflow_state_estimation.gsql
33 lines (21 loc) · 1.63 KB
/
loadflow_state_estimation.gsql
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
// 06/16/2017 [Chen Yuan] This loadflow file is for state estimation
set sys.data_root="/home/tigergraph/chenyuan/input/scn/"
USE GRAPH state_estimation
drop job load_flow
// define the loading job
create loading job load_flow for graph state_estimation
{
load "/home/tigergraph/qiwei/input/IEEE118_nodeinfo_se.csv"
// load "/home/tigergraph/qiwei/input/IEEE14_node_bd.csv"
// load "/home/tigergraph/qiwei/input/sc_20160818_1120.QS_nodeinfo_mod_se.csv"
to vertex GNode values($"bus_id", $"bus_id", $"type", $"M_P", $"M_Q", $"G", $"B", $"voltage", $"angle", 0, $"M_Vm", $"M_Va", $"Ri_V", $"Ri_vP", $"Ri_vQ", $"bus_name",0)
using Separator=",", Header="true";
load "/home/tigergraph/qiwei/input/IEEE118_edgeinfo_se.csv"
// load "/home/tigergraph/qiwei/input/IEEE14_branches_bd.csv"
// load "/home/tigergraph/qiwei/input/sc_20160818_1120.QS_edgeinfo_mod_se.csv"
to edge connected values($0, $1,reduce(add(_getG($"R", $"X"))),reduce(add(_getB($"R", $"X"))), reduce(add($"B")), reduce(add($"transformer_final_turns_ratio")), reduce(add(1)), reduce(add(divide($"X"))), reduce(add($"M_P_TLPF")), reduce(add($"M_Q_TLPF")), _, _, _, $"Ri_eP", $"Ri_eQ", 1, 0), //where to_float($4) == 1,
to edge connected values($1, $0,reduce(add(_getG($"R", $"X"))),reduce(add(_getB($"R", $"X"))), reduce(add($"B")), reduce(add(_minus($"transformer_final_turns_ratio"))), reduce(add(1)), reduce(add(divide($"X"))), reduce(add($"M_P_TLPF_reverse")), reduce(add($"M_Q_TLPF_reverse")), _, _, _, $"Ri_eP_reverse", $"Ri_eQ_reverse", 0, 0)
using Separator=",", Header="true";
}
clear graph store -HARD
run job load_flow