Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries/ --ompython_omhome=/usr PowerSystems_PowerSystems.Examples.AC3ph.Elementary.Fault.conf.json loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo", uses=false) loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex 4.0.0+maint.om/package.mo", uses=false) loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 3.2.3+maint.om/package.mo", uses=false) loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/PowerSystems 1.0.1/package.mo", uses=false) Using package PowerSystems with version 1.0.1 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/PowerSystems 1.0.1/package.mo) Using package Modelica with version 3.2.3 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 3.2.3+maint.om/package.mo) Using package Complex with version 4.0.0 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex 4.0.0+maint.om/package.mo) Using package ModelicaServices with version 4.0.0 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo) Running command: translateModel(PowerSystems.Examples.AC3ph.Elementary.Fault,tolerance=1e-06,outputFormat="empty",numberOfIntervals=4000,variableFilter="",fileNamePrefix="PowerSystems_PowerSystems.Examples.AC3ph.Elementary.Fault") translateModel(PowerSystems.Examples.AC3ph.Elementary.Fault,tolerance=1e-06,outputFormat="empty",numberOfIntervals=4000,variableFilter="",fileNamePrefix="PowerSystems_PowerSystems.Examples.AC3ph.Elementary.Fault") Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo): time 0.001089/0.001089, allocations: 110.1 kB / 17.7 MB, free: 5.418 MB / 14.72 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/Complex 4.0.0+maint.om/package.mo): time 0.00122/0.00122, allocations: 192 kB / 18.64 MB, free: 4.488 MB / 14.72 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 3.2.3+maint.om/package.mo): time 1.596/1.596, allocations: 205.1 MB / 224.5 MB, free: 12.27 MB / 190.1 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/PowerSystems 1.0.1/package.mo): time 0.1697/0.1697, allocations: 37.99 MB / 309.9 MB, free: 5.977 MB / 254.1 MB Notification: Performance of FrontEnd - Absyn->SCode: time 2.822e-05/2.838e-05, allocations: 2.281 kB / 376.7 MB, free: 2.98 MB / 318.1 MB Notification: Performance of NFInst.instantiate(PowerSystems.Examples.AC3ph.Elementary.Fault): time 0.1978/0.1979, allocations: 7.391 MB / 384.1 MB, free: 58.42 MB / 318.1 MB Notification: Performance of NFInst.instExpressions: time 0.004537/0.2025, allocations: 2.361 MB / 386.5 MB, free: 57.62 MB / 318.1 MB Notification: Performance of NFInst.updateImplicitVariability: time 0.0004683/0.203, allocations: 22.84 kB / 386.5 MB, free: 57.62 MB / 318.1 MB Notification: Performance of NFTyping.typeComponents: time 0.001838/0.2048, allocations: 0.7552 MB / 387.3 MB, free: 57.45 MB / 318.1 MB Notification: Performance of NFTyping.typeBindings: time 0.001649/0.2065, allocations: 0.6214 MB / 387.9 MB, free: 57.35 MB / 318.1 MB Notification: Performance of NFTyping.typeClassSections: time 0.001206/0.2077, allocations: 479.2 kB / 388.4 MB, free: 57.31 MB / 318.1 MB Notification: Performance of NFFlatten.flatten: time 0.002082/0.2098, allocations: 1.623 MB / 390 MB, free: 57.05 MB / 318.1 MB Notification: Performance of NFFlatten.resolveConnections: time 0.0008089/0.2107, allocations: 0.4918 MB / 390.5 MB, free: 56.85 MB / 318.1 MB Notification: Performance of NFEvalConstants.evaluate: time 0.00101/0.2117, allocations: 0.6119 MB / 391.1 MB, free: 56.59 MB / 318.1 MB Notification: Performance of NFSimplifyModel.simplify: time 0.000718/0.2124, allocations: 0.5276 MB / 391.6 MB, free: 56.35 MB / 318.1 MB Notification: Performance of NFPackage.collectConstants: time 0.0001189/0.2125, allocations: 76.62 kB / 391.7 MB, free: 56.35 MB / 318.1 MB Notification: Performance of NFFlatten.collectFunctions: time 0.001196/0.2137, allocations: 0.4899 MB / 392.2 MB, free: 56.24 MB / 318.1 MB Notification: Performance of combineBinaries: time 0.001296/0.215, allocations: 1.403 MB / 393.6 MB, free: 55.36 MB / 318.1 MB Notification: Performance of replaceArrayConstructors: time 0.0005577/0.2156, allocations: 0.8877 MB / 394.5 MB, free: 54.76 MB / 318.1 MB Notification: Performance of NFVerifyModel.verify: time 0.0002239/0.2158, allocations: 134.4 kB / 394.6 MB, free: 54.7 MB / 318.1 MB Notification: Performance of FrontEnd: time 0.0001314/0.216, allocations: 15.31 kB / 394.6 MB, free: 54.7 MB / 318.1 MB Notification: Model statistics after passing the front-end and creating the data structures used by the back-end: * Number of equations: 292 (145) * Number of variables: 292 (148) Notification: Performance of Bindings: time 0.003437/0.2194, allocations: 3.697 MB / 398.3 MB, free: 52.18 MB / 318.1 MB Notification: Performance of FunctionAlias: time 0.0004388/0.2199, allocations: 389.4 kB / 398.7 MB, free: 51.94 MB / 318.1 MB Notification: Performance of Early Inline: time 0.002246/0.2221, allocations: 2.356 MB / 401 MB, free: 50.54 MB / 318.1 MB Notification: Performance of simplify1: time 0.0002431/0.2224, allocations: 161.3 kB / 401.2 MB, free: 50.45 MB / 318.1 MB Notification: Performance of Alias: time 0.002129/0.2245, allocations: 2.091 MB / 403.3 MB, free: 48.85 MB / 318.1 MB Notification: Performance of simplify2: time 0.0001316/0.2247, allocations: 143.8 kB / 403.4 MB, free: 48.74 MB / 318.1 MB Notification: Performance of Events: time 0.0004257/0.2251, allocations: 453.9 kB / 403.9 MB, free: 48.36 MB / 318.1 MB Notification: Performance of Detect States: time 0.0005751/0.2257, allocations: 0.7774 MB / 404.6 MB, free: 47.56 MB / 318.1 MB Notification: Performance of Partitioning: time 0.0007651/0.2265, allocations: 0.9242 MB / 405.6 MB, free: 46.59 MB / 318.1 MB Error: Internal error NBSlice.fillDependencyArray failed because number of flattened indices 1 for dependency switch1.switch_c.v could not be devided by the body size 2 without rest. Error: Internal error NBAdjacency.Matrix.createPseudo failed for: [ARRY] (2) {switch1.switch_c.v, switch1.switch_c.i} = if $SEV_14 then {switch1.switch_c.epsR * switch1.switch_c.s, switch1.switch_c.s} else {switch1.switch_c.s, switch1.switch_c.epsG * switch1.switch_c.s} ($RES_SIM_88) Error: Internal error NBAdjacency.Matrix.create failed to create adjacency matrix for system: System Variables (158/318) **************************** (1) [ALGB] (1) protected Real voltage1.V (nominal = 1000.0) (2) [ALGB] (3) flow Real[3] voltage2.term.i (nominal = {1.0 for $i1 in 1:3}) (3) [ALGB] (9) protected Real[3, 3] switch1.Park = PowerSystems.Utilities.Transforms.park(switch1.term_p.theta[2]) (4) [ALGB] (3) flow Real[3] switch1.term_p.i (nominal = {1.0 for $i1 in 1:3}) (5) [ALGB] (3) flow Real[3] line.term_p.i (nominal = {1.0 for $i1 in 1:3}) (6) [ALGB] (1) protected Real switch2.switch_b.i (7) [DISC] (1) Boolean $SEV_22 (8) [DISC] (1) Boolean $SEV_21 (9) [DISC] (1) Boolean $SEV_20 (10) [DISC] (1) Boolean $TEV_5 (11) [ALGB] (3) Real[3] voltage2.term.v (nominal = {1000.0 for $i1 in 1:3}) (12) [DISC] (1) Boolean $TEV_4 (13) [DISC] (1) Boolean $TEV_3 (14) [DISC] (1) Boolean $TEV_2 (15) [ALGB] (3) Real[3] line.term_p.v (nominal = {1000.0 for $i1 in 1:3}) (16) [DISC] (1) Boolean $TEV_1 (17) [DISC] (1) Boolean $TEV_0 (18) [DISC] (1) protected Boolean switch1.switch_c.open = not (not switch1.switch_c.open) (start = true) (19) [ALGB] (2) Real[2] voltage2.term.theta (20) [DISS] (1) protected discrete Real fault_ab.theta_zero (fixed = true, start = 1e60) (21) [ALGB] (3) Real[3] switch1.v_abc (nominal = {1000.0 for $i1 in 1:3}, StateSelect = never) (22) [ALGB] (3) Real[3] fault_ab.term.v (nominal = {1000.0 for $i1 in 1:3}) (23) [DISC] (1) Boolean $SEV_19 (24) [DISC] (1) Boolean $SEV_18 (25) [DISC] (1) Boolean $SEV_17 (26) [ALGB] (3) Real[3] switch2.i_abc (nominal = {1.0 for $i1 in 1:3}, StateSelect = never) (27) [DISC] (1) Boolean $SEV_16 (28) [DISC] (1) Boolean $SEV_15 (29) [ALGB] (4) protected Real[2, 2] meter.Rot_dq (30) [DISC] (1) Boolean $SEV_14 (31) [DISC] (1) Boolean $SEV_13 (32) [DISC] (1) Boolean $SEV_12 (33) [DISS] (1) protected Boolean fault_ab.first (fixed = true, start = true) (34) [DISC] (1) Boolean $SEV_11 (35) [DISC] (3) Boolean[3] relay2.y (fixed = {true for $i1 in 1:3}, start = {relay2.ini_state for $i1 in 1:3}) (36) [DISC] (1) Boolean $SEV_10 (37) [ALGB] (1) protected Real voltage1.phi (38) [ALGB] (3) flow Real[3] fault_ab.term.i (nominal = {1.0 for $i1 in 1:3}) (39) [ALGB] (2) Real[2] line.term_n.theta (40) [ALGB] (1) protected Real switch2.switch_a.v (41) [ALGB] (3) Real[3] fault_ab.v_abc (start = fault_ab.v_abc_start, nominal = {1000.0 for $i1 in 1:3}, StateSelect = never) (42) [ALGB] (1) protected Real switch2.switch_a.s (start = 0.5) (43) [DISC] (3) Boolean[3] switch2.control (44) [ALGB] (2) Real[2] switch2.term_n.theta (45) [ALGB] (2) Real[2] switch1.term_n.theta (46) [ALGB] (2) Real[2] meter.term_n.theta (47) [ALGB] (1) protected Real switch2.switch_a.i (48) [ALGB] (1) Real meter.alpha_i (StateSelect = never) (49) [DER-] (2) Real[2] $DER.line.term_p.theta (50) [ALGB] (3) Real[3] meter.v (StateSelect = never) (51) [DISC] (1) protected Integer relay1.cnt (fixed = true, start = 1) (52) [ALGB] (3) flow Real[3] meter.term_n.i (nominal = {1.0 for $i1 in 1:3}) (53) [ALGB] (3) Real[3] meter.p (StateSelect = never) (54) [DISC] (1) final Boolean fault_ab.fault_pp.on = fault_ab.fault_pp.on (fixed = true, start = false) (55) [ALGB] (1) Real meter.alpha_v (StateSelect = never) (56) [ALGB] (3) Real[3] switch2.term_p.v (nominal = {1000.0 for $i1 in 1:3}) (57) [ALGB] (1) Real meter.i_norm (StateSelect = never) (58) [ALGB] (1) Real $FUN_4 (59) [ALGB] (3) Real[3] switch1.i_abc (nominal = {1.0 for $i1 in 1:3}, StateSelect = never) (60) [ALGB] (1) Real $FUN_3 (61) [ALGB] (1) Real $FUN_2 (62) [ALGB] (3) Real[3] meter.i (StateSelect = never) (63) [ALGB] (1) Real $FUN_1 (64) [ALGB] (3) Real[3] meter.term_n.v (nominal = {1000.0 for $i1 in 1:3}) (65) [ALGB] (2) protected Real[2] voltage2.vPhasor_internal (66) [DISC] (3) Boolean[3] switch1.control (67) [ALGB] (2) Real[2] fault_ab.term.theta (68) [ALGB] (3) flow Real[3] switch2.term_p.i (nominal = {1.0 for $i1 in 1:3}) (69) [ALGB] (3) Real[3] fault_ab.v (nominal = {1000.0 for $i1 in 1:3}) (70) [DISC] (1) protected Boolean switch2.switch_c.open = not (not switch2.switch_c.open) (start = true) (71) [DISC] (3) Boolean[3] relay1.y (fixed = {true for $i1 in 1:3}, start = {relay1.ini_state for $i1 in 1:3}) (72) [ALGB] (9) protected Real[3, 3] fault_ab.Park = PowerSystems.Utilities.Transforms.park(fault_ab.term.theta[2]) (73) [ALGB] (1) protected Real switch1.switch_c.v (74) [ALGB] (1) protected Real switch1.switch_c.s (start = 0.5) (75) [ALGB] (3) Real[3] switch1.term_n.v (nominal = {1000.0 for $i1 in 1:3}) (76) [ALGB] (3) Real[3] fault_ab.i (nominal = {1.0 for $i1 in 1:3}) (77) [DISS] (1) protected Boolean switch1.switch_c.arc (fixed = true, start = false) (78) [DISS] (1) protected Boolean switch2.switch_c.arc (fixed = true, start = false) (79) [ALGB] (9) Real[3, 3] $FUN_16 (80) [ALGB] (9) Real[3, 3] $FUN_15 (81) [ALGB] (1) protected Real switch1.switch_c.i (82) [ALGB] (9) Real[3, 3] $FUN_14 (83) [ALGB] (1) Real $FUN_13 (84) [ALGB] (1) Real $FUN_12 (85) [ALGB] (1) Real $FUN_11 (86) [DISS] (1) protected Boolean switch1.switch_a.arc (fixed = true, start = false) (87) [DISS] (1) protected Boolean switch2.switch_a.arc (fixed = true, start = false) (88) [ALGB] (4) Real[2, 2] $FUN_10 (89) [ALGB] (3) flow Real[3] switch1.term_n.i (nominal = {1.0 for $i1 in 1:3}) (90) [DISC] (1) protected Boolean fault_ab.v_pos (fixed = true, start = true) (91) [ALGB] (1) flow Real voltage1.neutral.i (92) [DISC] (1) Boolean $SEV_9 (93) [DISC] (1) Boolean $SEV_8 (94) [DISC] (1) Boolean $SEV_7 (95) [DISC] (1) Boolean $SEV_6 (96) [DISC] (1) Boolean $SEV_5 (97) [DISC] (1) Boolean $SEV_4 (98) [DISC] (1) Boolean $SEV_3 (99) [ALGB] (3) flow Real[3] line.term_n.i (nominal = {1.0 for $i1 in 1:3}) (100) [DISC] (1) Boolean $SEV_2 (101) [ALGB] (1) flow Real voltage2.neutral.i (102) [ALGB] (3) flow Real[3] voltage1.term.i (nominal = {1.0 for $i1 in 1:3}) (103) [ALGB] (3) Real[3] line.term_n.v (nominal = {1000.0 for $i1 in 1:3}) (104) [DISC] (1) protected Boolean switch2.switch_b.open = not (not switch2.switch_b.open) (start = true) (105) [ALGB] (2) protected Real[2] voltage1.vPhasor_internal (106) [ALGB] (3) Real[3] switch2.v (nominal = {1000.0 for $i1 in 1:3}) (107) [ALGB] (3) Real[3] voltage1.term.v (nominal = {1000.0 for $i1 in 1:3}) (108) [ALGB] (2) Real[2] switch1.term_p.theta (109) [ALGB] (2) Real[2] switch2.term_p.theta (110) [ALGB] (2) Real[2] meter.term_p.theta (111) [ALGB] (3) flow Real[3] line.term_f.i (nominal = {1.0 for $i1 in 1:3}) (112) [ALGB] (1) Real meter.v_norm (StateSelect = never) (113) [ALGB] (1) protected Real voltage2.phi (114) [ALGB] (1) protected Real switch1.switch_b.v (115) [ALGB] (1) Real system.thetaRef = system.thetaRef (116) [ALGB] (1) protected Real switch1.switch_b.s (start = 0.5) (117) [ALGB] (3) Real[3] switch2.i (nominal = {1.0 for $i1 in 1:3}) (118) [DISC] (1) protected Boolean switch1.switch_a.open = not (not switch1.switch_a.open) (start = true) (119) [ALGB] (2) Real[2] meter.vpp (StateSelect = never) (120) [ALGB] (1) Real system.thetaRel = system.thetaRef - system.thetaRef (121) [ALGB] (3) Real[3] line.term_f.v (nominal = {1000.0 for $i1 in 1:3}) (122) [ALGB] (1) Real meter.cos_phi (StateSelect = never) (123) [ALGB] (1) protected Real switch1.switch_b.i (124) [ALGB] (1) protected Real switch2.switch_c.v (125) [ALGB] (1) protected Real switch2.switch_c.s (start = 0.5) (126) [ALGB] (2) Real[2] line.term_f.theta (127) [ALGB] (1) protected Real voltage2.V (nominal = 1000.0) (128) [ALGB] (1) protected Real voltage1.alpha (129) [ALGB] (3) flow Real[3] meter.term_p.i (nominal = {1.0 for $i1 in 1:3}) (130) [ALGB] (2) Real[2] voltage1.term.theta (131) [ALGB] (1) protected Real switch2.switch_c.i (132) [ALGB] (9) protected Real[3, 3] switch2.Park = PowerSystems.Utilities.Transforms.park(switch2.term_p.theta[2]) (133) [DISC] (1) protected Boolean switch2.switch_a.open = not (not switch2.switch_a.open) (start = true) (134) [ALGB] (3) Real[3] switch2.term_n.v (nominal = {1000.0 for $i1 in 1:3}) (135) [DISC] (1) protected Integer relay2.cnt (fixed = true, start = 1) (136) [ALGB] (3) Real[3] meter.term_p.v (nominal = {1000.0 for $i1 in 1:3}) (137) [ALGB] (3) flow Real[3] switch2.term_n.i (nominal = {1.0 for $i1 in 1:3}) (138) [ALGB] (3) Real[3] switch1.v (nominal = {1000.0 for $i1 in 1:3}) (139) [DISC] (1) protected Boolean switch1.switch_b.open = not (not switch1.switch_b.open) (start = true) (140) [ALGB] (1) protected Real switch1.switch_a.v (141) [ALGB] (1) protected Real switch1.switch_a.s (start = 0.5) (142) [ALGB] (2) protected Real[2] line.omega (143) [ALGB] (3) Real[3] switch1.i (nominal = {1.0 for $i1 in 1:3}) (144) [DISS] (1) Real fault_ab.fault_pp.t0 (fixed = true, start = -1e60) (145) [ALGB] (3) Real[3] switch2.v_abc (nominal = {1000.0 for $i1 in 1:3}, StateSelect = never) (146) [ALGB] (1) Real fault_ab.fault_pp.i (147) [DER-] (3) Real[3] $DER.line.i1 (148) [DER-] (3) Real[3] $DER.line.i2 (149) [ALGB] (1) protected Real switch1.switch_a.i (150) [ALGB] (1) protected Real voltage2.alpha (151) [ALGB] (1) protected Real fault_ab.fault_pp.s (start = 0.5) (152) [DISS] (1) protected Boolean switch1.switch_b.arc (fixed = true, start = false) (153) [ALGB] (3) Real[3] switch1.term_p.v (nominal = {1000.0 for $i1 in 1:3}) (154) [DISS] (1) protected Boolean switch2.switch_b.arc (fixed = true, start = false) (155) [ALGB] (1) protected Real switch2.switch_b.v (156) [ALGB] (1) Real fault_ab.fault_pp.v (157) [ALGB] (1) protected Real switch2.switch_b.s (start = 0.5) (158) [ALGB] (3) Real[3] fault_ab.i_abc (nominal = {1.0 for $i1 in 1:3}, StateSelect = never) System Equations (155/318) **************************** (1) [ARRY] (3) switch1.i_abc = transpose(switch1.Park) * switch1.i ($RES_SIM_80) (2) [ARRY] (3) switch1.v = switch1.Park * switch1.v_abc ($RES_SIM_81) (3) [ARRY] (3) line.term_f.v = meter.term_p.v ($RES_SIM_121) (4) [SCAL] (1) switch1.switch_c.i = switch1.i_abc[3] ($RES_SIM_82) (5) [ARRY] (2) line.term_f.theta = meter.term_p.theta ($RES_SIM_122) (6) [SCAL] (1) switch1.switch_c.v = switch1.v_abc[3] ($RES_SIM_83) (7) [FOR-] (3) ($RES_SIM_123) (7) [----] for $i1 in 1:3 loop (7) [----] [SCAL] (1) switch2.term_n.i[$i1] + voltage2.term.i[$i1] = 0.0 ($RES_SIM_124) (7) [----] end for; (8) [SCAL] (1) switch1.switch_b.i = switch1.i_abc[2] ($RES_SIM_84) (9) [SCAL] (1) switch1.switch_b.v = switch1.v_abc[2] ($RES_SIM_85) (10) [ARRY] (3) switch2.term_n.v = voltage2.term.v ($RES_SIM_125) (11) [SCAL] (1) switch1.switch_a.i = switch1.i_abc[1] ($RES_SIM_86) (12) [ARRY] (2) switch2.term_n.theta = voltage2.term.theta ($RES_SIM_126) (13) [SCAL] (1) switch1.switch_a.v = switch1.v_abc[1] ($RES_SIM_87) (14) [FOR-] (3) ($RES_SIM_127) (14) [----] for $i1 in 1:3 loop (14) [----] [SCAL] (1) line.term_n.i[$i1] + switch2.term_p.i[$i1] = 0.0 ($RES_SIM_128) (14) [----] end for; (15) [ARRY] (2) {switch1.switch_c.v, switch1.switch_c.i} = if $SEV_14 then {switch1.switch_c.epsR * switch1.switch_c.s, switch1.switch_c.s} else {switch1.switch_c.s, switch1.switch_c.epsG * switch1.switch_c.s} ($RES_SIM_88) (16) [WHEN] (1)when {$SEV_15, $SEV_16, not switch1.switch_c.open} then (16) [----] switch1.switch_c.arc := edge(switch1.switch_c.open) (16) [----] end when; (17) [ARRY] (3) line.term_n.v = switch2.term_p.v ($RES_SIM_129) (18) [SCAL] (1) fault_ab.fault_pp.on = $SEV_2 ($RES_SIM_12) (19) [WHEN] (1)when $SEV_3 then (19) [----] fault_ab.first := false (19) [----] end when; (20) [WHEN] (1)when $SEV_3 then (20) [----] fault_ab.theta_zero := sum(fault_ab.term.theta) (20) [----] end when; (21) [ARRY] (3) fault_ab.i_abc = transpose(fault_ab.Park) * fault_ab.i ($RES_SIM_15) (22) [ARRY] (3) fault_ab.v = fault_ab.Park * fault_ab.v_abc ($RES_SIM_16) (23) [ARRY] (2) line.term_n.theta = switch2.term_p.theta ($RES_SIM_130) (24) [ARRY] (2) {switch1.switch_b.v, switch1.switch_b.i} = if $SEV_17 then {switch1.switch_b.epsR * switch1.switch_b.s, switch1.switch_b.s} else {switch1.switch_b.s, switch1.switch_b.epsG * switch1.switch_b.s} ($RES_SIM_90) (25) [ARRY] (3) fault_ab.term.i = fault_ab.i ($RES_SIM_17) (26) [FOR-] (3) ($RES_SIM_131) (26) [----] for $i1 in 1:3 loop (26) [----] [SCAL] (1) switch1.term_n.i[$i1] + line.term_p.i[$i1] = 0.0 ($RES_SIM_132) (26) [----] end for; (27) [WHEN] (1)when {$SEV_18, $SEV_19, not switch1.switch_b.open} then (27) [----] switch1.switch_b.arc := edge(switch1.switch_b.open) (27) [----] end when; (28) [ARRY] (3) fault_ab.v = fault_ab.term.v ($RES_SIM_18) (29) [ARRY] (2) {switch1.switch_a.v, switch1.switch_a.i} = if $SEV_20 then {switch1.switch_a.epsR * switch1.switch_a.s, switch1.switch_a.s} else {switch1.switch_a.s, switch1.switch_a.epsG * switch1.switch_a.s} ($RES_SIM_92) (30) [SCAL] (1) $FUN_11 = fault_ab.epsG * $FUN_12 ($RES_SIM_19) (31) [WHEN] (1)when {$SEV_21, $SEV_22, not switch1.switch_a.open} then (31) [----] switch1.switch_a.arc := edge(switch1.switch_a.open) (31) [----] end when; (32) [ARRY] (3) switch1.term_n.v = line.term_p.v ($RES_SIM_133) (33) [SCAL] (1) 1.7320508075688772 * voltage1.term.i[3] + voltage1.neutral.i = 0.0 ($RES_SIM_94) (34) [ARRY] (2) switch1.term_n.theta = line.term_p.theta ($RES_SIM_134) (35) [ARRY] (2) voltage1.term.theta = {system.thetaRel, system.thetaRef} ($RES_SIM_95) (36) [FOR-] (3) ($RES_SIM_135) (36) [----] for $i1 in 1:3 loop (36) [----] [SCAL] (1) voltage1.term.i[$i1] + switch1.term_p.i[$i1] = 0.0 ($RES_SIM_136) (36) [----] end for; (37) [ARRY] (3) voltage1.term.v = switch1.term_p.v ($RES_SIM_137) (38) [ARRY] (3) voltage1.term.v = {$FUN_1 * voltage1.V, $FUN_2 * voltage1.V, 0.0} ($RES_SIM_98) (39) [ARRY] (2) voltage1.term.theta = switch1.term_p.theta ($RES_SIM_138) (40) [SCAL] (1) voltage1.phi = voltage1.term.theta[1] + voltage1.alpha ($RES_SIM_99) (41) [ARRY] (3) relay2.y = switch2.control ($RES_SIM_139) (42) [SCAL] (1) fault_ab.i_abc[3] = fault_ab.epsG * fault_ab.v_abc[3] ($RES_SIM_20) (43) [SCAL] (1) fault_ab.v_pos = $SEV_4 ($RES_SIM_21) (44) [SCAL] (1) fault_ab.fault_pp.i = fault_ab.i_abc[1] ($RES_SIM_22) (45) [SCAL] (1) fault_ab.fault_pp.v = fault_ab.v_abc[1] - fault_ab.v_abc[2] ($RES_SIM_23) (46) [ARRY] (2) {fault_ab.fault_pp.v, fault_ab.fault_pp.i} = if fault_ab.fault_pp.on then {fault_ab.fault_pp.epsR * fault_ab.fault_pp.s, fault_ab.fault_pp.s} else {fault_ab.fault_pp.s, fault_ab.fault_pp.epsG * fault_ab.fault_pp.s} ($RES_SIM_24) (47) [WHEN] (1)when edge(fault_ab.fault_pp.on) then (47) [----] fault_ab.fault_pp.t0 := time (47) [----] end when; (48) [ARRY] (2) meter.term_n.theta = meter.term_p.theta ($RES_SIM_27) (49) [ARRY] (3) relay1.y = switch1.control ($RES_SIM_140) (50) [ARRY] (3) meter.term_p.i + meter.term_n.i = {0.0 for $i1 in 1:3} ($RES_SIM_28) (51) [SCAL] (1) switch2.control[3] = not switch2.switch_c.open ($RES_SIM_141) (52) [ARRY] (3) meter.term_p.v = meter.term_n.v ($RES_SIM_29) (53) [SCAL] (1) switch2.control[2] = not switch2.switch_b.open ($RES_SIM_142) (54) [SCAL] (1) switch2.control[1] = not switch2.switch_a.open ($RES_SIM_143) (55) [SCAL] (1) switch1.control[3] = not switch1.switch_c.open ($RES_SIM_144) (56) [SCAL] (1) switch1.control[2] = not switch1.switch_b.open ($RES_SIM_145) (57) [SCAL] (1) switch1.control[1] = not switch1.switch_a.open ($RES_SIM_146) (58) [ARRY] (4) meter.Rot_dq = $FUN_10 ($RES_SIM_30) (59) [ARRY] (3) meter.p = {meter.v[1:2] * meter.i[1:2], -{-meter.v[2], meter.v[1]} * meter.i[1:2], meter.v[3] * meter.i[3]} ($RES_SIM_38) (60) [ARRY] (3) meter.i = meter.term_p.i / meter.I_base ($RES_SIM_39) (61) [SCAL] (1) $FUN_1 = cos(voltage1.phi) ($RES_$AUX_174) (62) [SCAL] (1) $FUN_2 = sin(voltage1.phi) ($RES_$AUX_173) (63) [SCAL] (1) $FUN_3 = cos(voltage2.phi) ($RES_$AUX_172) (64) [SCAL] (1) $FUN_4 = sin(voltage2.phi) ($RES_$AUX_171) (65) [SCAL] (1) meter.v_norm = sqrt(meter.v * meter.v) ($RES_$AUX_170) (66) [ARRY] (2) meter.vpp = 1.7320508075688772 * {meter.v[2], -meter.v[1]} ($RES_SIM_40) (67) [ARRY] (3) meter.v = meter.term_p.v / meter.V_base ($RES_SIM_41) (68) [SCAL] (1) 1.7320508075688772 * voltage2.term.i[3] + voltage2.neutral.i = 0.0 ($RES_SIM_42) (69) [SCAL] (1) meter.alpha_v = atan2(meter.Rot_dq[:, 2] * meter.v[1:2], meter.Rot_dq[:, 1] * meter.v[1:2]) ($RES_$AUX_169) (70) [ARRY] (3) voltage2.term.v = {$FUN_3 * voltage2.V, $FUN_4 * voltage2.V, 0.0} ($RES_SIM_45) (71) [SCAL] (1) meter.i_norm = sqrt(meter.i * meter.i) ($RES_$AUX_168) (72) [SCAL] (1) voltage2.phi = voltage2.term.theta[1] + voltage2.alpha ($RES_SIM_46) (73) [SCAL] (1) meter.alpha_i = atan2(meter.Rot_dq[:, 2] * meter.i[1:2], meter.Rot_dq[:, 1] * meter.i[1:2]) ($RES_$AUX_167) (74) [SCAL] (1) voltage2.alpha = voltage2.vPhasor_internal[2] ($RES_SIM_47) (75) [SCAL] (1) meter.cos_phi = cos(meter.alpha_v - meter.alpha_i) ($RES_$AUX_166) (76) [SCAL] (1) voltage2.V = voltage2.vPhasor_internal[1] * voltage2.V_base ($RES_SIM_48) (77) [ARRY] (4) $FUN_10 = PowerSystems.Examples.AC3ph.Elementary.Fault.meter.rot_dq(meter.term_p.theta[1]) ($RES_$AUX_165) (78) [ARRY] (2) voltage2.vPhasor_internal = {voltage2.v0, voltage2.alpha0} ($RES_SIM_49) (79) [SCAL] (1) $FUN_11 = sum(fault_ab.i_abc[{1, 2}]) ($RES_$AUX_164) (80) [SCAL] (1) $FUN_12 = sum(fault_ab.v_abc[{1, 2}]) ($RES_$AUX_163) (81) [SCAL] (1) $FUN_13 = sum(fault_ab.term.theta) ($RES_$AUX_162) (82) [ARRY] (9) $FUN_14 = PowerSystems.Utilities.Transforms.park(fault_ab.term.theta[2]) ($RES_$AUX_161) (83) [ARRY] (9) $FUN_15 = PowerSystems.Utilities.Transforms.park(switch2.term_p.theta[2]) ($RES_$AUX_160) (84) [SCAL] (1) $TEV_0 = $PRE.switch2.switch_c.open ($RES_EVT_175) (85) [SCAL] (1) $TEV_1 = $PRE.switch2.switch_b.open ($RES_EVT_176) (86) [ARRY] (2) switch2.term_n.theta = switch2.term_p.theta ($RES_SIM_50) (87) [SCAL] (1) $TEV_2 = $PRE.switch2.switch_a.open ($RES_EVT_177) (88) [ARRY] (3) switch2.term_p.i + switch2.term_n.i = {0.0 for $i1 in 1:3} ($RES_SIM_51) (89) [SCAL] (1) $TEV_3 = $PRE.switch1.switch_c.open ($RES_EVT_178) (90) [ARRY] (3) switch2.term_p.i = switch2.i ($RES_SIM_52) (91) [SCAL] (1) $TEV_4 = $PRE.switch1.switch_b.open ($RES_EVT_179) (92) [ARRY] (3) switch2.v = switch2.term_p.v - switch2.term_n.v ($RES_SIM_53) (93) [ALGO] (4) ($RES_SIM_9) (93) [----] when time > relay1.t_switch[relay1.cnt] then (93) [----] relay1.cnt := min(relay1.cnt + 1, 1); (93) [----] for k in relay1.switched loop (93) [----] relay1.y[k] := not relay1.y[k]; (93) [----] end for; (93) [----] end when; (94) [ARRY] (9) $FUN_16 = PowerSystems.Utilities.Transforms.park(switch1.term_p.theta[2]) ($RES_$AUX_159) (95) [ARRY] (3) switch2.i_abc = transpose(switch2.Park) * switch2.i ($RES_SIM_54) (96) [ALGO] (4) ($RES_SIM_8) (96) [----] when time > relay2.t_switch[relay2.cnt] then (96) [----] relay2.cnt := min(relay2.cnt + 1, 1); (96) [----] for k in relay2.switched loop (96) [----] relay2.y[k] := not relay2.y[k]; (96) [----] end for; (96) [----] end when; (97) [ARRY] (3) switch2.v = switch2.Park * switch2.v_abc ($RES_SIM_55) (98) [SCAL] (1) switch2.switch_c.i = switch2.i_abc[3] ($RES_SIM_56) (99) [SCAL] (1) system.thetaRel = system.thetaRef - system.thetaRef ($RES_BND_147) (100) [SCAL] (1) switch2.switch_c.v = switch2.v_abc[3] ($RES_SIM_57) (101) [SCAL] (1) switch2.switch_b.i = switch2.i_abc[2] ($RES_SIM_58) (102) [ARRY] (9) switch1.Park = $FUN_16 ($RES_BND_149) (103) [SCAL] (1) switch2.switch_b.v = switch2.v_abc[2] ($RES_SIM_59) (104) [SCAL] (1) $TEV_5 = $PRE.switch1.switch_a.open ($RES_EVT_180) (105) [SCAL] (1) $SEV_2 = $FUN_13 > ($PRE.fault_ab.theta_zero + fault_ab.phi_on) ($RES_EVT_181) (106) [SCAL] (1) $SEV_3 = (time > fault_ab.t_on and edge(fault_ab.v_pos)) and $PRE.fault_ab.first ($RES_EVT_182) (107) [SCAL] (1) $SEV_4 = fault_ab.v_abc[1] - fault_ab.v_abc[2] > 0.0 ($RES_EVT_183) (108) [SCAL] (1) $SEV_5 = not switch2.switch_c.open or switch2.switch_c.arc ($RES_EVT_184) (109) [SCAL] (1) $SEV_6 = switch2.switch_c.open and switch2.switch_c.i < 0.0 ($RES_EVT_185) (110) [SCAL] (1) $SEV_7 = switch2.switch_c.open and switch2.switch_c.i > 0.0 ($RES_EVT_186) (111) [SCAL] (1) switch2.switch_a.i = switch2.i_abc[1] ($RES_SIM_60) (112) [SCAL] (1) voltage1.alpha = voltage1.vPhasor_internal[2] ($RES_SIM_100) (113) [SCAL] (1) $SEV_8 = not switch2.switch_b.open or switch2.switch_b.arc ($RES_EVT_187) (114) [SCAL] (1) switch2.switch_a.v = switch2.v_abc[1] ($RES_SIM_61) (115) [SCAL] (1) voltage1.V = voltage1.vPhasor_internal[1] * voltage1.V_base ($RES_SIM_101) (116) [SCAL] (1) $SEV_9 = switch2.switch_b.open and switch2.switch_b.i < 0.0 ($RES_EVT_188) (117) [ARRY] (2) {switch2.switch_c.v, switch2.switch_c.i} = if $SEV_5 then {switch2.switch_c.epsR * switch2.switch_c.s, switch2.switch_c.s} else {switch2.switch_c.s, switch2.switch_c.epsG * switch2.switch_c.s} ($RES_SIM_62) (118) [ARRY] (9) switch2.Park = $FUN_15 ($RES_BND_153) (119) [ARRY] (2) voltage1.vPhasor_internal = {voltage1.v0, voltage1.alpha0} ($RES_SIM_102) (120) [SCAL] (1) $SEV_10 = switch2.switch_b.open and switch2.switch_b.i > 0.0 ($RES_EVT_189) (121) [WHEN] (1)when {$SEV_6, $SEV_7, not switch2.switch_c.open} then (121) [----] switch2.switch_c.arc := edge(switch2.switch_c.open) (121) [----] end when; (122) [ARRY] (2) {switch2.switch_b.v, switch2.switch_b.i} = if $SEV_8 then {switch2.switch_b.epsR * switch2.switch_b.s, switch2.switch_b.s} else {switch2.switch_b.s, switch2.switch_b.epsG * switch2.switch_b.s} ($RES_SIM_64) (123) [WHEN] (1)when {$SEV_9, $SEV_10, not switch2.switch_b.open} then (123) [----] switch2.switch_b.arc := edge(switch2.switch_b.open) (123) [----] end when; (124) [SCAL] (1) system.thetaRef = 314.1592653589793 * time ($RES_SIM_105) (125) [ARRY] (2) {switch2.switch_a.v, switch2.switch_a.i} = if $SEV_11 then {switch2.switch_a.epsR * switch2.switch_a.s, switch2.switch_a.s} else {switch2.switch_a.s, switch2.switch_a.epsG * switch2.switch_a.s} ($RES_SIM_66) (126) [ARRY] (9) fault_ab.Park = $FUN_14 ($RES_BND_157) (127) [WHEN] (1)when {$SEV_12, $SEV_13, not switch2.switch_a.open} then (127) [----] switch2.switch_a.arc := edge(switch2.switch_a.open) (127) [----] end when; (128) [ARRY] (2) line.term_n.theta = line.term_p.theta ($RES_SIM_68) (129) [ARRY] (2) line.term_f.theta = line.term_p.theta ($RES_SIM_69) (130) [SCAL] (1) $SEV_11 = not switch2.switch_a.open or switch2.switch_a.arc ($RES_EVT_190) (131) [SCAL] (1) $SEV_12 = switch2.switch_a.open and switch2.switch_a.i < 0.0 ($RES_EVT_191) (132) [SCAL] (1) $SEV_13 = switch2.switch_a.open and switch2.switch_a.i > 0.0 ($RES_EVT_192) (133) [SCAL] (1) $SEV_14 = not switch1.switch_c.open or switch1.switch_c.arc ($RES_EVT_193) (134) [SCAL] (1) $SEV_15 = switch1.switch_c.open and switch1.switch_c.i < 0.0 ($RES_EVT_194) (135) [SCAL] (1) $SEV_16 = switch1.switch_c.open and switch1.switch_c.i > 0.0 ($RES_EVT_195) (136) [SCAL] (1) $SEV_17 = not switch1.switch_b.open or switch1.switch_b.arc ($RES_EVT_196) (137) [ARRY] (3) (1.0 - line.p) * (line.omega[2] * line.L * {-line.i2[2], line.i2[1], 0.0} + {line.L, line.L, line.L0} * $DER.line.i2 + line.R * line.i2) = line.term_f.v - line.term_n.v ($RES_SIM_70) (138) [SCAL] (1) $SEV_18 = switch1.switch_b.open and switch1.switch_b.i < 0.0 ($RES_EVT_197) (139) [ARRY] (3) line.p * (line.omega[2] * line.L * {-line.i1[2], line.i1[1], 0.0} + {line.L, line.L, line.L0} * $DER.line.i1 + line.R * line.i1) = line.term_p.v - line.term_f.v ($RES_SIM_71) (140) [SCAL] (1) $SEV_19 = switch1.switch_b.open and switch1.switch_b.i > 0.0 ($RES_EVT_198) (141) [ARRY] (3) line.i2 = -line.term_n.i ($RES_SIM_72) (142) [SCAL] (1) $SEV_20 = not switch1.switch_a.open or switch1.switch_a.arc ($RES_EVT_199) (143) [ARRY] (3) line.i1 = line.term_p.i ($RES_SIM_73) (144) [ARRY] (3) line.term_n.i + line.term_p.i + line.term_f.i = {0.0 for $i1 in 1:3} ($RES_SIM_74) (145) [ARRY] (2) line.omega = $DER.line.term_p.theta ($RES_SIM_75) (146) [FOR-] (3) ($RES_SIM_115) (146) [----] for $i1 in 1:3 loop (146) [----] [SCAL] (1) meter.term_n.i[$i1] + fault_ab.term.i[$i1] = 0.0 ($RES_SIM_116) (146) [----] end for; (147) [ARRY] (2) switch1.term_n.theta = switch1.term_p.theta ($RES_SIM_76) (148) [ARRY] (3) switch1.term_p.i + switch1.term_n.i = {0.0 for $i1 in 1:3} ($RES_SIM_77) (149) [ARRY] (3) meter.term_n.v = fault_ab.term.v ($RES_SIM_117) (150) [ARRY] (3) switch1.term_p.i = switch1.i ($RES_SIM_78) (151) [ARRY] (2) meter.term_n.theta = fault_ab.term.theta ($RES_SIM_118) (152) [ARRY] (3) switch1.v = switch1.term_p.v - switch1.term_n.v ($RES_SIM_79) (153) [FOR-] (3) ($RES_SIM_119) (153) [----] for $i1 in 1:3 loop (153) [----] [SCAL] (1) line.term_f.i[$i1] + meter.term_p.i[$i1] = 0.0 ($RES_SIM_120) (153) [----] end for; (154) [SCAL] (1) $SEV_21 = switch1.switch_a.open and switch1.switch_a.i < 0.0 ($RES_EVT_200) (155) [SCAL] (1) $SEV_22 = switch1.switch_a.open and switch1.switch_a.i > 0.0 ($RES_EVT_201)