Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries/ --ompython_omhome=/usr PowerSystems_PowerSystems.Examples.AC3ph.Transmission.FaultRXline.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.Transmission.FaultRXline,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="PowerSystems_PowerSystems.Examples.AC3ph.Transmission.FaultRXline") translateModel(PowerSystems.Examples.AC3ph.Transmission.FaultRXline,tolerance=1e-06,outputFormat="empty",numberOfIntervals=5000,variableFilter="",fileNamePrefix="PowerSystems_PowerSystems.Examples.AC3ph.Transmission.FaultRXline") Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo): time 0.001708/0.001708, allocations: 109 kB / 17.7 MB, free: 5.406 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.001694/0.001694, allocations: 189.2 kB / 18.64 MB, free: 4.477 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.685/1.685, 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.1823/0.1823, allocations: 37.98 MB / 309.9 MB, free: 5.977 MB / 254.1 MB Notification: Performance of FrontEnd - Absyn->SCode: time 2.523e-05/2.532e-05, allocations: 2.281 kB / 376.7 MB, free: 2.98 MB / 318.1 MB Notification: Performance of NFInst.instantiate(PowerSystems.Examples.AC3ph.Transmission.FaultRXline): time 0.1532/0.1533, allocations: 7.423 MB / 384.2 MB, free: 58.33 MB / 318.1 MB Notification: Performance of NFInst.instExpressions: time 0.003674/0.157, allocations: 2.446 MB / 386.6 MB, free: 57.51 MB / 318.1 MB Notification: Performance of NFInst.updateImplicitVariability: time 0.0002992/0.1573, allocations: 25.12 kB / 386.6 MB, free: 57.51 MB / 318.1 MB Notification: Performance of NFTyping.typeComponents: time 0.001729/0.1591, allocations: 0.7589 MB / 387.4 MB, free: 57.33 MB / 318.1 MB Notification: Performance of NFTyping.typeBindings: time 0.001364/0.1605, allocations: 0.6388 MB / 388 MB, free: 57.22 MB / 318.1 MB Notification: Performance of NFTyping.typeClassSections: time 0.001069/0.1616, allocations: 490.9 kB / 388.5 MB, free: 57.18 MB / 318.1 MB Notification: Performance of NFFlatten.flatten: time 0.001835/0.1634, allocations: 1.643 MB / 390.1 MB, free: 56.89 MB / 318.1 MB Notification: Performance of NFFlatten.resolveConnections: time 0.0007659/0.1642, allocations: 0.4956 MB / 390.6 MB, free: 56.74 MB / 318.1 MB Notification: Performance of NFEvalConstants.evaluate: time 0.000923/0.1651, allocations: 0.624 MB / 391.3 MB, free: 56.46 MB / 318.1 MB Notification: Performance of NFSimplifyModel.simplify: time 0.0006966/0.1658, allocations: 0.54 MB / 391.8 MB, free: 56.22 MB / 318.1 MB Notification: Performance of NFPackage.collectConstants: time 0.0001275/0.166, allocations: 79.72 kB / 391.9 MB, free: 56.22 MB / 318.1 MB Notification: Performance of NFFlatten.collectFunctions: time 0.0009032/0.1669, allocations: 0.4971 MB / 392.4 MB, free: 56.11 MB / 318.1 MB Notification: Performance of combineBinaries: time 0.001095/0.168, allocations: 1.436 MB / 393.8 MB, free: 55.2 MB / 318.1 MB Notification: Performance of replaceArrayConstructors: time 0.0004771/0.1685, allocations: 0.9059 MB / 394.7 MB, free: 54.59 MB / 318.1 MB Notification: Performance of NFVerifyModel.verify: time 0.0001744/0.1686, allocations: 133.7 kB / 394.9 MB, free: 54.53 MB / 318.1 MB Notification: Performance of FrontEnd: time 0.0001005/0.1688, allocations: 27.81 kB / 394.9 MB, free: 54.52 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: 297 (148) * Number of variables: 297 (152) Notification: Performance of Bindings: time 0.003099/0.1719, allocations: 3.889 MB / 398.8 MB, free: 51.86 MB / 318.1 MB Notification: Performance of FunctionAlias: time 0.0003496/0.1722, allocations: 279.1 kB / 399 MB, free: 51.7 MB / 318.1 MB Notification: Performance of Early Inline: time 0.002015/0.1742, allocations: 2.409 MB / 401.5 MB, free: 50.25 MB / 318.1 MB Notification: Performance of simplify1: time 0.0001532/0.1744, allocations: 162.2 kB / 401.6 MB, free: 50.12 MB / 318.1 MB Notification: Performance of Alias: time 0.002029/0.1764, allocations: 2.09 MB / 403.7 MB, free: 48.54 MB / 318.1 MB Notification: Performance of simplify2: time 0.0001171/0.1766, allocations: 153.8 kB / 403.8 MB, free: 48.39 MB / 318.1 MB Notification: Performance of Events: time 0.0003716/0.177, allocations: 450 kB / 404.3 MB, free: 47.95 MB / 318.1 MB Notification: Performance of Detect States: time 0.0005595/0.1775, allocations: 0.7979 MB / 405.1 MB, free: 47.13 MB / 318.1 MB Notification: Performance of Partitioning: time 0.0007449/0.1783, allocations: 0.9513 MB / 406 MB, free: 46.12 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_91) Error: Internal error NBAdjacency.Matrix.create failed to create adjacency matrix for system: System Variables (160/320) **************************** (1) [ALGB] (9) protected Real[3, 3] switch1.Park = PowerSystems.Utilities.Transforms.park(switch1.term_p.theta[2]) (2) [ALGB] (3) flow Real[3] switch1.term_p.i (nominal = {1.0 for $i1 in 1:3}) (3) [ALGB] (2) protected Real[2] infBus2.vPhasor_internal (4) [ALGB] (3) flow Real[3] line.term_p.i (nominal = {1.0 for $i1 in 1:3}) (5) [ALGB] (1) protected Real switch2.switch_b.i (6) [DISC] (1) Boolean $SEV_22 (7) [ALGB] (2) protected Real[2] infBus1.vPhasor_internal (8) [DISC] (1) Boolean $SEV_21 (9) [DISC] (1) Boolean $SEV_20 (10) [DISC] (1) Boolean $TEV_5 (11) [DISC] (1) Boolean $TEV_4 (12) [DISC] (1) Boolean $TEV_3 (13) [DISC] (1) Boolean $TEV_2 (14) [ALGB] (3) Real[3] line.term_p.v (nominal = {1000.0 for $i1 in 1:3}) (15) [DISC] (1) Boolean $TEV_1 (16) [DISC] (1) Boolean $TEV_0 (17) [ALGB] (1) Real abc.fault_pp2.v (18) [DISC] (1) protected Boolean switch1.switch_c.open = not (not switch1.switch_c.open) (start = true) (19) [ALGB] (1) protected Real abc.fault_pp2.s (start = 0.5) (20) [ALGB] (3) Real[3] switch1.v_abc (nominal = {1000.0 for $i1 in 1:3}, StateSelect = never) (21) [ALGB] (1) Real abc.fault_pp2.i (22) [DISC] (1) Boolean $SEV_19 (23) [DISC] (1) Boolean $SEV_18 (24) [DISC] (1) Boolean $SEV_17 (25) [ALGB] (3) Real[3] switch2.i_abc (nominal = {1.0 for $i1 in 1:3}, StateSelect = never) (26) [DISC] (1) Boolean $SEV_16 (27) [DISC] (1) Boolean $SEV_15 (28) [DISC] (1) protected Boolean abc.v_pos (fixed = true, start = true) (29) [ALGB] (4) protected Real[2, 2] meter.Rot_dq (30) [DISC] (1) final Boolean abc.fault_pp1.on = abc.fault_pp1.on (fixed = true, start = false) (31) [DISC] (1) Boolean $SEV_14 (32) [DISC] (1) Boolean $SEV_13 (33) [DISC] (1) Boolean $SEV_12 (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 infBus2.phi (38) [ALGB] (2) Real[2] line.term_n.theta (39) [ALGB] (1) protected Real switch2.switch_a.v (40) [ALGB] (1) protected Real switch2.switch_a.s (start = 0.5) (41) [DISC] (3) Boolean[3] switch2.control (42) [ALGB] (2) Real[2] switch2.term_n.theta (43) [ALGB] (2) Real[2] switch1.term_n.theta (44) [ALGB] (2) Real[2] meter.term_n.theta (45) [ALGB] (1) protected Real switch2.switch_a.i (46) [ALGB] (1) Real meter.alpha_i (StateSelect = never) (47) [DER-] (2) Real[2] $DER.line.term_p.theta (48) [ALGB] (3) Real[3] meter.v (StateSelect = never) (49) [DISC] (1) protected Integer relay1.cnt (fixed = true, start = 1) (50) [ALGB] (3) flow Real[3] meter.term_n.i (nominal = {1.0 for $i1 in 1:3}) (51) [ALGB] (2) Real[2] infBus2.term.theta (52) [ALGB] (1) Real abc.fault_pp1.v (53) [ALGB] (3) Real[3] meter.p (StateSelect = never) (54) [ALGB] (1) protected Real abc.fault_pp1.s (start = 0.5) (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] (3) flow Real[3] infBus2.term.i (nominal = {1.0 for $i1 in 1:3}) (62) [ALGB] (1) Real $FUN_2 (63) [ALGB] (3) Real[3] meter.i (StateSelect = never) (64) [ALGB] (1) Real $FUN_1 (65) [ALGB] (3) Real[3] meter.term_n.v (nominal = {1000.0 for $i1 in 1:3}) (66) [ALGB] (1) Real abc.fault_pp1.i (67) [DISC] (3) Boolean[3] switch1.control (68) [DISS] (1) protected discrete Real abc.theta_zero (fixed = true, start = 1e60) (69) [ALGB] (3) flow Real[3] switch2.term_p.i (nominal = {1.0 for $i1 in 1:3}) (70) [ALGB] (3) Real[3] infBus2.term.v (nominal = {1000.0 for $i1 in 1:3}) (71) [DISC] (1) protected Boolean switch2.switch_c.open = not (not switch2.switch_c.open) (start = true) (72) [DISC] (3) Boolean[3] relay1.y (fixed = {true for $i1 in 1:3}, start = {relay1.ini_state for $i1 in 1:3}) (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] abc.v_abc (start = abc.v_abc_start, nominal = {1000.0 for $i1 in 1:3}, StateSelect = never) (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] (1) protected Real switch1.switch_c.i (80) [ALGB] (9) Real[3, 3] $FUN_14 (81) [ALGB] (9) Real[3, 3] $FUN_13 (82) [ALGB] (9) Real[3, 3] $FUN_12 (83) [ALGB] (1) Real $FUN_11 (84) [DISS] (1) protected Boolean switch1.switch_a.arc (fixed = true, start = false) (85) [DISS] (1) protected Boolean abc.first (fixed = true, start = true) (86) [DISS] (1) protected Boolean switch2.switch_a.arc (fixed = true, start = false) (87) [ALGB] (4) Real[2, 2] $FUN_10 (88) [ALGB] (3) flow Real[3] switch1.term_n.i (nominal = {1.0 for $i1 in 1:3}) (89) [ALGB] (1) flow Real infBus1.neutral.i (90) [DISC] (1) Boolean $SEV_9 (91) [DISC] (1) Boolean $SEV_8 (92) [DISC] (1) Boolean $SEV_7 (93) [DISC] (1) Boolean $SEV_6 (94) [DISC] (1) Boolean $SEV_5 (95) [DISC] (1) Boolean $SEV_4 (96) [DISC] (1) Boolean $SEV_3 (97) [ALGB] (3) flow Real[3] line.term_n.i (nominal = {1.0 for $i1 in 1:3}) (98) [DISC] (1) Boolean $SEV_2 (99) [ALGB] (1) protected Real infBus2.alpha (100) [ALGB] (1) flow Real infBus2.neutral.i (101) [ALGB] (3) Real[3] line.term_n.v (nominal = {1000.0 for $i1 in 1:3}) (102) [DISC] (1) protected Boolean switch2.switch_b.open = not (not switch2.switch_b.open) (start = true) (103) [ALGB] (2) Real[2] infBus1.term.theta (104) [ALGB] (3) Real[3] switch2.v (nominal = {1000.0 for $i1 in 1:3}) (105) [ALGB] (2) Real[2] switch1.term_p.theta (106) [ALGB] (2) Real[2] switch2.term_p.theta (107) [ALGB] (2) Real[2] meter.term_p.theta (108) [ALGB] (3) flow Real[3] line.term_f.i (nominal = {1.0 for $i1 in 1:3}) (109) [ALGB] (1) Real meter.v_norm (StateSelect = never) (110) [ALGB] (2) Real[2] abc.term.theta (111) [ALGB] (1) protected Real switch1.switch_b.v (112) [ALGB] (3) Real[3] abc.i_abc (nominal = {1.0 for $i1 in 1:3}, StateSelect = never) (113) [ALGB] (1) Real system.thetaRef = system.thetaRef (114) [ALGB] (1) protected Real switch1.switch_b.s (start = 0.5) (115) [ALGB] (3) Real[3] switch2.i (nominal = {1.0 for $i1 in 1:3}) (116) [DISC] (1) protected Boolean switch1.switch_a.open = not (not switch1.switch_a.open) (start = true) (117) [ALGB] (3) Real[3] abc.term.v (nominal = {1000.0 for $i1 in 1:3}) (118) [ALGB] (2) Real[2] meter.vpp (StateSelect = never) (119) [ALGB] (1) Real system.thetaRel = system.thetaRef - system.thetaRef (120) [ALGB] (3) Real[3] line.term_f.v (nominal = {1000.0 for $i1 in 1:3}) (121) [ALGB] (1) protected Real infBus2.V (nominal = 1000.0) (122) [ALGB] (1) Real meter.cos_phi (StateSelect = never) (123) [ALGB] (1) protected Real switch1.switch_b.i (124) [ALGB] (1) protected Real infBus1.phi (125) [ALGB] (3) flow Real[3] abc.term.i (nominal = {1.0 for $i1 in 1:3}) (126) [ALGB] (1) protected Real switch2.switch_c.v (127) [ALGB] (1) protected Real switch2.switch_c.s (start = 0.5) (128) [DISS] (1) Real abc.fault_pp1.t0 (fixed = true, start = -1e60) (129) [ALGB] (1) protected Real infBus1.alpha (130) [ALGB] (9) protected Real[3, 3] abc.Park = PowerSystems.Utilities.Transforms.park(abc.term.theta[2]) (131) [ALGB] (2) Real[2] line.term_f.theta (132) [ALGB] (3) flow Real[3] meter.term_p.i (nominal = {1.0 for $i1 in 1:3}) (133) [ALGB] (1) protected Real switch2.switch_c.i (134) [ALGB] (3) Real[3] abc.v (nominal = {1000.0 for $i1 in 1:3}) (135) [ALGB] (9) protected Real[3, 3] switch2.Park = PowerSystems.Utilities.Transforms.park(switch2.term_p.theta[2]) (136) [DISC] (1) protected Boolean switch2.switch_a.open = not (not switch2.switch_a.open) (start = true) (137) [ALGB] (3) Real[3] switch2.term_n.v (nominal = {1000.0 for $i1 in 1:3}) (138) [DISC] (1) protected Integer relay2.cnt (fixed = true, start = 1) (139) [ALGB] (3) Real[3] meter.term_p.v (nominal = {1000.0 for $i1 in 1:3}) (140) [ALGB] (3) Real[3] abc.i (nominal = {1.0 for $i1 in 1:3}) (141) [ALGB] (3) flow Real[3] switch2.term_n.i (nominal = {1.0 for $i1 in 1:3}) (142) [ALGB] (3) Real[3] switch1.v (nominal = {1000.0 for $i1 in 1:3}) (143) [DISC] (1) protected Boolean switch1.switch_b.open = not (not switch1.switch_b.open) (start = true) (144) [ALGB] (1) protected Real switch1.switch_a.v (145) [ALGB] (1) protected Real switch1.switch_a.s (start = 0.5) (146) [ALGB] (2) protected Real[2] line.omega (147) [ALGB] (3) Real[3] switch1.i (nominal = {1.0 for $i1 in 1:3}) (148) [ALGB] (3) flow Real[3] infBus1.term.i (nominal = {1.0 for $i1 in 1:3}) (149) [DISS] (1) Real abc.fault_pp2.t0 (fixed = true, start = -1e60) (150) [ALGB] (3) Real[3] switch2.v_abc (nominal = {1000.0 for $i1 in 1:3}, StateSelect = never) (151) [DER-] (3) Real[3] $DER.line.i1 (152) [DER-] (3) Real[3] $DER.line.i2 (153) [ALGB] (1) protected Real infBus1.V (nominal = 1000.0) (154) [ALGB] (1) protected Real switch1.switch_a.i (155) [ALGB] (3) Real[3] infBus1.term.v (nominal = {1000.0 for $i1 in 1:3}) (156) [DISS] (1) protected Boolean switch1.switch_b.arc (fixed = true, start = false) (157) [ALGB] (3) Real[3] switch1.term_p.v (nominal = {1000.0 for $i1 in 1:3}) (158) [DISS] (1) protected Boolean switch2.switch_b.arc (fixed = true, start = false) (159) [ALGB] (1) protected Real switch2.switch_b.v (160) [ALGB] (1) protected Real switch2.switch_b.s (start = 0.5) System Equations (156/320) **************************** (1) [ARRY] (3) switch1.term_p.i + switch1.term_n.i = {0.0 for $i1 in 1:3} ($RES_SIM_80) (2) [ARRY] (2) line.term_f.theta = abc.term.theta ($RES_SIM_120) (3) [ARRY] (3) switch1.term_p.i = switch1.i ($RES_SIM_81) (4) [FOR-] (3) ($RES_SIM_121) (4) [----] for $i1 in 1:3 loop (4) [----] [SCAL] (1) switch2.term_n.i[$i1] + infBus2.term.i[$i1] = 0.0 ($RES_SIM_122) (4) [----] end for; (5) [ARRY] (3) switch1.v = switch1.term_p.v - switch1.term_n.v ($RES_SIM_82) (6) [ARRY] (3) switch1.i_abc = transpose(switch1.Park) * switch1.i ($RES_SIM_83) (7) [ARRY] (3) switch2.term_n.v = infBus2.term.v ($RES_SIM_123) (8) [ARRY] (3) switch1.v = switch1.Park * switch1.v_abc ($RES_SIM_84) (9) [ARRY] (2) switch2.term_n.theta = infBus2.term.theta ($RES_SIM_124) (10) [SCAL] (1) switch1.switch_c.i = switch1.i_abc[3] ($RES_SIM_85) (11) [FOR-] (3) ($RES_SIM_125) (11) [----] for $i1 in 1:3 loop (11) [----] [SCAL] (1) line.term_n.i[$i1] + switch2.term_p.i[$i1] = 0.0 ($RES_SIM_126) (11) [----] end for; (12) [SCAL] (1) switch1.switch_c.v = switch1.v_abc[3] ($RES_SIM_86) (13) [SCAL] (1) switch1.switch_b.i = switch1.i_abc[2] ($RES_SIM_87) (14) [ARRY] (3) line.term_n.v = switch2.term_p.v ($RES_SIM_127) (15) [SCAL] (1) switch1.switch_b.v = switch1.v_abc[2] ($RES_SIM_88) (16) [ARRY] (2) line.term_n.theta = switch2.term_p.theta ($RES_SIM_128) (17) [SCAL] (1) switch1.switch_a.i = switch1.i_abc[1] ($RES_SIM_89) (18) [FOR-] (3) ($RES_SIM_129) (18) [----] for $i1 in 1:3 loop (18) [----] [SCAL] (1) switch1.term_n.i[$i1] + line.term_p.i[$i1] = 0.0 ($RES_SIM_130) (18) [----] end for; (19) [SCAL] (1) abc.fault_pp1.on = $SEV_2 ($RES_SIM_12) (20) [WHEN] (1)when $SEV_3 then (20) [----] abc.first := false (20) [----] end when; (21) [WHEN] (1)when $SEV_3 then (21) [----] abc.theta_zero := sum(abc.term.theta) (21) [----] end when; (22) [ARRY] (3) abc.i_abc = transpose(abc.Park) * abc.i ($RES_SIM_15) (23) [ARRY] (3) abc.v = abc.Park * abc.v_abc ($RES_SIM_16) (24) [SCAL] (1) switch1.switch_a.v = switch1.v_abc[1] ($RES_SIM_90) (25) [ARRY] (3) abc.term.i = abc.i ($RES_SIM_17) (26) [ARRY] (3) switch1.term_n.v = line.term_p.v ($RES_SIM_131) (27) [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_91) (28) [ARRY] (3) abc.v = abc.term.v ($RES_SIM_18) (29) [WHEN] (1)when {$SEV_15, $SEV_16, not switch1.switch_c.open} then (29) [----] switch1.switch_c.arc := edge(switch1.switch_c.open) (29) [----] end when; (30) [SCAL] (1) abc.i[3] = abc.epsG * abc.v[3] ($RES_SIM_19) (31) [ARRY] (2) switch1.term_n.theta = line.term_p.theta ($RES_SIM_132) (32) [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_93) (33) [FOR-] (3) ($RES_SIM_133) (33) [----] for $i1 in 1:3 loop (33) [----] [SCAL] (1) meter.term_n.i[$i1] + switch1.term_p.i[$i1] = 0.0 ($RES_SIM_134) (33) [----] end for; (34) [WHEN] (1)when {$SEV_18, $SEV_19, not switch1.switch_b.open} then (34) [----] switch1.switch_b.arc := edge(switch1.switch_b.open) (34) [----] end when; (35) [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_95) (36) [ARRY] (3) meter.term_n.v = switch1.term_p.v ($RES_SIM_135) (37) [WHEN] (1)when {$SEV_21, $SEV_22, not switch1.switch_a.open} then (37) [----] switch1.switch_a.arc := edge(switch1.switch_a.open) (37) [----] end when; (38) [ARRY] (2) meter.term_n.theta = switch1.term_p.theta ($RES_SIM_136) (39) [SCAL] (1) 1.7320508075688772 * infBus1.term.i[3] + infBus1.neutral.i = 0.0 ($RES_SIM_97) (40) [FOR-] (3) ($RES_SIM_137) (40) [----] for $i1 in 1:3 loop (40) [----] [SCAL] (1) infBus1.term.i[$i1] + meter.term_p.i[$i1] = 0.0 ($RES_SIM_138) (40) [----] end for; (41) [ARRY] (2) infBus1.term.theta = {system.thetaRel, system.thetaRef} ($RES_SIM_98) (42) [ARRY] (3) infBus1.term.v = meter.term_p.v ($RES_SIM_139) (43) [SCAL] (1) abc.v_pos = $SEV_4 ($RES_SIM_20) (44) [SCAL] (1) abc.fault_pp2.i = abc.i_abc[3] ($RES_SIM_21) (45) [SCAL] (1) abc.fault_pp2.v = abc.v_abc[3] - abc.v_abc[1] ($RES_SIM_22) (46) [SCAL] (1) abc.fault_pp1.i = abc.i_abc[2] ($RES_SIM_23) (47) [SCAL] (1) abc.fault_pp1.v = abc.v_abc[2] - abc.v_abc[1] ($RES_SIM_24) (48) [ARRY] (2) {abc.fault_pp2.v, abc.fault_pp2.i} = if abc.fault_pp1.on then {abc.fault_pp2.epsR * abc.fault_pp2.s, abc.fault_pp2.s} else {abc.fault_pp2.s, abc.fault_pp2.epsG * abc.fault_pp2.s} ($RES_SIM_25) (49) [WHEN] (1)when edge(abc.fault_pp1.on) then (49) [----] abc.fault_pp2.t0 := time (49) [----] end when; (50) [ARRY] (2) infBus1.term.theta = meter.term_p.theta ($RES_SIM_140) (51) [ARRY] (2) {abc.fault_pp1.v, abc.fault_pp1.i} = if abc.fault_pp1.on then {abc.fault_pp1.epsR * abc.fault_pp1.s, abc.fault_pp1.s} else {abc.fault_pp1.s, abc.fault_pp1.epsG * abc.fault_pp1.s} ($RES_SIM_28) (52) [ARRY] (3) relay2.y = switch2.control ($RES_SIM_141) (53) [ARRY] (3) relay1.y = switch1.control ($RES_SIM_142) (54) [SCAL] (1) switch2.control[3] = not switch2.switch_c.open ($RES_SIM_143) (55) [SCAL] (1) switch2.control[2] = not switch2.switch_b.open ($RES_SIM_144) (56) [SCAL] (1) switch2.control[1] = not switch2.switch_a.open ($RES_SIM_145) (57) [SCAL] (1) switch1.control[3] = not switch1.switch_c.open ($RES_SIM_146) (58) [SCAL] (1) switch1.control[2] = not switch1.switch_b.open ($RES_SIM_147) (59) [SCAL] (1) switch1.control[1] = not switch1.switch_a.open ($RES_SIM_148) (60) [WHEN] (1)when edge(abc.fault_pp1.on) then (60) [----] abc.fault_pp1.t0 := time (60) [----] end when; (61) [ARRY] (2) meter.term_n.theta = meter.term_p.theta ($RES_SIM_31) (62) [ARRY] (3) meter.term_p.i + meter.term_n.i = {0.0 for $i1 in 1:3} ($RES_SIM_32) (63) [ARRY] (3) meter.term_p.v = meter.term_n.v ($RES_SIM_33) (64) [ARRY] (4) meter.Rot_dq = $FUN_10 ($RES_SIM_34) (65) [SCAL] (1) $FUN_1 = cos(infBus1.phi) ($RES_$AUX_175) (66) [SCAL] (1) $FUN_2 = sin(infBus1.phi) ($RES_$AUX_174) (67) [SCAL] (1) $FUN_3 = cos(infBus2.phi) ($RES_$AUX_173) (68) [SCAL] (1) $FUN_4 = sin(infBus2.phi) ($RES_$AUX_172) (69) [SCAL] (1) meter.v_norm = sqrt(meter.v * meter.v) ($RES_$AUX_171) (70) [SCAL] (1) meter.alpha_v = atan2(meter.Rot_dq[:, 2] * meter.v[1:2], meter.Rot_dq[:, 1] * meter.v[1:2]) ($RES_$AUX_170) (71) [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_42) (72) [ARRY] (3) meter.i = meter.term_p.i / meter.I_base ($RES_SIM_43) (73) [ARRY] (2) meter.vpp = 1.7320508075688772 * {meter.v[2], -meter.v[1]} ($RES_SIM_44) (74) [SCAL] (1) meter.i_norm = sqrt(meter.i * meter.i) ($RES_$AUX_169) (75) [ARRY] (3) meter.v = meter.term_p.v / meter.V_base ($RES_SIM_45) (76) [SCAL] (1) meter.alpha_i = atan2(meter.Rot_dq[:, 2] * meter.i[1:2], meter.Rot_dq[:, 1] * meter.i[1:2]) ($RES_$AUX_168) (77) [SCAL] (1) 1.7320508075688772 * infBus2.term.i[3] + infBus2.neutral.i = 0.0 ($RES_SIM_46) (78) [SCAL] (1) meter.cos_phi = cos(meter.alpha_v - meter.alpha_i) ($RES_$AUX_167) (79) [ARRY] (4) $FUN_10 = PowerSystems.Examples.AC3ph.Transmission.FaultRXline.meter.rot_dq(meter.term_p.theta[1]) ($RES_$AUX_166) (80) [ARRY] (3) infBus2.term.v = {$FUN_3 * infBus2.V, $FUN_4 * infBus2.V, 0.0} ($RES_SIM_48) (81) [SCAL] (1) $FUN_11 = sum(abc.term.theta) ($RES_$AUX_165) (82) [SCAL] (1) infBus2.phi = infBus2.term.theta[1] + infBus2.alpha ($RES_SIM_49) (83) [ARRY] (9) $FUN_12 = PowerSystems.Utilities.Transforms.park(abc.term.theta[2]) ($RES_$AUX_164) (84) [ARRY] (9) $FUN_13 = PowerSystems.Utilities.Transforms.park(switch2.term_p.theta[2]) ($RES_$AUX_163) (85) [ARRY] (9) $FUN_14 = PowerSystems.Utilities.Transforms.park(switch1.term_p.theta[2]) ($RES_$AUX_162) (86) [SCAL] (1) $TEV_0 = $PRE.switch2.switch_c.open ($RES_EVT_176) (87) [SCAL] (1) infBus2.alpha = infBus2.vPhasor_internal[2] ($RES_SIM_50) (88) [SCAL] (1) $TEV_1 = $PRE.switch2.switch_b.open ($RES_EVT_177) (89) [SCAL] (1) infBus2.V = infBus2.vPhasor_internal[1] * infBus2.V_base ($RES_SIM_51) (90) [SCAL] (1) $TEV_2 = $PRE.switch2.switch_a.open ($RES_EVT_178) (91) [ARRY] (2) infBus2.vPhasor_internal = {infBus2.v0, infBus2.alpha0} ($RES_SIM_52) (92) [SCAL] (1) $TEV_3 = $PRE.switch1.switch_c.open ($RES_EVT_179) (93) [ARRY] (2) switch2.term_n.theta = switch2.term_p.theta ($RES_SIM_53) (94) [ALGO] (4) ($RES_SIM_9) (94) [----] when time > relay1.t_switch[relay1.cnt] then (94) [----] relay1.cnt := min(relay1.cnt + 1, 2); (94) [----] for k in relay1.switched loop (94) [----] relay1.y[k] := not relay1.y[k]; (94) [----] end for; (94) [----] end when; (95) [ARRY] (3) switch2.term_p.i + switch2.term_n.i = {0.0 for $i1 in 1:3} ($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, 2); (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.term_p.i = switch2.i ($RES_SIM_55) (98) [ARRY] (3) switch2.v = switch2.term_p.v - switch2.term_n.v ($RES_SIM_56) (99) [ARRY] (3) switch2.i_abc = transpose(switch2.Park) * switch2.i ($RES_SIM_57) (100) [ARRY] (3) switch2.v = switch2.Park * switch2.v_abc ($RES_SIM_58) (101) [SCAL] (1) system.thetaRel = system.thetaRef - system.thetaRef ($RES_BND_149) (102) [SCAL] (1) switch2.switch_c.i = switch2.i_abc[3] ($RES_SIM_59) (103) [SCAL] (1) $TEV_4 = $PRE.switch1.switch_b.open ($RES_EVT_180) (104) [SCAL] (1) $TEV_5 = $PRE.switch1.switch_a.open ($RES_EVT_181) (105) [SCAL] (1) $SEV_2 = $FUN_11 > ($PRE.abc.theta_zero + abc.phi_on) ($RES_EVT_182) (106) [SCAL] (1) $SEV_3 = (time > abc.t_on and edge(abc.v_pos)) and $PRE.abc.first ($RES_EVT_183) (107) [SCAL] (1) $SEV_4 = abc.v_abc[1] > 0.0 ($RES_EVT_184) (108) [SCAL] (1) $SEV_5 = not switch2.switch_c.open or switch2.switch_c.arc ($RES_EVT_185) (109) [SCAL] (1) $SEV_6 = switch2.switch_c.open and switch2.switch_c.i < 0.0 ($RES_EVT_186) (110) [SCAL] (1) switch2.switch_c.v = switch2.v_abc[3] ($RES_SIM_60) (111) [ARRY] (9) switch1.Park = $FUN_14 ($RES_BND_151) (112) [ARRY] (3) infBus1.term.v = {$FUN_1 * infBus1.V, $FUN_2 * infBus1.V, 0.0} ($RES_SIM_100) (113) [SCAL] (1) $SEV_7 = switch2.switch_c.open and switch2.switch_c.i > 0.0 ($RES_EVT_187) (114) [SCAL] (1) switch2.switch_b.i = switch2.i_abc[2] ($RES_SIM_61) (115) [SCAL] (1) infBus1.phi = infBus1.term.theta[1] + infBus1.alpha ($RES_SIM_101) (116) [SCAL] (1) $SEV_8 = not switch2.switch_b.open or switch2.switch_b.arc ($RES_EVT_188) (117) [SCAL] (1) switch2.switch_b.v = switch2.v_abc[2] ($RES_SIM_62) (118) [SCAL] (1) infBus1.alpha = infBus1.vPhasor_internal[2] ($RES_SIM_102) (119) [SCAL] (1) $SEV_9 = switch2.switch_b.open and switch2.switch_b.i < 0.0 ($RES_EVT_189) (120) [SCAL] (1) switch2.switch_a.i = switch2.i_abc[1] ($RES_SIM_63) (121) [SCAL] (1) infBus1.V = infBus1.vPhasor_internal[1] * infBus1.V_base ($RES_SIM_103) (122) [SCAL] (1) switch2.switch_a.v = switch2.v_abc[1] ($RES_SIM_64) (123) [ARRY] (9) switch2.Park = $FUN_13 ($RES_BND_155) (124) [ARRY] (2) infBus1.vPhasor_internal = {infBus1.v0, infBus1.alpha0} ($RES_SIM_104) (125) [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_65) (126) [WHEN] (1)when {$SEV_6, $SEV_7, not switch2.switch_c.open} then (126) [----] switch2.switch_c.arc := edge(switch2.switch_c.open) (126) [----] end when; (127) [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_67) (128) [SCAL] (1) system.thetaRef = 314.1592653589793 * time ($RES_SIM_107) (129) [WHEN] (1)when {$SEV_9, $SEV_10, not switch2.switch_b.open} then (129) [----] switch2.switch_b.arc := edge(switch2.switch_b.open) (129) [----] end when; (130) [ARRY] (9) abc.Park = $FUN_12 ($RES_BND_159) (131) [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_69) (132) [SCAL] (1) $SEV_10 = switch2.switch_b.open and switch2.switch_b.i > 0.0 ($RES_EVT_190) (133) [SCAL] (1) $SEV_11 = not switch2.switch_a.open or switch2.switch_a.arc ($RES_EVT_191) (134) [SCAL] (1) $SEV_12 = switch2.switch_a.open and switch2.switch_a.i < 0.0 ($RES_EVT_192) (135) [SCAL] (1) $SEV_13 = switch2.switch_a.open and switch2.switch_a.i > 0.0 ($RES_EVT_193) (136) [SCAL] (1) $SEV_14 = not switch1.switch_c.open or switch1.switch_c.arc ($RES_EVT_194) (137) [SCAL] (1) $SEV_15 = switch1.switch_c.open and switch1.switch_c.i < 0.0 ($RES_EVT_195) (138) [SCAL] (1) $SEV_16 = switch1.switch_c.open and switch1.switch_c.i > 0.0 ($RES_EVT_196) (139) [WHEN] (1)when {$SEV_12, $SEV_13, not switch2.switch_a.open} then (139) [----] switch2.switch_a.arc := edge(switch2.switch_a.open) (139) [----] end when; (140) [SCAL] (1) $SEV_17 = not switch1.switch_b.open or switch1.switch_b.arc ($RES_EVT_197) (141) [ARRY] (2) line.term_n.theta = line.term_p.theta ($RES_SIM_71) (142) [SCAL] (1) $SEV_18 = switch1.switch_b.open and switch1.switch_b.i < 0.0 ($RES_EVT_198) (143) [ARRY] (2) line.term_f.theta = line.term_p.theta ($RES_SIM_72) (144) [SCAL] (1) $SEV_19 = switch1.switch_b.open and switch1.switch_b.i > 0.0 ($RES_EVT_199) (145) [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_73) (146) [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_74) (147) [ARRY] (3) line.i2 = -line.term_n.i ($RES_SIM_75) (148) [ARRY] (3) line.i1 = line.term_p.i ($RES_SIM_76) (149) [ARRY] (3) line.term_n.i + line.term_p.i + line.term_f.i = {0.0 for $i1 in 1:3} ($RES_SIM_77) (150) [FOR-] (3) ($RES_SIM_117) (150) [----] for $i1 in 1:3 loop (150) [----] [SCAL] (1) line.term_f.i[$i1] + abc.term.i[$i1] = 0.0 ($RES_SIM_118) (150) [----] end for; (151) [ARRY] (2) line.omega = $DER.line.term_p.theta ($RES_SIM_78) (152) [ARRY] (2) switch1.term_n.theta = switch1.term_p.theta ($RES_SIM_79) (153) [ARRY] (3) line.term_f.v = abc.term.v ($RES_SIM_119) (154) [SCAL] (1) $SEV_20 = not switch1.switch_a.open or switch1.switch_a.arc ($RES_EVT_200) (155) [SCAL] (1) $SEV_21 = switch1.switch_a.open and switch1.switch_a.i < 0.0 ($RES_EVT_201) (156) [SCAL] (1) $SEV_22 = switch1.switch_a.open and switch1.switch_a.i > 0.0 ($RES_EVT_202)