pydae 0.54.1__py3-none-any.whl → 0.54.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pydae/__init__.py +1 -1
- pydae/bmapu/bmapu_builder.py +6 -0
- pydae/bmapu/docs/trafo.md +18 -0
- pydae/bmapu/miscellaneous/pll.py +10 -9
- pydae/bmapu/syns/milano4ord.py +1 -1
- pydae/bmapu/vscs/bess_pq.ipynb +1 -1
- pydae/bmapu/vscs/temp.py +26 -26
- pydae/bmapu/vscs/temp_cffi.c +1923 -807
- pydae/bmapu/vscs/temp_xy_0.json +8 -0
- pydae/bmapu/vscs/vdc_pq_qv_pfr.ipynb +116 -0
- pydae/bmapu/vscs/vsc_pq_qv_pfr.hjson +9 -0
- pydae/bmapu/vscs/vsc_pq_qv_pfr.py +134 -0
- pydae/bmapu/vscs/vscs.py +10 -3
- pydae/bmapu/vscs/xy_0.json +5 -11
- pydae/bmapu/vsgs/regfm_b1.ipynb +428 -0
- pydae/bmapu/vsgs/regfm_b1.py +223 -0
- pydae/bmapu/vsgs/temp.py +21 -21
- pydae/bmapu/vsgs/temp_cffi.c +613 -697
- pydae/bmapu/vsgs/vsgs.py +2 -0
- pydae/ctrl.py +15 -0
- pydae/edashboards/pv_model/pv_model_module.py +1 -0
- pydae/svg_tools/svg_tools.py +5 -4
- pydae/urisi/lines/lines.py +38 -0
- pydae/urisi/sources/ac3ph3w_ideal.py +14 -7
- pydae/urisi/transformers/Dyg11.json +19 -0
- pydae/urisi/transformers/Dyg11.py +191 -0
- pydae/urisi/transformers/Dyn11.py +8 -8
- pydae/urisi/transformers/cigre_eu_lv_ind.py +23 -23
- pydae/urisi/transformers/cigre_eu_lv_ind_ini_cffi.c +266 -454
- pydae/urisi/transformers/cigre_eu_lv_ind_run_cffi.c +266 -454
- pydae/urisi/transformers/cigre_eu_lv_ind_trap_cffi.c +214 -394
- pydae/urisi/transformers/transformers.py +8 -2
- pydae/urisi/transformers/xy_0.json +24 -24
- pydae/urisi/utils/model2svg.py +54 -6
- pydae/urisi/vsc_ctrls/ctrl_3ph_4w_droop.py +13 -6
- pydae/utils/utils.py +1 -1
- {pydae-0.54.1.dist-info → pydae-0.54.3.dist-info}/METADATA +4 -5
- {pydae-0.54.1.dist-info → pydae-0.54.3.dist-info}/RECORD +41 -33
- pydae/urisi/vscs/ac3ph4wgfpidq3.json +0 -0
- {pydae-0.54.1.dist-info → pydae-0.54.3.dist-info}/COPYING +0 -0
- {pydae-0.54.1.dist-info → pydae-0.54.3.dist-info}/LICENSE +0 -0
- {pydae-0.54.1.dist-info → pydae-0.54.3.dist-info}/WHEEL +0 -0
pydae/__init__.py
CHANGED
pydae/bmapu/bmapu_builder.py
CHANGED
|
@@ -530,6 +530,12 @@ class bmapu:
|
|
|
530
530
|
self.construct(name)
|
|
531
531
|
self.compile()
|
|
532
532
|
|
|
533
|
+
def build_mkl_win(self, name =''):
|
|
534
|
+
if name == '':
|
|
535
|
+
print('Error: name is not provided.')
|
|
536
|
+
self.construct(name)
|
|
537
|
+
self.compile_mkl(name)
|
|
538
|
+
|
|
533
539
|
def checker(self):
|
|
534
540
|
|
|
535
541
|
if not 'syns' in self.data: self.data.update({'syns':[]})
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
Y_cc = g_jk + j*b_jk
|
|
4
|
+
|
|
5
|
+
Y_prim =
|
|
6
|
+
[[ Y_cc/(a_s**2+b_s**2),-Y_cc/(a_s-j*b_s)],
|
|
7
|
+
[ -Y_cc/(a_s+j*b_s), Y_cc]]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
with:
|
|
11
|
+
|
|
12
|
+
a_s = tap*cos(ang)
|
|
13
|
+
b_s = tap*sin(ang)
|
|
14
|
+
|
|
15
|
+
tap = tap
|
|
16
|
+
ang = phase shift (can work as shift transformer)
|
|
17
|
+
|
|
18
|
+
|
pydae/bmapu/miscellaneous/pll.py
CHANGED
|
@@ -10,6 +10,7 @@ import sympy as sym
|
|
|
10
10
|
|
|
11
11
|
def add_pll(grid,data):
|
|
12
12
|
"""
|
|
13
|
+
Implements a Phase-Lock Loop that can be used from other devices
|
|
13
14
|
|
|
14
15
|
"plls":[{bus:"1","K_p_pll": 180, "K_i_pll": 3200, "T_pll": 0.02}]
|
|
15
16
|
"""
|
|
@@ -30,10 +31,10 @@ def add_pll(grid,data):
|
|
|
30
31
|
|
|
31
32
|
# PLL
|
|
32
33
|
# dynamic states
|
|
33
|
-
theta_pll,xi_pll,omega_pll_f = sym.symbols(f'theta_pll_{name},xi_pll_{name},omega_pll_f_{name}', real=True)
|
|
34
|
+
theta_pll,xi_pll,omega_pll_f, rocof_pll_f = sym.symbols(f'theta_pll_{name},xi_pll_{name},omega_pll_f_{name}, rocof_pll_f_{name}', real=True)
|
|
34
35
|
|
|
35
36
|
# algebraic statate
|
|
36
|
-
|
|
37
|
+
rocof_pll = sym.symbols(f'rocof_pll_{name}', real=True)
|
|
37
38
|
|
|
38
39
|
|
|
39
40
|
# parameters
|
|
@@ -50,15 +51,15 @@ def add_pll(grid,data):
|
|
|
50
51
|
dtheta_pll = 2*np.pi*50*(omega_pll - omega_coi)*K_theta_pll
|
|
51
52
|
dxi_pll = v_sd_pll
|
|
52
53
|
domega_pll_f = 1/T_pll*(omega_pll - omega_pll_f)
|
|
53
|
-
|
|
54
|
-
eq_rocof =
|
|
54
|
+
drocof_pll_f = 1/T_pll*(rocof_pll - rocof_pll_f)
|
|
55
|
+
eq_rocof = rocof_pll - domega_pll_f
|
|
55
56
|
|
|
56
57
|
|
|
57
|
-
grid.dae['f'] += [dtheta_pll,dxi_pll,domega_pll_f]
|
|
58
|
-
grid.dae['x'] += [ theta_pll, xi_pll, omega_pll_f]
|
|
58
|
+
grid.dae['f'] += [dtheta_pll,dxi_pll,domega_pll_f, drocof_pll_f]
|
|
59
|
+
grid.dae['x'] += [ theta_pll, xi_pll, omega_pll_f, rocof_pll_f]
|
|
59
60
|
grid.dae['g'] += [eq_rocof]
|
|
60
|
-
grid.dae['y_ini'] += [
|
|
61
|
-
grid.dae['y_run'] += [
|
|
61
|
+
grid.dae['y_ini'] += [rocof_pll]
|
|
62
|
+
grid.dae['y_run'] += [rocof_pll]
|
|
62
63
|
grid.dae['params_dict'].update({f'K_p_pll_{name}':data['K_p_pll']})
|
|
63
64
|
grid.dae['params_dict'].update({f'K_i_pll_{name}':data['K_i_pll']})
|
|
64
65
|
grid.dae['params_dict'].update({f'T_pll_{name}':data['T_pll']})
|
|
@@ -66,7 +67,7 @@ def add_pll(grid,data):
|
|
|
66
67
|
|
|
67
68
|
grid.dae['h_dict'].update({f"omega_pll_{name}":omega_pll})
|
|
68
69
|
grid.dae['h_dict'].update({f"omega_pll_f_{name}":omega_pll_f})
|
|
69
|
-
grid.dae['h_dict'].update({f"
|
|
70
|
+
grid.dae['h_dict'].update({f"rocof_pll_{name}":rocof_pll})
|
|
70
71
|
|
|
71
72
|
def test():
|
|
72
73
|
import numpy as np
|
pydae/bmapu/syns/milano4ord.py
CHANGED
|
@@ -101,7 +101,7 @@ def milano4ord(grid,name,bus_name,data_dict):
|
|
|
101
101
|
|
|
102
102
|
grid.dae['xy_0_dict'].update({str(omega):1.0})
|
|
103
103
|
grid.dae['xy_0_dict'].update({str(e1q):1.0})
|
|
104
|
-
grid.dae['xy_0_dict'].update({str(i_q):0
|
|
104
|
+
grid.dae['xy_0_dict'].update({str(i_q):1.0})
|
|
105
105
|
|
|
106
106
|
|
|
107
107
|
# outputs
|
pydae/bmapu/vscs/bess_pq.ipynb
CHANGED
pydae/bmapu/vscs/temp.py
CHANGED
|
@@ -92,21 +92,21 @@ class model:
|
|
|
92
92
|
self.Dt_min = 0.001000
|
|
93
93
|
self.solvern = 5
|
|
94
94
|
self.imax = 100
|
|
95
|
-
self.N_x =
|
|
96
|
-
self.N_y =
|
|
97
|
-
self.N_z =
|
|
95
|
+
self.N_x = 8
|
|
96
|
+
self.N_y = 14
|
|
97
|
+
self.N_z = 10
|
|
98
98
|
self.N_store = 100000
|
|
99
|
-
self.params_list = ['S_base', '
|
|
100
|
-
self.params_values_list = [
|
|
101
|
-
self.inputs_ini_list = ['
|
|
102
|
-
self.inputs_ini_values_list = [0, 0, 0, 0, 0, 0
|
|
103
|
-
self.inputs_run_list = ['
|
|
104
|
-
self.inputs_run_values_list = [0, 0, 0, 0, 0, 0
|
|
105
|
-
self.outputs_list = ['
|
|
106
|
-
self.x_list = ['
|
|
107
|
-
self.y_run_list = ['
|
|
99
|
+
self.params_list = ['S_base', 'g_1_2', 'b_1_2', 'bs_1_2', 'U_1_n', 'U_2_n', 'S_n_1', 'K_pfr_1', 'K_h_1', 'K_qv_1', 'K_p_pll_1', 'K_i_pll_1', 'T_pll_1', 'K_theta_pll_1', 'S_n_2', 'F_n_2', 'X_v_2', 'R_v_2', 'K_delta_2', 'K_alpha_2', 'K_rocov_2', 'K_p_agc', 'K_i_agc', 'K_xif']
|
|
100
|
+
self.params_values_list = [100000000, 0.0, -19.999999999999996, 0.0, 20000, 20000, 1000000, 0.0, 0.0, 0.0, 180, 3200, 0.02, 1.0, 100000000, 50, 0.01, 0, 0.01, 0.01, 1e-06, 0, 0, 1e-06]
|
|
101
|
+
self.inputs_ini_list = ['P_1', 'Q_1', 'P_2', 'Q_2', 'p_in_1', 'Dp_r_1', 'Dq_r_1', 'v_ref_1', 'alpha_2', 'v_ref_2', 'omega_ref_2', 'delta_ref_2', 'phi_2', 'rocov_2']
|
|
102
|
+
self.inputs_ini_values_list = [0, 0, 0, 0, 0.8, 0.0, 0.0, 1.0, 0, 1.0, 1.0, 0.0, 0.0, 0.0]
|
|
103
|
+
self.inputs_run_list = ['P_1', 'Q_1', 'P_2', 'Q_2', 'p_in_1', 'Dp_r_1', 'Dq_r_1', 'v_ref_1', 'alpha_2', 'v_ref_2', 'omega_ref_2', 'delta_ref_2', 'phi_2', 'rocov_2']
|
|
104
|
+
self.inputs_run_values_list = [0, 0, 0, 0, 0.8, 0.0, 0.0, 1.0, 0, 1.0, 1.0, 0.0, 0.0, 0.0]
|
|
105
|
+
self.outputs_list = ['V_1', 'V_2', 'p_in_1', 'Dp_r_1', 'Dq_r_1', 'omega_pll_1', 'omega_pll_f_1', 'rocof_pll_1', 'alpha_2', 'Dv_2']
|
|
106
|
+
self.x_list = ['theta_pll_1', 'xi_pll_1', 'omega_pll_f_1', 'rocof_pll_f_1', 'delta_2', 'Domega_2', 'Dv_2', 'xi_freq']
|
|
107
|
+
self.y_run_list = ['V_1', 'theta_1', 'V_2', 'theta_2', 'p_out_1', 'q_out_1', 'rocof_pll_1', 'omega_2', 'i_d_2', 'i_q_2', 'p_s_2', 'q_s_2', 'omega_coi', 'p_agc']
|
|
108
108
|
self.xy_list = self.x_list + self.y_run_list
|
|
109
|
-
self.y_ini_list = ['
|
|
109
|
+
self.y_ini_list = ['V_1', 'theta_1', 'V_2', 'theta_2', 'p_out_1', 'q_out_1', 'rocof_pll_1', 'omega_2', 'i_d_2', 'i_q_2', 'p_s_2', 'q_s_2', 'omega_coi', 'p_agc']
|
|
110
110
|
self.xy_ini_list = self.x_list + self.y_ini_list
|
|
111
111
|
self.t = 0.0
|
|
112
112
|
self.it = 0
|
|
@@ -333,7 +333,7 @@ class model:
|
|
|
333
333
|
## y_ini to y_run
|
|
334
334
|
self.y_ini = self.xy_ini[self.N_x:]
|
|
335
335
|
self.y_run = np.copy(self.y_ini)
|
|
336
|
-
self.u_run = np.copy(self.u_ini)
|
|
336
|
+
#self.u_run = np.copy(self.u_ini)
|
|
337
337
|
|
|
338
338
|
## y_ini to u_run
|
|
339
339
|
for item in self.yini2urun:
|
|
@@ -1928,24 +1928,24 @@ def sp_H_jacs_run_eval(H_x,H_y,H_u,x,y,u,p,Dt):
|
|
|
1928
1928
|
|
|
1929
1929
|
def sp_jac_ini_vectors():
|
|
1930
1930
|
|
|
1931
|
-
sp_jac_ini_ia = [0,
|
|
1932
|
-
sp_jac_ini_ja = [0,
|
|
1933
|
-
sp_jac_ini_nia =
|
|
1934
|
-
sp_jac_ini_nja =
|
|
1931
|
+
sp_jac_ini_ia = [0, 1, 8, 9, 20, 0, 8, 9, 0, 1, 2, 8, 9, 3, 14, 4, 15, 20, 5, 6, 7, 20, 8, 9, 10, 11, 12, 8, 9, 10, 11, 13, 8, 9, 10, 11, 18, 8, 9, 10, 11, 19, 2, 3, 12, 2, 3, 8, 13, 0, 1, 2, 8, 9, 14, 5, 15, 4, 10, 11, 16, 17, 4, 6, 10, 11, 16, 17, 4, 10, 11, 16, 17, 18, 4, 10, 11, 16, 17, 19, 15, 20, 7, 20, 21]
|
|
1932
|
+
sp_jac_ini_ja = [0, 5, 8, 13, 15, 18, 19, 20, 22, 27, 32, 37, 42, 45, 49, 55, 57, 62, 68, 74, 80, 82, 85]
|
|
1933
|
+
sp_jac_ini_nia = 22
|
|
1934
|
+
sp_jac_ini_nja = 22
|
|
1935
1935
|
return sp_jac_ini_ia, sp_jac_ini_ja, sp_jac_ini_nia, sp_jac_ini_nja
|
|
1936
1936
|
|
|
1937
1937
|
def sp_jac_run_vectors():
|
|
1938
1938
|
|
|
1939
|
-
sp_jac_run_ia = [0,
|
|
1940
|
-
sp_jac_run_ja = [0,
|
|
1941
|
-
sp_jac_run_nia =
|
|
1942
|
-
sp_jac_run_nja =
|
|
1939
|
+
sp_jac_run_ia = [0, 1, 8, 9, 20, 0, 8, 9, 0, 1, 2, 8, 9, 3, 14, 4, 15, 20, 5, 6, 7, 20, 8, 9, 10, 11, 12, 8, 9, 10, 11, 13, 8, 9, 10, 11, 18, 8, 9, 10, 11, 19, 2, 3, 12, 2, 3, 8, 13, 0, 1, 2, 8, 9, 14, 5, 15, 4, 10, 11, 16, 17, 4, 6, 10, 11, 16, 17, 4, 10, 11, 16, 17, 18, 4, 10, 11, 16, 17, 19, 15, 20, 7, 20, 21]
|
|
1940
|
+
sp_jac_run_ja = [0, 5, 8, 13, 15, 18, 19, 20, 22, 27, 32, 37, 42, 45, 49, 55, 57, 62, 68, 74, 80, 82, 85]
|
|
1941
|
+
sp_jac_run_nia = 22
|
|
1942
|
+
sp_jac_run_nja = 22
|
|
1943
1943
|
return sp_jac_run_ia, sp_jac_run_ja, sp_jac_run_nia, sp_jac_run_nja
|
|
1944
1944
|
|
|
1945
1945
|
def sp_jac_trap_vectors():
|
|
1946
1946
|
|
|
1947
|
-
sp_jac_trap_ia = [0,
|
|
1948
|
-
sp_jac_trap_ja = [0,
|
|
1949
|
-
sp_jac_trap_nia =
|
|
1950
|
-
sp_jac_trap_nja =
|
|
1947
|
+
sp_jac_trap_ia = [0, 1, 8, 9, 20, 0, 1, 8, 9, 0, 1, 2, 8, 9, 3, 14, 4, 15, 20, 5, 6, 7, 20, 8, 9, 10, 11, 12, 8, 9, 10, 11, 13, 8, 9, 10, 11, 18, 8, 9, 10, 11, 19, 2, 3, 12, 2, 3, 8, 13, 0, 1, 2, 8, 9, 14, 5, 15, 4, 10, 11, 16, 17, 4, 6, 10, 11, 16, 17, 4, 10, 11, 16, 17, 18, 4, 10, 11, 16, 17, 19, 15, 20, 7, 20, 21]
|
|
1948
|
+
sp_jac_trap_ja = [0, 5, 9, 14, 16, 19, 20, 21, 23, 28, 33, 38, 43, 46, 50, 56, 58, 63, 69, 75, 81, 83, 86]
|
|
1949
|
+
sp_jac_trap_nia = 22
|
|
1950
|
+
sp_jac_trap_nja = 22
|
|
1951
1951
|
return sp_jac_trap_ia, sp_jac_trap_ja, sp_jac_trap_nia, sp_jac_trap_nja
|