Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries/ --ompython_omhome=/usr PowerSystems_latest_PowerSystems.Examples.AC3ph.Transmission.RXline.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 4.0.0+maint.om/package.mo", uses=false) loadFile("/home/hudson/saved_omc/libraries/.openmodelica/libraries/PowerSystems 2.0.0-master/package.mo", uses=false) Using package PowerSystems with version 2.0.0 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/PowerSystems 2.0.0-master/package.mo) Using package Modelica with version 4.0.0 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 4.0.0+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.RXline,tolerance=1e-06,outputFormat="mat",numberOfIntervals=5000,variableFilter="Time|meter.i.1.|meter.i.2.|meter.i.3.|meter.p.1.|meter.p.2.|meter.p.3.|meter.v.1.|meter.v.2.|meter.v.3.",fileNamePrefix="PowerSystems_latest_PowerSystems.Examples.AC3ph.Transmission.RXline") translateModel(PowerSystems.Examples.AC3ph.Transmission.RXline,tolerance=1e-06,outputFormat="mat",numberOfIntervals=5000,variableFilter="Time|meter.i.1.|meter.i.2.|meter.i.3.|meter.p.1.|meter.p.2.|meter.p.3.|meter.v.1.|meter.v.2.|meter.v.3.",fileNamePrefix="PowerSystems_latest_PowerSystems.Examples.AC3ph.Transmission.RXline") Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo): time 0.001264/0.001264, allocations: 109.5 kB / 17.7 MB, free: 5.379 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.001366/0.001366, allocations: 192.7 kB / 18.64 MB, free: 4.449 MB / 14.72 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 4.0.0+maint.om/package.mo): time 1.253/1.253, allocations: 222.9 MB / 242.3 MB, free: 15.14 MB / 206.1 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/PowerSystems 2.0.0-master/package.mo): time 0.1623/0.1623, allocations: 38.03 MB / 330.5 MB, free: 8.777 MB / 270.1 MB Notification: Performance of FrontEnd - Absyn->SCode: time 2e-05/2.017e-05, allocations: 2.281 kB / 400.2 MB, free: 33.42 MB / 302.1 MB Notification: Performance of NFInst.instantiate(PowerSystems.Examples.AC3ph.Transmission.RXline): time 0.00824/0.008277, allocations: 6.579 MB / 406.8 MB, free: 26.83 MB / 302.1 MB Notification: Performance of NFInst.instExpressions: time 0.004225/0.01253, allocations: 2.109 MB / 408.9 MB, free: 24.73 MB / 302.1 MB Notification: Performance of NFInst.updateImplicitVariability: time 0.0004941/0.01305, allocations: 15.94 kB / 408.9 MB, free: 24.71 MB / 302.1 MB Notification: Performance of NFTyping.typeComponents: time 0.001784/0.01485, allocations: 0.6471 MB / 409.6 MB, free: 24.06 MB / 302.1 MB Notification: Performance of NFTyping.typeBindings: time 0.001689/0.0166, allocations: 0.5428 MB / 410.1 MB, free: 23.52 MB / 302.1 MB Notification: Performance of NFTyping.typeClassSections: time 0.001139/0.01776, allocations: 374.1 kB / 410.5 MB, free: 23.16 MB / 302.1 MB Notification: Performance of NFFlatten.flatten: time 0.00136/0.01914, allocations: 1.333 MB / 411.8 MB, free: 21.82 MB / 302.1 MB Notification: Performance of NFFlatten.resolveConnections: time 0.0006314/0.01978, allocations: 411.4 kB / 412.2 MB, free: 21.41 MB / 302.1 MB Notification: Performance of NFEvalConstants.evaluate: time 0.0006086/0.02041, allocations: 0.4903 MB / 412.7 MB, free: 20.92 MB / 302.1 MB Notification: Performance of NFSimplifyModel.simplify: time 0.0005933/0.02102, allocations: 458.2 kB / 413.1 MB, free: 20.47 MB / 302.1 MB Notification: Performance of NFPackage.collectConstants: time 9.864e-05/0.02113, allocations: 64 kB / 413.2 MB, free: 20.41 MB / 302.1 MB Notification: Performance of NFFlatten.collectFunctions: time 0.0008369/0.02198, allocations: 495.3 kB / 413.7 MB, free: 19.93 MB / 302.1 MB Notification: Performance of combineBinaries: time 0.000825/0.02282, allocations: 1.168 MB / 414.9 MB, free: 18.75 MB / 302.1 MB Notification: Performance of replaceArrayConstructors: time 0.0004335/0.02327, allocations: 0.7404 MB / 415.6 MB, free: 18 MB / 302.1 MB Notification: Performance of NFVerifyModel.verify: time 0.0001382/0.02342, allocations: 111.6 kB / 415.7 MB, free: 17.89 MB / 302.1 MB Notification: Performance of FrontEnd: time 7.758e-05/0.02351, allocations: 19.94 kB / 415.7 MB, free: 17.87 MB / 302.1 MB Notification: Model statistics after passing the front-end and creating the data structures used by the back-end: * Number of equations: 242 (121) * Number of variables: 242 (125) Notification: Performance of Bindings: time 0.002932/0.02645, allocations: 3.117 MB / 418.8 MB, free: 14.62 MB / 302.1 MB Notification: Performance of FunctionAlias: time 0.0003155/0.02678, allocations: 239.7 kB / 419.1 MB, free: 14.38 MB / 302.1 MB Notification: Performance of Early Inline: time 0.002041/0.02884, allocations: 1.939 MB / 421 MB, free: 12.4 MB / 302.1 MB Notification: Performance of simplify1: time 0.0001501/0.029, allocations: 131.8 kB / 421.1 MB, free: 12.27 MB / 302.1 MB Notification: Performance of Alias: time 0.001992/0.03101, allocations: 1.799 MB / 422.9 MB, free: 10.27 MB / 302.1 MB Notification: Performance of simplify2: time 8.182e-05/0.0311, allocations: 119.8 kB / 423.1 MB, free: 10.15 MB / 302.1 MB Notification: Performance of Events: time 0.0002669/0.03138, allocations: 309.8 kB / 423.4 MB, free: 9.836 MB / 302.1 MB Notification: Performance of Detect States: time 0.0004609/0.03185, allocations: 0.652 MB / 424 MB, free: 9.164 MB / 302.1 MB Notification: Performance of Partitioning: time 0.0005911/0.03245, allocations: 0.7527 MB / 424.8 MB, free: 8.379 MB / 302.1 MB Error: Internal error NBSlice.fillDependencyArray failed because number of flattened indices 1 for dependency line.omega[2] could not be devided by the body size 3 without rest. Error: Internal error NBAdjacency.Matrix.createPseudo failed for: [ARRY] (3) line.omega[2] * line.L * {-line.i[2], line.i[1], 0.0} + {line.L, line.L, line.L0} * $DER.line.i + line.R * line.i = line.v ($RES_SIM_53) Error: Internal error NBAdjacency.Matrix.create failed to create adjacency matrix for system: System Variables (132/258) **************************** (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) [ALGB] (2) protected Real[2] infBus1.vPhasor_internal (7) [DISC] (1) Boolean $TEV_5 (8) [DISC] (1) Boolean $TEV_4 (9) [DISC] (1) Boolean $TEV_3 (10) [DISC] (1) Boolean $TEV_2 (11) [ALGB] (3) Real[3] line.term_p.v (nominal = {1000.0 for $i1 in 1:3}) (12) [DISC] (1) Boolean $TEV_1 (13) [DISC] (1) Boolean $TEV_0 (14) [DISC] (1) protected Boolean switch1.switch_c.open = not (not switch1.switch_c.open) (start = true) (15) [ALGB] (3) Real[3] switch1.v_abc (nominal = {1000.0 for $i1 in 1:3}, StateSelect = never) (16) [DISC] (1) Boolean $SEV_19 (17) [DISC] (1) Boolean $SEV_18 (18) [DISC] (1) Boolean $SEV_17 (19) [ALGB] (3) Real[3] switch2.i_abc (nominal = {1.0 for $i1 in 1:3}, StateSelect = never) (20) [DISC] (1) Boolean $SEV_16 (21) [DISC] (1) Boolean $SEV_15 (22) [ALGB] (4) protected Real[2, 2] meter.Rot_dq (23) [DISC] (1) Boolean $SEV_14 (24) [DISC] (1) Boolean $SEV_13 (25) [DISC] (1) Boolean $SEV_12 (26) [DISC] (1) Boolean $SEV_11 (27) [DISC] (1) Boolean $SEV_10 (28) [DISC] (3) Boolean[3] relay2.y (fixed = {true for $i1 in 1:3}, start = {relay2.ini_state for $i1 in 1:3}) (29) [DER-] (3) Real[3] $DER.line.i (30) [ALGB] (3) Real[3] line.v (start = line.v_start, nominal = {1000.0 for $i1 in 1:3}) (31) [ALGB] (1) protected Real infBus2.phi (32) [ALGB] (2) Real[2] line.term_n.theta (33) [ALGB] (1) protected Real switch2.switch_a.v (34) [ALGB] (1) protected Real switch2.switch_a.s (start = 0.5) (35) [DISC] (3) Boolean[3] switch2.control (36) [ALGB] (2) Real[2] switch2.term_n.theta (37) [ALGB] (2) Real[2] switch1.term_n.theta (38) [ALGB] (2) Real[2] meter.term_n.theta (39) [ALGB] (1) protected Real switch2.switch_a.i (40) [ALGB] (1) Real meter.alpha_i (StateSelect = never) (41) [DER-] (2) Real[2] $DER.line.term_p.theta (42) [ALGB] (3) Real[3] meter.v (StateSelect = never) (43) [DISC] (1) protected Integer relay1.cnt (fixed = true, start = 1) (44) [ALGB] (3) flow Real[3] meter.term_n.i (nominal = {1.0 for $i1 in 1:3}) (45) [ALGB] (2) Real[2] infBus2.term.theta (46) [ALGB] (3) Real[3] meter.p (StateSelect = never) (47) [ALGB] (1) Real meter.alpha_v (StateSelect = never) (48) [ALGB] (3) Real[3] switch2.term_p.v (nominal = {1000.0 for $i1 in 1:3}) (49) [ALGB] (1) Real meter.i_norm (StateSelect = never) (50) [ALGB] (1) Real $FUN_4 (51) [ALGB] (3) Real[3] switch1.i_abc (nominal = {1.0 for $i1 in 1:3}, StateSelect = never) (52) [ALGB] (1) Real $FUN_3 (53) [ALGB] (3) flow Real[3] infBus2.term.i (nominal = {1.0 for $i1 in 1:3}) (54) [ALGB] (1) Real $FUN_2 (55) [ALGB] (3) Real[3] meter.i (StateSelect = never) (56) [ALGB] (1) Real $FUN_1 (57) [ALGB] (3) Real[3] meter.term_n.v (nominal = {1000.0 for $i1 in 1:3}) (58) [DISC] (3) Boolean[3] switch1.control (59) [ALGB] (3) flow Real[3] switch2.term_p.i (nominal = {1.0 for $i1 in 1:3}) (60) [ALGB] (3) Real[3] infBus2.term.v (nominal = {1000.0 for $i1 in 1:3}) (61) [DISC] (1) protected Boolean switch2.switch_c.open = not (not switch2.switch_c.open) (start = true) (62) [DISC] (3) Boolean[3] relay1.y (fixed = {true for $i1 in 1:3}, start = {relay1.ini_state for $i1 in 1:3}) (63) [ALGB] (1) protected Real switch1.switch_c.v (64) [ALGB] (1) protected Real switch1.switch_c.s (start = 0.5) (65) [ALGB] (3) Real[3] switch1.term_n.v (nominal = {1000.0 for $i1 in 1:3}) (66) [DISS] (1) protected Boolean switch1.switch_c.arc (fixed = true, start = false) (67) [DISS] (1) protected Boolean switch2.switch_c.arc (fixed = true, start = false) (68) [ALGB] (1) protected Real switch1.switch_c.i (69) [ALGB] (9) Real[3, 3] $FUN_12 (70) [ALGB] (9) Real[3, 3] $FUN_11 (71) [DISS] (1) protected Boolean switch1.switch_a.arc (fixed = true, start = false) (72) [DISS] (1) protected Boolean switch2.switch_a.arc (fixed = true, start = false) (73) [ALGB] (4) Real[2, 2] $FUN_10 (74) [ALGB] (3) flow Real[3] switch1.term_n.i (nominal = {1.0 for $i1 in 1:3}) (75) [ALGB] (1) flow Real infBus1.neutral.i (76) [DISC] (1) Boolean $SEV_9 (77) [DISC] (1) Boolean $SEV_8 (78) [DISC] (1) Boolean $SEV_7 (79) [DISC] (1) Boolean $SEV_6 (80) [DISC] (1) Boolean $SEV_5 (81) [DISC] (1) Boolean $SEV_4 (82) [DISC] (1) Boolean $SEV_3 (83) [ALGB] (3) flow Real[3] line.term_n.i (nominal = {1.0 for $i1 in 1:3}) (84) [DISC] (1) Boolean $SEV_2 (85) [ALGB] (1) protected Real infBus2.alpha (86) [ALGB] (1) flow Real infBus2.neutral.i (87) [ALGB] (3) Real[3] line.term_n.v (nominal = {1000.0 for $i1 in 1:3}) (88) [DISC] (1) protected Boolean switch2.switch_b.open = not (not switch2.switch_b.open) (start = true) (89) [ALGB] (2) Real[2] infBus1.term.theta (90) [ALGB] (3) Real[3] switch2.v (nominal = {1000.0 for $i1 in 1:3}) (91) [ALGB] (2) Real[2] switch1.term_p.theta (92) [ALGB] (2) Real[2] switch2.term_p.theta (93) [ALGB] (2) Real[2] meter.term_p.theta (94) [ALGB] (1) Real meter.v_norm (StateSelect = never) (95) [ALGB] (1) protected Real switch1.switch_b.v (96) [ALGB] (1) Real system.thetaRef = system.thetaRef (97) [ALGB] (1) protected Real switch1.switch_b.s (start = 0.5) (98) [ALGB] (3) Real[3] switch2.i (nominal = {1.0 for $i1 in 1:3}) (99) [DISC] (1) protected Boolean switch1.switch_a.open = not (not switch1.switch_a.open) (start = true) (100) [ALGB] (2) Real[2] meter.vpp (StateSelect = never) (101) [ALGB] (1) Real system.thetaRel = system.thetaRef - system.thetaRef (102) [ALGB] (1) protected Real infBus2.V (nominal = 1000.0) (103) [ALGB] (1) Real meter.cos_phi (StateSelect = never) (104) [ALGB] (1) protected Real switch1.switch_b.i (105) [ALGB] (1) protected Real infBus1.phi (106) [ALGB] (1) protected Real switch2.switch_c.v (107) [ALGB] (1) protected Real switch2.switch_c.s (start = 0.5) (108) [ALGB] (1) protected Real infBus1.alpha (109) [ALGB] (3) flow Real[3] meter.term_p.i (nominal = {1.0 for $i1 in 1:3}) (110) [ALGB] (1) protected Real switch2.switch_c.i (111) [ALGB] (9) protected Real[3, 3] switch2.Park = PowerSystems.Utilities.Transforms.park(switch2.term_p.theta[2]) (112) [DISC] (1) protected Boolean switch2.switch_a.open = not (not switch2.switch_a.open) (start = true) (113) [ALGB] (3) Real[3] switch2.term_n.v (nominal = {1000.0 for $i1 in 1:3}) (114) [DISC] (1) protected Integer relay2.cnt (fixed = true, start = 1) (115) [ALGB] (3) Real[3] meter.term_p.v (nominal = {1000.0 for $i1 in 1:3}) (116) [ALGB] (3) flow Real[3] switch2.term_n.i (nominal = {1.0 for $i1 in 1:3}) (117) [ALGB] (3) Real[3] switch1.v (nominal = {1000.0 for $i1 in 1:3}) (118) [DISC] (1) protected Boolean switch1.switch_b.open = not (not switch1.switch_b.open) (start = true) (119) [ALGB] (1) protected Real switch1.switch_a.v (120) [ALGB] (1) protected Real switch1.switch_a.s (start = 0.5) (121) [ALGB] (2) protected Real[2] line.omega (122) [ALGB] (3) Real[3] switch1.i (nominal = {1.0 for $i1 in 1:3}) (123) [ALGB] (3) flow Real[3] infBus1.term.i (nominal = {1.0 for $i1 in 1:3}) (124) [ALGB] (3) Real[3] switch2.v_abc (nominal = {1000.0 for $i1 in 1:3}, StateSelect = never) (125) [ALGB] (1) protected Real infBus1.V (nominal = 1000.0) (126) [ALGB] (1) protected Real switch1.switch_a.i (127) [ALGB] (3) Real[3] infBus1.term.v (nominal = {1000.0 for $i1 in 1:3}) (128) [DISS] (1) protected Boolean switch1.switch_b.arc (fixed = true, start = false) (129) [ALGB] (3) Real[3] switch1.term_p.v (nominal = {1000.0 for $i1 in 1:3}) (130) [DISS] (1) protected Boolean switch2.switch_b.arc (fixed = true, start = false) (131) [ALGB] (1) protected Real switch2.switch_b.v (132) [ALGB] (1) protected Real switch2.switch_b.s (start = 0.5) System Equations (128/258) **************************** (1) [WHEN] (1)when {$SEV_9, $SEV_10, not switch2.switch_a.open} then (1) [----] switch2.switch_a.arc := edge(switch2.switch_a.open) (1) [----] end when; (2) [SCAL] (1) $FUN_1 = cos(infBus1.phi) ($RES_$AUX_144) (3) [ARRY] (2) line.term_n.theta = line.term_p.theta ($RES_SIM_51) (4) [SCAL] (1) $FUN_2 = sin(infBus1.phi) ($RES_$AUX_143) (5) [ARRY] (3) line.term_p.i + line.term_n.i = {0.0 for $i1 in 1:3} ($RES_SIM_52) (6) [SCAL] (1) $FUN_3 = cos(infBus2.phi) ($RES_$AUX_142) (7) [ARRY] (3) line.omega[2] * line.L * {-line.i[2], line.i[1], 0.0} + {line.L, line.L, line.L0} * $DER.line.i + line.R * line.i = line.v ($RES_SIM_53) (8) [SCAL] (1) $FUN_4 = sin(infBus2.phi) ($RES_$AUX_141) (9) [ARRY] (3) line.i = line.term_p.i ($RES_SIM_54) (10) [SCAL] (1) meter.v_norm = sqrt(meter.v * meter.v) ($RES_$AUX_140) (11) [ARRY] (3) line.v = line.term_p.v - line.term_n.v ($RES_SIM_55) (12) [ARRY] (2) line.omega = $DER.line.term_p.theta ($RES_SIM_56) (13) [ARRY] (2) switch1.term_n.theta = switch1.term_p.theta ($RES_SIM_57) (14) [ARRY] (3) switch1.term_p.i + switch1.term_n.i = {0.0 for $i1 in 1:3} ($RES_SIM_58) (15) [ARRY] (3) switch1.term_p.i = switch1.i ($RES_SIM_59) (16) [FOR-] (3) ($RES_SIM_95) (16) [----] for $i1 in 1:3 loop (16) [----] [SCAL] (1) switch2.term_n.i[$i1] + infBus2.term.i[$i1] = 0.0 ($RES_SIM_96) (16) [----] end for; (17) [ARRY] (3) switch2.term_n.v = infBus2.term.v ($RES_SIM_97) (18) [ARRY] (2) switch2.term_n.theta = infBus2.term.theta ($RES_SIM_98) (19) [FOR-] (3) ($RES_SIM_99) (19) [----] for $i1 in 1:3 loop (19) [----] [SCAL] (1) line.term_n.i[$i1] + switch2.term_p.i[$i1] = 0.0 ($RES_SIM_100) (19) [----] end for; (20) [ARRY] (3) line.term_n.v = switch2.term_p.v ($RES_SIM_101) (21) [ARRY] (2) line.term_n.theta = switch2.term_p.theta ($RES_SIM_102) (22) [SCAL] (1) meter.alpha_v = atan2(meter.Rot_dq[:, 2] * meter.v[1:2], meter.Rot_dq[:, 1] * meter.v[1:2]) ($RES_$AUX_139) (23) [FOR-] (3) ($RES_SIM_103) (23) [----] for $i1 in 1:3 loop (23) [----] [SCAL] (1) switch1.term_n.i[$i1] + line.term_p.i[$i1] = 0.0 ($RES_SIM_104) (23) [----] end for; (24) [SCAL] (1) meter.i_norm = sqrt(meter.i * meter.i) ($RES_$AUX_138) (25) [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_22) (26) [SCAL] (1) meter.alpha_i = atan2(meter.Rot_dq[:, 2] * meter.i[1:2], meter.Rot_dq[:, 1] * meter.i[1:2]) ($RES_$AUX_137) (27) [ARRY] (3) switch1.term_n.v = line.term_p.v ($RES_SIM_105) (28) [ARRY] (3) meter.i = meter.term_p.i / meter.I_base ($RES_SIM_23) (29) [SCAL] (1) meter.cos_phi = cos(meter.alpha_v - meter.alpha_i) ($RES_$AUX_136) (30) [ARRY] (2) switch1.term_n.theta = line.term_p.theta ($RES_SIM_106) (31) [ARRY] (2) meter.vpp = 1.7320508075688772 * {meter.v[2], -meter.v[1]} ($RES_SIM_24) (32) [ARRY] (4) $FUN_10 = PowerSystems.Examples.AC3ph.Transmission.RXline.meter.rot_dq(meter.term_p.theta[1]) ($RES_$AUX_135) (33) [ARRY] (3) switch1.v = switch1.term_p.v - switch1.term_n.v ($RES_SIM_60) (34) [FOR-] (3) ($RES_SIM_107) (34) [----] for $i1 in 1:3 loop (34) [----] [SCAL] (1) meter.term_n.i[$i1] + switch1.term_p.i[$i1] = 0.0 ($RES_SIM_108) (34) [----] end for; (35) [ARRY] (3) meter.v = meter.term_p.v / meter.V_base ($RES_SIM_25) (36) [ARRY] (9) $FUN_11 = PowerSystems.Utilities.Transforms.park(switch2.term_p.theta[2]) ($RES_$AUX_134) (37) [ARRY] (3) switch1.i_abc = transpose(switch1.Park) * switch1.i ($RES_SIM_61) (38) [SCAL] (1) 1.7320508075688772 * infBus2.term.i[3] + infBus2.neutral.i = 0.0 ($RES_SIM_26) (39) [ARRY] (9) $FUN_12 = PowerSystems.Utilities.Transforms.park(switch1.term_p.theta[2]) ($RES_$AUX_133) (40) [ARRY] (3) switch1.v = switch1.Park * switch1.v_abc ($RES_SIM_62) (41) [ARRY] (3) meter.term_n.v = switch1.term_p.v ($RES_SIM_109) (42) [SCAL] (1) switch1.switch_c.i = switch1.i_abc[3] ($RES_SIM_63) (43) [ARRY] (3) infBus2.term.v = {$FUN_3 * infBus2.V, $FUN_4 * infBus2.V, 0.0} ($RES_SIM_28) (44) [SCAL] (1) switch1.switch_c.v = switch1.v_abc[3] ($RES_SIM_64) (45) [SCAL] (1) infBus2.phi = infBus2.term.theta[1] + infBus2.alpha ($RES_SIM_29) (46) [SCAL] (1) switch1.switch_b.i = switch1.i_abc[2] ($RES_SIM_65) (47) [SCAL] (1) switch1.switch_b.v = switch1.v_abc[2] ($RES_SIM_66) (48) [SCAL] (1) switch1.switch_a.i = switch1.i_abc[1] ($RES_SIM_67) (49) [SCAL] (1) switch1.switch_a.v = switch1.v_abc[1] ($RES_SIM_68) (50) [ARRY] (2) {switch1.switch_c.v, switch1.switch_c.i} = if $SEV_11 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_69) (51) [SCAL] (1) $TEV_0 = $PRE.switch2.switch_c.open ($RES_EVT_145) (52) [SCAL] (1) $TEV_1 = $PRE.switch2.switch_b.open ($RES_EVT_146) (53) [SCAL] (1) $TEV_2 = $PRE.switch2.switch_a.open ($RES_EVT_147) (54) [SCAL] (1) $TEV_3 = $PRE.switch1.switch_c.open ($RES_EVT_148) (55) [SCAL] (1) $TEV_4 = $PRE.switch1.switch_b.open ($RES_EVT_149) (56) [ARRY] (2) meter.term_n.theta = switch1.term_p.theta ($RES_SIM_110) (57) [SCAL] (1) system.thetaRel = system.thetaRef - system.thetaRef ($RES_BND_123) (58) [FOR-] (3) ($RES_SIM_111) (58) [----] for $i1 in 1:3 loop (58) [----] [SCAL] (1) infBus1.term.i[$i1] + meter.term_p.i[$i1] = 0.0 ($RES_SIM_112) (58) [----] end for; (59) [SCAL] (1) infBus2.alpha = infBus2.vPhasor_internal[2] ($RES_SIM_30) (60) [ARRY] (9) switch1.Park = $FUN_12 ($RES_BND_125) (61) [ARRY] (3) infBus1.term.v = meter.term_p.v ($RES_SIM_113) (62) [SCAL] (1) infBus2.V = infBus2.vPhasor_internal[1] * infBus2.V_base ($RES_SIM_31) (63) [ARRY] (2) infBus1.term.theta = meter.term_p.theta ($RES_SIM_114) (64) [ARRY] (2) infBus2.vPhasor_internal = {infBus2.v0, infBus2.alpha0} ($RES_SIM_32) (65) [ARRY] (3) relay2.y = switch2.control ($RES_SIM_115) (66) [ARRY] (2) switch2.term_n.theta = switch2.term_p.theta ($RES_SIM_33) (67) [ARRY] (3) relay1.y = switch1.control ($RES_SIM_116) (68) [ARRY] (3) switch2.term_p.i + switch2.term_n.i = {0.0 for $i1 in 1:3} ($RES_SIM_34) (69) [ARRY] (9) switch2.Park = $FUN_11 ($RES_BND_129) (70) [SCAL] (1) switch2.control[3] = not switch2.switch_c.open ($RES_SIM_117) (71) [WHEN] (1)when {$SEV_12, $SEV_13, not switch1.switch_c.open} then (71) [----] switch1.switch_c.arc := edge(switch1.switch_c.open) (71) [----] end when; (72) [ARRY] (3) switch2.term_p.i = switch2.i ($RES_SIM_35) (73) [SCAL] (1) switch2.control[2] = not switch2.switch_b.open ($RES_SIM_118) (74) [ARRY] (2) {switch1.switch_b.v, switch1.switch_b.i} = if $SEV_14 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_71) (75) [ARRY] (3) switch2.v = switch2.term_p.v - switch2.term_n.v ($RES_SIM_36) (76) [SCAL] (1) switch2.control[1] = not switch2.switch_a.open ($RES_SIM_119) (77) [WHEN] (1)when {$SEV_15, $SEV_16, not switch1.switch_b.open} then (77) [----] switch1.switch_b.arc := edge(switch1.switch_b.open) (77) [----] end when; (78) [ARRY] (3) switch2.i_abc = transpose(switch2.Park) * switch2.i ($RES_SIM_37) (79) [ARRY] (2) {switch1.switch_a.v, switch1.switch_a.i} = if $SEV_17 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_73) (80) [ARRY] (3) switch2.v = switch2.Park * switch2.v_abc ($RES_SIM_38) (81) [WHEN] (1)when {$SEV_18, $SEV_19, not switch1.switch_a.open} then (81) [----] switch1.switch_a.arc := edge(switch1.switch_a.open) (81) [----] end when; (82) [SCAL] (1) switch2.switch_c.i = switch2.i_abc[3] ($RES_SIM_39) (83) [SCAL] (1) 1.7320508075688772 * infBus1.term.i[3] + infBus1.neutral.i = 0.0 ($RES_SIM_75) (84) [ARRY] (2) infBus1.term.theta = {system.thetaRel, system.thetaRef} ($RES_SIM_76) (85) [SCAL] (1) $TEV_5 = $PRE.switch1.switch_a.open ($RES_EVT_150) (86) [ARRY] (3) infBus1.term.v = {$FUN_1 * infBus1.V, $FUN_2 * infBus1.V, 0.0} ($RES_SIM_78) (87) [SCAL] (1) $SEV_2 = not switch2.switch_c.open or switch2.switch_c.arc ($RES_EVT_151) (88) [SCAL] (1) infBus1.phi = infBus1.term.theta[1] + infBus1.alpha ($RES_SIM_79) (89) [SCAL] (1) $SEV_3 = switch2.switch_c.open and switch2.switch_c.i < 0.0 ($RES_EVT_152) (90) [SCAL] (1) $SEV_4 = switch2.switch_c.open and switch2.switch_c.i > 0.0 ($RES_EVT_153) (91) [SCAL] (1) $SEV_5 = not switch2.switch_b.open or switch2.switch_b.arc ($RES_EVT_154) (92) [SCAL] (1) $SEV_6 = switch2.switch_b.open and switch2.switch_b.i < 0.0 ($RES_EVT_155) (93) [SCAL] (1) $SEV_7 = switch2.switch_b.open and switch2.switch_b.i > 0.0 ($RES_EVT_156) (94) [SCAL] (1) $SEV_8 = not switch2.switch_a.open or switch2.switch_a.arc ($RES_EVT_157) (95) [SCAL] (1) $SEV_9 = switch2.switch_a.open and switch2.switch_a.i < 0.0 ($RES_EVT_158) (96) [SCAL] (1) $SEV_10 = switch2.switch_a.open and switch2.switch_a.i > 0.0 ($RES_EVT_159) (97) [SCAL] (1) switch1.control[3] = not switch1.switch_c.open ($RES_SIM_120) (98) [SCAL] (1) switch1.control[2] = not switch1.switch_b.open ($RES_SIM_121) (99) [SCAL] (1) switch1.control[1] = not switch1.switch_a.open ($RES_SIM_122) (100) [SCAL] (1) switch2.switch_c.v = switch2.v_abc[3] ($RES_SIM_40) (101) [SCAL] (1) switch2.switch_b.i = switch2.i_abc[2] ($RES_SIM_41) (102) [SCAL] (1) switch2.switch_b.v = switch2.v_abc[2] ($RES_SIM_42) (103) [SCAL] (1) switch2.switch_a.i = switch2.i_abc[1] ($RES_SIM_43) (104) [SCAL] (1) switch2.switch_a.v = switch2.v_abc[1] ($RES_SIM_44) (105) [SCAL] (1) infBus1.alpha = infBus1.vPhasor_internal[2] ($RES_SIM_80) (106) [ARRY] (2) {switch2.switch_c.v, switch2.switch_c.i} = if $SEV_2 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_45) (107) [SCAL] (1) infBus1.V = infBus1.vPhasor_internal[1] * infBus1.V_base ($RES_SIM_81) (108) [WHEN] (1)when {$SEV_3, $SEV_4, not switch2.switch_c.open} then (108) [----] switch2.switch_c.arc := edge(switch2.switch_c.open) (108) [----] end when; (109) [ARRY] (2) infBus1.vPhasor_internal = {infBus1.v0, infBus1.alpha0} ($RES_SIM_82) (110) [ARRY] (2) {switch2.switch_b.v, switch2.switch_b.i} = if $SEV_5 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_47) (111) [WHEN] (1)when {$SEV_6, $SEV_7, not switch2.switch_b.open} then (111) [----] switch2.switch_b.arc := edge(switch2.switch_b.open) (111) [----] end when; (112) [ARRY] (2) {switch2.switch_a.v, switch2.switch_a.i} = if $SEV_8 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_49) (113) [SCAL] (1) system.thetaRef = 314.1592653589793 * time ($RES_SIM_85) (114) [SCAL] (1) $SEV_11 = not switch1.switch_c.open or switch1.switch_c.arc ($RES_EVT_160) (115) [SCAL] (1) $SEV_12 = switch1.switch_c.open and switch1.switch_c.i < 0.0 ($RES_EVT_161) (116) [SCAL] (1) $SEV_13 = switch1.switch_c.open and switch1.switch_c.i > 0.0 ($RES_EVT_162) (117) [SCAL] (1) $SEV_14 = not switch1.switch_b.open or switch1.switch_b.arc ($RES_EVT_163) (118) [SCAL] (1) $SEV_15 = switch1.switch_b.open and switch1.switch_b.i < 0.0 ($RES_EVT_164) (119) [SCAL] (1) $SEV_16 = switch1.switch_b.open and switch1.switch_b.i > 0.0 ($RES_EVT_165) (120) [SCAL] (1) $SEV_17 = not switch1.switch_a.open or switch1.switch_a.arc ($RES_EVT_166) (121) [ALGO] (4) ($RES_SIM_8) (121) [----] when time > relay1.t_switch[relay1.cnt] then (121) [----] relay1.cnt := min(relay1.cnt + 1, 2); (121) [----] for k in relay1.switched loop (121) [----] relay1.y[k] := not relay1.y[k]; (121) [----] end for; (121) [----] end when; (122) [SCAL] (1) $SEV_18 = switch1.switch_a.open and switch1.switch_a.i < 0.0 ($RES_EVT_167) (123) [ALGO] (4) ($RES_SIM_7) (123) [----] when time > relay2.t_switch[relay2.cnt] then (123) [----] relay2.cnt := min(relay2.cnt + 1, 2); (123) [----] for k in relay2.switched loop (123) [----] relay2.y[k] := not relay2.y[k]; (123) [----] end for; (123) [----] end when; (124) [SCAL] (1) $SEV_19 = switch1.switch_a.open and switch1.switch_a.i > 0.0 ($RES_EVT_168) (125) [ARRY] (2) meter.term_n.theta = meter.term_p.theta ($RES_SIM_11) (126) [ARRY] (3) meter.term_p.i + meter.term_n.i = {0.0 for $i1 in 1:3} ($RES_SIM_12) (127) [ARRY] (3) meter.term_p.v = meter.term_n.v ($RES_SIM_13) (128) [ARRY] (4) meter.Rot_dq = $FUN_10 ($RES_SIM_14)