Running: ./testmodel.py --libraries=/home/hudson/saved_omc/libraries/.openmodelica/libraries --ompython_omhome=/usr MEV_MEV.Simulations.OnOffControl.Scenario6.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/MEV 1.1.1/package.mo", uses=false) Using package MEV with version 1.1.1 (/home/hudson/saved_omc/libraries/.openmodelica/libraries/MEV 1.1.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(MEV.Simulations.OnOffControl.Scenario6,tolerance=1e-06,outputFormat="empty",numberOfIntervals=10000,variableFilter="",fileNamePrefix="MEV_MEV.Simulations.OnOffControl.Scenario6") translateModel(MEV.Simulations.OnOffControl.Scenario6,tolerance=1e-06,outputFormat="empty",numberOfIntervals=10000,variableFilter="",fileNamePrefix="MEV_MEV.Simulations.OnOffControl.Scenario6") Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/ModelicaServices 4.0.0+maint.om/package.mo): time 0.00119/0.00119, allocations: 108.8 kB / 16.42 MB, free: 6.461 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.001158/0.001158, allocations: 189.5 kB / 17.36 MB, free: 5.73 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.334/1.334, allocations: 205.1 MB / 223.2 MB, free: 12.24 MB / 190.1 MB Notification: Performance of loadFile(/home/hudson/saved_omc/libraries/.openmodelica/libraries/MEV 1.1.1/package.mo): time 0.009056/0.009056, allocations: 1.939 MB / 272.5 MB, free: 10.07 MB / 222.1 MB Notification: Performance of FrontEnd - Absyn->SCode: time 2.874e-05/2.874e-05, allocations: 2.281 kB / 378.9 MB, free: 51.59 MB / 318.1 MB Notification: Performance of NFInst.instantiate(MEV.Simulations.OnOffControl.Scenario6): time 0.006217/0.006255, allocations: 6.248 MB / 385.1 MB, free: 48.57 MB / 318.1 MB Notification: Performance of NFInst.instExpressions: time 0.003599/0.009884, allocations: 1.473 MB / 386.6 MB, free: 48.07 MB / 318.1 MB Notification: Performance of NFInst.updateImplicitVariability: time 0.0006014/0.0105, allocations: 14.72 kB / 386.6 MB, free: 48.06 MB / 318.1 MB Notification: Performance of NFTyping.typeComponents: time 0.0004268/0.01094, allocations: 139.4 kB / 386.8 MB, free: 47.99 MB / 318.1 MB Notification: Performance of NFTyping.typeBindings: time 0.0007955/0.01174, allocations: 348.7 kB / 387.1 MB, free: 47.76 MB / 318.1 MB Notification: Performance of NFTyping.typeClassSections: time 0.0009194/0.01272, allocations: 332.3 kB / 387.4 MB, free: 47.68 MB / 318.1 MB Notification: Performance of NFFlatten.flatten: time 0.00333/0.01606, allocations: 3.339 MB / 390.8 MB, free: 46.23 MB / 318.1 MB Notification: Performance of NFFlatten.resolveConnections: time 0.001942/0.01802, allocations: 1.672 MB / 392.4 MB, free: 45.43 MB / 318.1 MB Notification: Performance of NFEvalConstants.evaluate: time 0.002047/0.02007, allocations: 1.07 MB / 393.5 MB, free: 45 MB / 318.1 MB Notification: Performance of NFSimplifyModel.simplify: time 0.00127/0.02135, allocations: 1.048 MB / 394.6 MB, free: 44.55 MB / 318.1 MB Notification: Performance of NFPackage.collectConstants: time 0.0003181/0.02168, allocations: 209.3 kB / 394.8 MB, free: 44.55 MB / 318.1 MB Notification: Performance of NFFlatten.collectFunctions: time 0.0005679/0.02226, allocations: 257.3 kB / 395 MB, free: 44.53 MB / 318.1 MB Notification: Performance of combineBinaries: time 0.002074/0.02434, allocations: 2.327 MB / 397.4 MB, free: 43.19 MB / 318.1 MB Notification: Performance of replaceArrayConstructors: time 0.0009838/0.02533, allocations: 1.359 MB / 398.7 MB, free: 42.33 MB / 318.1 MB Notification: Performance of NFVerifyModel.verify: time 0.0003978/0.02574, allocations: 230.3 kB / 398.9 MB, free: 42.23 MB / 318.1 MB Notification: Performance of FrontEnd: time 0.0002319/0.02598, allocations: 29.69 kB / 399 MB, free: 42.22 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: 1114 (376) * Number of variables: 1114 (196) Notification: Performance of Bindings: time 0.007289/0.03327, allocations: 7.987 MB / 407 MB, free: 36.91 MB / 318.1 MB Notification: Performance of FunctionAlias: time 0.0005036/0.03379, allocations: 458.2 kB / 407.4 MB, free: 36.64 MB / 318.1 MB Notification: Performance of Early Inline: time 0.005146/0.03894, allocations: 5.829 MB / 413.2 MB, free: 32.27 MB / 318.1 MB Notification: Performance of simplify1: time 0.0003613/0.03932, allocations: 275.7 kB / 413.5 MB, free: 32 MB / 318.1 MB Notification: Performance of Alias: time 0.003777/0.0431, allocations: 4.646 MB / 418.1 MB, free: 27.08 MB / 318.1 MB Notification: Performance of simplify2: time 0.0002188/0.04333, allocations: 235.8 kB / 418.4 MB, free: 26.85 MB / 318.1 MB Notification: Performance of Events: time 0.0005731/0.04391, allocations: 0.6738 MB / 419 MB, free: 26.18 MB / 318.1 MB Notification: Performance of Detect States: time 0.000844/0.04477, allocations: 1.159 MB / 420.2 MB, free: 25 MB / 318.1 MB Notification: Performance of Partitioning: time 0.001454/0.04623, allocations: 1.762 MB / 422 MB, free: 23.19 MB / 318.1 MB Error: Internal error NBSlice.fillDependencyArray failed because number of flattened indices 1 for dependency $TEV_0 could not be divided by the body size 10 without rest. Error: Internal error NBAdjacency.Matrix.createPseudo failed for: [ARRY] (10) patients.leakOpening.y = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, if $TEV_0 then 0.0 else 1.0} ($RES_BND_461) Error: Internal error NBAdjacency.Matrix.create failed to create adjacency matrix for system: System Variables (149/1157) ***************************** (1) [DISC] (10) Boolean[10] $SEV_6[$i1] (2) [ALGB] (10) Real[10] patients.valve_in.dp (nominal = {1000.0 for $i1 in 1:10}) (3) [ALGB] (10) Real[10] patientControllers.opening (4) [ALGB] (10) Real[10] pipeSegments.p (nominal = {1000.0 for $i1 in 1:10}, StateSelect = prefer) (5) [ALGB] (10) Real[10] patientControllers.RR (6) [ALGB] (10) Real[10] patients.resistance.pout (nominal = {1000.0 for $i1 in 1:10}) (7) [ALGB] (10) Real[10] patients.one.y (8) [ALGB] (10) Real[10] patients.resistance.air.p (nominal = {1e5 for $i1 in 1:10}) (9) [ALGB] (10) Real[10] patients.valve_out.air.p (nominal = {1e5 for $i1 in 1:10}) (10) [ALGB] (1) Real bellJar.cylinder.w_in (nominal = 1e-4) (11) [ALGB] (10) Real[10] patients.leak.pout (12) [ALGB] (1) Real bellJar.cylinder.air.p (nominal = 1e5) (13) [ALGB] (10) Real[10] patients.resistance.q (nominal = {1e-4 for $i1 in 1:10}) (14) [DISC] (1) Boolean $TEV_0 (15) [ALGB] (10) Real[10] patients.resistance.w (nominal = {1e-4 for $i1 in 1:10}) (16) [ALGB] (10) Real[10] patients.leak.air.Tref = {ambient.T for $patients1 in 1:10} (start = {288.15 for $i1 in 1:10}, min = {0.0 for $i1 in 1:10}, nominal = {300.0 for $i1 in 1:10}) (17) [ALGB] (1) Real onOffControllerWithHysteresis.valveOpening (18) [ALGB] (10) Real[10] patients.valve_out.inlet.p (nominal = {1000.0 for $i1 in 1:10}) (19) [ALGB] (1) Real supplyValveOnOff.q (nominal = 1e-4) (20) [ALGB] (10) Real[10] patients.resistance.pin (nominal = {1000.0 for $i1 in 1:10}) (21) [ALGB] (10) Real[10] pipeSegments.uout (22) [ALGB] (10) Real[10] patients.resistance.dp (nominal = {1000.0 for $i1 in 1:10}) (23) [ALGB] (10) flow Real[10] patients.valve_out.inlet.w (nominal = {1e-4 for $i1 in 1:10}) (24) [ALGB] (10) Real[10] pipeSegments.air.pref = {ambient.p for $pipeSegments1 in 1:10} (nominal = {1e5 for $i1 in 1:10}) (25) [DER-] (1) Real $DER.bellJar.damper.s_rel (26) [ALGB] (10) Real[10] patients.resistance.inlet.p (nominal = {1000.0 for $i1 in 1:10}) (27) [ALGB] (1) Real bellJar.force.s (28) [DISS] (1) Boolean onOffControllerWithHysteresis.on (29) [ALGB] (10) Real[10] patients.leak.opening (30) [ALGB] (10) Real[10] patients.resistance.air.pref = {ambient.p for $patients1 in 1:10} (nominal = {1e5 for $i1 in 1:10}) (31) [ALGB] (10) flow Real[10] patients.resistance.inlet.w (nominal = {1e-4 for $i1 in 1:10}) (32) [ALGB] (1) Real bellJar.damper.v_rel (start = 0.0, StateSelect = prefer) (33) [ALGB] (10) Real[10] patients.leak.outlet.p (nominal = {1000.0 for $i1 in 1:10}) (34) [ALGB] (10) Real[10] patients.valve_out.pin (nominal = {1000.0 for $i1 in 1:10}) (35) [ALGB] (10) flow Real[10] pipeSegments.inlet.w (nominal = {1e-4 for $i1 in 1:10}) (36) [ALGB] (10) Real[10] patients.compliance.air.rho (start = {1.2 for $i1 in 1:10}, min = {0.0 for $i1 in 1:10}, nominal = {1.2 for $i1 in 1:10}) (37) [DISC] (10) Boolean[10] $SEV_5[$i1] (38) [ALGB] (10) flow Real[10] patients.leak.outlet.w (nominal = {1e-4 for $i1 in 1:10}) (39) [ALGB] (10) Real[10] pipeSegments.inlet.p (nominal = {1000.0 for $i1 in 1:10}) (40) [ALGB] (10) Real[10] patients.leak.air.rho (start = {1.2 for $i1 in 1:10}, min = {0.0 for $i1 in 1:10}, nominal = {1.2 for $i1 in 1:10}) (41) [DISC] (10) Boolean[10] $SEV_0[$i1] (42) [ALGB] (10) Real[10] patients.valve_in.pout (43) [ALGB] (10) Real[10] patients.compliance.w (nominal = {1e-4 for $i1 in 1:10}) (44) [ALGB] (10) Real[10] patients.valve_in.opening (45) [ALGB] (10) Real[10] patients.leak.dp (nominal = {1000.0 for $i1 in 1:10}) (46) [ALGB] (1) Real bellJar.cylinder.V (47) [ALGB] (10) Real[10] pipeSegments.win (nominal = {1e-4 for $i1 in 1:10}) (48) [ALGB] (10) flow Real[10] patients.atmosphere.port.w (nominal = {1e-4 for $i1 in 1:10}) (49) [ALGB] (10) Real[10] pipeSegments.pout (nominal = {1000.0 for $i1 in 1:10}) (50) [ALGB] (10) Real[10] patients.valve_in.air.rho (start = {1.2 for $i1 in 1:10}, min = {0.0 for $i1 in 1:10}, nominal = {1.2 for $i1 in 1:10}) (51) [ALGB] (10) Real[10] patients.atmosphere.port.p (nominal = {1000.0 for $i1 in 1:10}) (52) [DER-] (10) Real[10] $DER.patients.compliance.V (53) [ALGB] (1) Real $FUN_5 (54) [ALGB] (10) Real[10] $FUN_4 (55) [ALGB] (1) Real bellJar.cylinder.F (56) [ALGB] (10) Real[10] $FUN_3 (57) [ALGB] (10) flow Real[10] pipeSegments.outlet.w (nominal = {1e-4 for $i1 in 1:10}) (58) [ALGB] (10) Real[10] $FUN_2 (59) [ALGB] (1) Real $FUN_1 (60) [ALGB] (1) flow Real supplyValveOnOff.outlet.w (nominal = 1e-4) (61) [DER-] (1) Real $DER.bellJar.piston.s (62) [ALGB] (10) Real[10] dutyCycle.y (63) [ALGB] (1) flow Real supplyValveModulating.outlet.w (nominal = 1e-4) (64) [DER-] (1) Real $DER.bellJar.piston.v (65) [ALGB] (10) Real[10] patients.leakOpening.y = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, if time < 5.0 then 0.0 else 1.0} (66) [ALGB] (10) Real[10] pipeSegments.outlet.p (nominal = {1000.0 for $i1 in 1:10}) (67) [ALGB] (10) Real[10] patients.valve_in.pin (nominal = {1000.0 for $i1 in 1:10}) (68) [ALGB] (10) Real[10] patients.valve_out.pout (69) [DISC] (10) Boolean[10] $SEV_4[$i1] (70) [DER-] (10) Real[10] $DER.patients.compliance.p (71) [ALGB] (10) Real[10] patients.valve_out.air.Tref = {ambient.T for $patients1 in 1:10} (start = {288.15 for $i1 in 1:10}, min = {0.0 for $i1 in 1:10}, nominal = {300.0 for $i1 in 1:10}) (72) [ALGB] (10) Real[10] patients.valve_in.w (nominal = {1e-4 for $i1 in 1:10}) (73) [ALGB] (10) Real[10] patients.add.u1 (74) [ALGB] (10) Real[10] pipeSegments.air.Tref = {ambient.T for $pipeSegments1 in 1:10} (start = {288.15 for $i1 in 1:10}, min = {0.0 for $i1 in 1:10}, nominal = {300.0 for $i1 in 1:10}) (75) [ALGB] (10) Real[10] patients.add.u2 (76) [ALGB] (10) Real[10] patients.valve_out.dp (nominal = {1000.0 for $i1 in 1:10}) (77) [ALGB] (10) Real[10] patients.valve_in.q (nominal = {1e-4 for $i1 in 1:10}) (78) [ALGB] (10) Real[10] pipeSegments.wout (nominal = {1e-4 for $i1 in 1:10}) (79) [DER-] (1) Real $DER.linearController.firstOrder.y (80) [ALGB] (1) flow Real bellJar.damper.flange_b.f (81) [ALGB] (1) Real bellJar.piston.a (start = 0.0) (82) [ALGB] (10) Real[10] patients.compliance.air.p (nominal = {1e5 for $i1 in 1:10}) (83) [ALGB] (10) Real[10] patients.valve_out.outlet.p (nominal = {1000.0 for $i1 in 1:10}) (84) [ALGB] (10) Real[10] patients.leak.pin (nominal = {1000.0 for $i1 in 1:10}) (85) [DISC] (1) Boolean $SEV_9 (86) [DISC] (1) Boolean $SEV_8 (87) [ALGB] (10) Real[10] RR.y (88) [ALGB] (10) flow Real[10] patients.valve_out.outlet.w (nominal = {1e-4 for $i1 in 1:10}) (89) [ALGB] (10) Real[10] patients.compliance.air.Tref = {ambient.T for $patients1 in 1:10} (start = {288.15 for $i1 in 1:10}, min = {0.0 for $i1 in 1:10}, nominal = {300.0 for $i1 in 1:10}) (90) [DISC] (1) Boolean $SEV_1 (91) [DISS] (10) Boolean[10] patientControllers.active (92) [DER-] (10) Real[10] $DER.pipeSegments.M (93) [ALGB] (10) Real[10] patients.valve_out.opening (94) [ALGB] (10) Real[10] patients.valve_out.w (nominal = {1e-4 for $i1 in 1:10}) (95) [ALGB] (10) Real[10] pipeSegments.dpout (nominal = {1000.0 for $i1 in 1:10}) (96) [ALGB] (10) Real[10] pipeSegments.dpin (nominal = {1000.0 for $i1 in 1:10}) (97) [DISC] (10) Boolean[10] $SEV_3[$i1] (98) [ALGB] (10) Real[10] patients.valve_out.q (nominal = {1e-4 for $i1 in 1:10}) (99) [ALGB] (10) Real[10] patients.valve_out.air.rho (start = {1.2 for $i1 in 1:10}, min = {0.0 for $i1 in 1:10}, nominal = {1.2 for $i1 in 1:10}) (100) [ALGB] (10) Real[10] pipeSegments.pin (nominal = {1000.0 for $i1 in 1:10}) (101) [ALGB] (1) Real supplyValveModulating.dp (nominal = 1000.0) (102) [ALGB] (10) Real[10] patients.compliance.port.p (nominal = {1000.0 for $i1 in 1:10}) (103) [ALGB] (10) flow Real[10] patients.compliance.port.w (nominal = {1e-4 for $i1 in 1:10}) (104) [ALGB] (10) Real[10] patients.resistance.air.rho (start = {1.2 for $i1 in 1:10}, min = {0.0 for $i1 in 1:10}, nominal = {1.2 for $i1 in 1:10}) (105) [ALGB] (10) Real[10] patients.valve_in.air.Tref = {ambient.T for $patients1 in 1:10} (start = {288.15 for $i1 in 1:10}, min = {0.0 for $i1 in 1:10}, nominal = {300.0 for $i1 in 1:10}) (106) [ALGB] (1) flow Real pressureSource.port.w (nominal = 1e-4) (107) [DER-] (10) Real[10] $DER.patients.compliance.Vb (108) [ALGB] (1) Real bellJar.cylinder.w_out (nominal = 1e-4) (109) [ALGB] (10) Real[10] patients.valve_in.air.p (nominal = {1e5 for $i1 in 1:10}) (110) [ALGB] (10) Real[10] pipeSegments.air.rho (start = {1.2 for $i1 in 1:10}, min = {0.0 for $i1 in 1:10}, nominal = {1.2 for $i1 in 1:10}) (111) [ALGB] (10) Real[10] patients.leak.inlet.p (nominal = {1000.0 for $i1 in 1:10}) (112) [ALGB] (10) Real[10] patients.valveCommand (113) [ALGB] (10) Real[10] pipeSegments.dp (nominal = {1000.0 for $i1 in 1:10}) (114) [ALGB] (10) Real[10] pipeSegments.uin2 (115) [ALGB] (1) Real bellJar.damper.lossPower (116) [ALGB] (10) flow Real[10] patients.leak.inlet.w (nominal = {1e-4 for $i1 in 1:10}) (117) [ALGB] (10) Real[10] patientControllers.dutyCycle (118) [ALGB] (1) Real supplyValveModulating.q (nominal = 1e-4) (119) [DISS] (10) discrete Real[10] patientControllers.t_on (120) [ALGB] (10) Real[10] patients.add.y (121) [ALGB] (10) Real[10] patients.valve_in.outlet.p (nominal = {1000.0 for $i1 in 1:10}) (122) [ALGB] (10) Real[10] patients.leak.q (nominal = {1e-4 for $i1 in 1:10}) (123) [ALGB] (10) flow Real[10] patients.valve_in.outlet.w (nominal = {1e-4 for $i1 in 1:10}) (124) [DISC] (10) Boolean[10] $SEV_7[$i1] (125) [ALGB] (10) Real[10] patients.valve_in.inlet.p (nominal = {1000.0 for $i1 in 1:10}) (126) [ALGB] (10) Real[10] patients.leak.w (nominal = {1e-4 for $i1 in 1:10}) (127) [ALGB] (1) Real supplyValveModulating.pout (128) [DISS] (10) discrete Real[10] patientControllers.t_off (129) [ALGB] (10) Real[10] pipeSegments.uin (130) [ALGB] (10) flow Real[10] patients.valve_in.inlet.w (nominal = {1e-4 for $i1 in 1:10}) (131) [DISC] (10) Boolean[10] $SEV_2[$i1] (132) [ALGB] (1) Real supplyValveModulating.air.rho (start = 1.2, min = 0.0, nominal = 1.2) (133) [ALGB] (1) Real linearController.feedback.y (134) [ALGB] (10) Real[10] patients.resistance.air.Tref = {ambient.T for $patients1 in 1:10} (start = {288.15 for $i1 in 1:10}, min = {0.0 for $i1 in 1:10}, nominal = {300.0 for $i1 in 1:10}) (135) [ALGB] (10) Real[10] patients.leak.air.p (nominal = {1e5 for $i1 in 1:10}) (136) [ALGB] (1) Real supplyValveOnOff.air.rho (start = 1.2, min = 0.0, nominal = 1.2) (137) [ALGB] (1) flow Real bellJar.piston.flange_a.f (138) [ALGB] (1) Real supplyValveModulating.opening (139) [DER-] (1) Real $DER.bellJar.cylinder.M (140) [ALGB] (10) Real[10] pipeSegments.air.p (nominal = {1e5 for $i1 in 1:10}) (141) [ALGB] (10) flow Real[10] patients.peep.port.w (nominal = {1e-4 for $i1 in 1:10}) (142) [ALGB] (10) flow Real[10] patients.supply.w (nominal = {1e-4 for $i1 in 1:10}) (143) [ALGB] (10) Real[10] pipeSegments.uout2 (144) [ALGB] (10) Real[10] patients.resistance.outlet.p (nominal = {1000.0 for $i1 in 1:10}) (145) [ALGB] (1) Real bellJar.cylinder.air.rho (start = 1.2, min = 0.0, nominal = 1.2) (146) [ALGB] (10) Real[10] patients.supply.p (nominal = {1000.0 for $i1 in 1:10}) (147) [ALGB] (10) Real[10] patients.peep.port.p (nominal = {1000.0 for $i1 in 1:10}) (148) [ALGB] (10) flow Real[10] patients.resistance.outlet.w (nominal = {1e-4 for $i1 in 1:10}) (149) [ALGB] (1) Real supplyValveOnOff.dp (nominal = 1000.0) System Equations (329/1157) ***************************** (1) [SCAL] (1) patients[8].compliance.port.p = patients[8].resistance.outlet.p ($RES_SIM_429) (2) [SCAL] (1) patients[3].leak.outlet.w + patients[3].atmosphere.port.w = 0.0 ($RES_SIM_254) (3) [SCAL] (1) patients[2].leak.outlet.w + patients[2].atmosphere.port.w = 0.0 ($RES_SIM_255) (4) [SCAL] (1) patients[1].leak.outlet.w + patients[1].atmosphere.port.w = 0.0 ($RES_SIM_256) (5) [SCAL] (1) pipeSegments[10].outlet.w + patients[10].supply.w = 0.0 ($RES_SIM_257) (6) [SCAL] (1) supplyValveOnOff.outlet.w + supplyValveModulating.outlet.w + bellJar.cylinder.w_in = 0.0 ($RES_SIM_258) (7) [SCAL] (1) pressureSource.port.w - (supplyValveModulating.outlet.w + supplyValveOnOff.outlet.w) = 0.0 ($RES_SIM_259) (8) [SCAL] (1) patients[3].valve_in.outlet.p = patients[3].leak.inlet.p ($RES_SIM_340) (9) [SCAL] (1) patients[4].valve_in.outlet.p = patients[4].valve_out.inlet.p ($RES_SIM_341) (10) [SCAL] (1) patients[4].valve_in.outlet.p = patients[4].resistance.inlet.p ($RES_SIM_342) (11) [SCAL] (1) patients[4].valve_in.outlet.p = patients[4].leak.inlet.p ($RES_SIM_343) (12) [SCAL] (1) patients[5].valve_in.outlet.p = patients[5].valve_out.inlet.p ($RES_SIM_344) (13) [SCAL] (1) patients[5].valve_in.outlet.p = patients[5].resistance.inlet.p ($RES_SIM_345) (14) [FOR-] (10) ($RES_SIM_170) (14) [----] for $i1 in 1:10 loop (14) [----] [SCAL] (1) pipeSegments[$i1].M = pipeSegments[$i1].air.rho * pipeSegments[$i1].V ($RES_SIM_171) (14) [----] end for; (15) [FOR-] (10) ($RES_BND_470) (15) [----] for $i1 in 1:10 loop (15) [----] [SCAL] (1) patients[$i1].resistance.air.Tref = ambient.T ($RES_BND_471) (15) [----] end for; (16) [SCAL] (1) patients[5].valve_in.outlet.p = patients[5].leak.inlet.p ($RES_SIM_346) (17) [SCAL] (1) patients[6].valve_in.outlet.p = patients[6].valve_out.inlet.p ($RES_SIM_347) (18) [FOR-] (10) ($RES_SIM_172) (18) [----] for $i1 in 1:10 loop (18) [----] [SCAL] (1) $DER.pipeSegments[$i1].M = pipeSegments[$i1].win - pipeSegments[$i1].wout ($RES_SIM_173) (18) [----] end for; (19) [FOR-] (10) ($RES_BND_472) (19) [----] for $i1 in 1:10 loop (19) [----] [SCAL] (1) patients[$i1].valve_in.air.Tref = ambient.T ($RES_BND_473) (19) [----] end for; (20) [SCAL] (1) patients[6].valve_in.outlet.p = patients[6].resistance.inlet.p ($RES_SIM_348) (21) [SCAL] (1) patients[6].valve_in.outlet.p = patients[6].leak.inlet.p ($RES_SIM_349) (22) [FOR-] (10) ($RES_SIM_174) (22) [----] for $i1 in 1:10 loop (22) [----] [SCAL] (1) pipeSegments[$i1].air.rho = (pipeSegments[$i1].air.pref / (pipeSegments[$i1].air.Tref * 286.7055103448276)) * (1.0 + ((pipeSegments[$i1].air.p - pipeSegments[$i1].air.pref) / pipeSegments[$i1].air.pref) / 1.4) ($RES_SIM_175) (22) [----] end for; (23) [SCAL] (1) patients[9].compliance.port.p = patients[9].resistance.outlet.p ($RES_SIM_430) (24) [SCAL] (1) patients[10].compliance.port.p = patients[10].resistance.outlet.p ($RES_SIM_431) (25) [SCAL] (1) patients[1].add.y = patients[1].valve_out.opening ($RES_SIM_432) (26) [SCAL] (1) patients[2].add.y = patients[2].valve_out.opening ($RES_SIM_433) (27) [SCAL] (1) patients[3].add.y = patients[3].valve_out.opening ($RES_SIM_434) (28) [SCAL] (1) patients[4].add.y = patients[4].valve_out.opening ($RES_SIM_435) (29) [SCAL] (1) pipeSegments[1].inlet.w - bellJar.cylinder.w_out = 0.0 ($RES_SIM_260) (30) [SCAL] (1) patients[5].add.y = patients[5].valve_out.opening ($RES_SIM_436) (31) [SCAL] (1) patients[6].add.y = patients[6].valve_out.opening ($RES_SIM_437) (32) [SCAL] (1) 9.80665 * bellJar.M + bellJar.damper.flange_b.f + bellJar.piston.flange_a.f = 0.0 ($RES_SIM_262) (33) [SCAL] (1) patients[7].add.y = patients[7].valve_out.opening ($RES_SIM_438) (34) [SCAL] (1) patients[8].add.y = patients[8].valve_out.opening ($RES_SIM_439) (35) [ARRY] (10) dutyCycle.y = patientControllers.dutyCycle ($RES_SIM_265) (36) [ARRY] (10) RR.y = patientControllers.RR ($RES_SIM_266) (37) [ARRY] (10) patientControllers.opening = patients.valveCommand ($RES_SIM_267) (38) [SCAL] (1) patients[7].valve_in.outlet.p = patients[7].valve_out.inlet.p ($RES_SIM_350) (39) [SCAL] (1) patients[7].valve_in.outlet.p = patients[7].resistance.inlet.p ($RES_SIM_351) (40) [SCAL] (1) patients[7].valve_in.outlet.p = patients[7].leak.inlet.p ($RES_SIM_352) (41) [SCAL] (1) patients[8].valve_in.outlet.p = patients[8].valve_out.inlet.p ($RES_SIM_353) (42) [SCAL] (1) patients[8].valve_in.outlet.p = patients[8].resistance.inlet.p ($RES_SIM_354) (43) [SCAL] (1) patients[8].valve_in.outlet.p = patients[8].leak.inlet.p ($RES_SIM_355) (44) [SCAL] (1) patients[9].valve_in.outlet.p = patients[9].valve_out.inlet.p ($RES_SIM_356) (45) [SCAL] (1) patients[9].valve_in.outlet.p = patients[9].resistance.inlet.p ($RES_SIM_357) (46) [SCAL] (1) supplyValveOnOff.q = -supplyValveOnOff.outlet.w / supplyValveOnOff.air.rho ($RES_SIM_182) (47) [SCAL] (1) patients[9].valve_in.outlet.p = patients[9].leak.inlet.p ($RES_SIM_358) (48) [SCAL] (1) -supplyValveOnOff.outlet.w = homotopy($FUN_1 * onOffControllerWithHysteresis.valveOpening * supplyValveOnOff.Av * (supplyValveOnOff.dp / (supplyValveOnOff.dp * supplyValveOnOff.dp + supplyValveOnOff.dpnom * supplyValveOnOff.delta * (supplyValveOnOff.dpnom * supplyValveOnOff.delta)) ^ 0.25), supplyValveOnOff.dp * (supplyValveOnOff.wnom / supplyValveOnOff.dpnom) * onOffControllerWithHysteresis.valveOpening) ($RES_SIM_183) (49) [SCAL] (1) patients[10].valve_in.outlet.p = patients[10].valve_out.inlet.p ($RES_SIM_359) (50) [SCAL] (1) supplyValveOnOff.dp = pressureSource.prel - supplyValveModulating.pout ($RES_SIM_184) (51) [SCAL] (1) supplyValveOnOff.air.rho = (0.0034878994784483773 * (pressureSource.prel + ambient.p)) / ambient.T ($RES_SIM_185) (52) [SCAL] (1) patients[9].add.y = patients[9].valve_out.opening ($RES_SIM_440) (53) [SCAL] (1) patients[10].add.y = patients[10].valve_out.opening ($RES_SIM_441) (54) [SCAL] (1) pipeSegments[9].outlet.w + pipeSegments[10].inlet.w + patients[9].supply.w = 0.0 ($RES_SIM_272) (55) [SCAL] (1) pipeSegments[8].outlet.w + pipeSegments[9].inlet.w + patients[8].supply.w = 0.0 ($RES_SIM_273) (56) [SCAL] (1) pipeSegments[7].outlet.w + pipeSegments[8].inlet.w + patients[7].supply.w = 0.0 ($RES_SIM_274) (57) [SCAL] (1) pipeSegments[6].outlet.w + pipeSegments[7].inlet.w + patients[6].supply.w = 0.0 ($RES_SIM_275) (58) [SCAL] (1) pipeSegments[5].outlet.w + pipeSegments[6].inlet.w + patients[5].supply.w = 0.0 ($RES_SIM_276) (59) [SCAL] (1) pipeSegments[4].outlet.w + pipeSegments[5].inlet.w + patients[4].supply.w = 0.0 ($RES_SIM_277) (60) [SCAL] (1) pipeSegments[3].outlet.w + pipeSegments[4].inlet.w + patients[3].supply.w = 0.0 ($RES_SIM_278) (61) [SCAL] (1) pipeSegments[2].outlet.w + pipeSegments[3].inlet.w + patients[2].supply.w = 0.0 ($RES_SIM_279) (62) [SCAL] (1) patients[10].valve_in.outlet.p = patients[10].resistance.inlet.p ($RES_SIM_360) (63) [SCAL] (1) patients[10].valve_in.outlet.p = patients[10].leak.inlet.p ($RES_SIM_361) (64) [SCAL] (1) patients[1].valveCommand = patients[1].valve_in.opening ($RES_SIM_362) (65) [SCAL] (1) patients[1].valveCommand = patients[1].add.u2 ($RES_SIM_363) (66) [SCAL] (1) patients[2].valveCommand = patients[2].valve_in.opening ($RES_SIM_364) (67) [SCAL] (1) bellJar.damper.v_rel = $DER.bellJar.damper.s_rel ($RES_SIM_190) (68) [SCAL] (1) patients[2].valveCommand = patients[2].add.u2 ($RES_SIM_365) (69) [SCAL] (1) bellJar.damper.s_rel = (bellJar.piston.s - 0.5 * bellJar.piston.L) - bellJar.fixed.s0 ($RES_SIM_191) (70) [SCAL] (1) patients[3].valveCommand = patients[3].valve_in.opening ($RES_SIM_366) (71) [SCAL] (1) bellJar.damper.lossPower = bellJar.damper.flange_b.f * bellJar.damper.v_rel ($RES_SIM_192) (72) [SCAL] (1) patients[3].valveCommand = patients[3].add.u2 ($RES_SIM_367) (73) [SCAL] (1) bellJar.damper.flange_b.f = bellJar.damper.d * bellJar.damper.v_rel ($RES_SIM_193) (74) [SCAL] (1) patients[4].valveCommand = patients[4].valve_in.opening ($RES_SIM_368) (75) [SCAL] (1) patients[4].valveCommand = patients[4].add.u2 ($RES_SIM_369) (76) [SCAL] (1) bellJar.force.s = bellJar.piston.s - 0.5 * bellJar.piston.L ($RES_SIM_196) (77) [SCAL] (1) $TEV_0 = time < 5.0 ($RES_EVT_498) (78) [FOR-] (10) ($RES_EVT_499) (78) [----] for $i1 in 1:10 loop (78) [----] [SCAL] (1) $SEV_0[$i1] = patientControllers[$i1].RR > 1.0 ($RES_EVT_500) (78) [----] end for; (79) [SCAL] (1) pipeSegments[1].outlet.w + pipeSegments[2].inlet.w + patients[1].supply.w = 0.0 ($RES_SIM_280) (80) [SCAL] (1) pipeSegments[10].outlet.p = patients[10].supply.p ($RES_SIM_281) (81) [SCAL] (1) pipeSegments[9].outlet.p = patients[9].supply.p ($RES_SIM_282) (82) [SCAL] (1) pipeSegments[9].outlet.p = pipeSegments[10].inlet.p ($RES_SIM_283) (83) [SCAL] (1) pipeSegments[8].outlet.p = patients[8].supply.p ($RES_SIM_284) (84) [SCAL] (1) pipeSegments[8].outlet.p = pipeSegments[9].inlet.p ($RES_SIM_285) (85) [SCAL] (1) pipeSegments[7].outlet.p = patients[7].supply.p ($RES_SIM_286) (86) [SCAL] (1) pipeSegments[7].outlet.p = pipeSegments[8].inlet.p ($RES_SIM_287) (87) [SCAL] (1) pipeSegments[6].outlet.p = patients[6].supply.p ($RES_SIM_288) (88) [SCAL] (1) pipeSegments[6].outlet.p = pipeSegments[7].inlet.p ($RES_SIM_289) (89) [SCAL] (1) patients[5].valveCommand = patients[5].valve_in.opening ($RES_SIM_370) (90) [SCAL] (1) patients[5].valveCommand = patients[5].add.u2 ($RES_SIM_371) (91) [SCAL] (1) patients[6].valveCommand = patients[6].valve_in.opening ($RES_SIM_372) (92) [SCAL] (1) patients[6].valveCommand = patients[6].add.u2 ($RES_SIM_373) (93) [SCAL] (1) patients[7].valveCommand = patients[7].valve_in.opening ($RES_SIM_374) (94) [SCAL] (1) patients[7].valveCommand = patients[7].add.u2 ($RES_SIM_375) (95) [SCAL] (1) patients[8].valveCommand = patients[8].valve_in.opening ($RES_SIM_376) (96) [SCAL] (1) patients[8].valveCommand = patients[8].add.u2 ($RES_SIM_377) (97) [SCAL] (1) patients[9].valveCommand = patients[9].valve_in.opening ($RES_SIM_378) (98) [SCAL] (1) patients[9].valveCommand = patients[9].add.u2 ($RES_SIM_379) (99) [SCAL] (1) pipeSegments[5].outlet.p = patients[5].supply.p ($RES_SIM_290) (100) [SCAL] (1) pipeSegments[5].outlet.p = pipeSegments[6].inlet.p ($RES_SIM_291) (101) [SCAL] (1) pipeSegments[4].outlet.p = patients[4].supply.p ($RES_SIM_292) (102) [SCAL] (1) pipeSegments[4].outlet.p = pipeSegments[5].inlet.p ($RES_SIM_293) (103) [SCAL] (1) pipeSegments[3].outlet.p = patients[3].supply.p ($RES_SIM_294) (104) [SCAL] (1) pipeSegments[3].outlet.p = pipeSegments[4].inlet.p ($RES_SIM_295) (105) [SCAL] (1) pipeSegments[2].outlet.p = patients[2].supply.p ($RES_SIM_296) (106) [SCAL] (1) pipeSegments[2].outlet.p = pipeSegments[3].inlet.p ($RES_SIM_297) (107) [SCAL] (1) pipeSegments[1].outlet.p = patients[1].supply.p ($RES_SIM_298) (108) [SCAL] (1) pipeSegments[1].outlet.p = pipeSegments[2].inlet.p ($RES_SIM_299) (109) [SCAL] (1) patients[10].valveCommand = patients[10].valve_in.opening ($RES_SIM_380) (110) [SCAL] (1) patients[10].valveCommand = patients[10].add.u2 ($RES_SIM_381) (111) [SCAL] (1) patients[1].add.u1 = patients[1].one.y ($RES_SIM_382) (112) [SCAL] (1) patients[2].add.u1 = patients[2].one.y ($RES_SIM_383) (113) [SCAL] (1) patients[3].add.u1 = patients[3].one.y ($RES_SIM_384) (114) [SCAL] (1) patients[4].add.u1 = patients[4].one.y ($RES_SIM_385) (115) [SCAL] (1) patients[5].add.u1 = patients[5].one.y ($RES_SIM_386) (116) [SCAL] (1) patients[6].add.u1 = patients[6].one.y ($RES_SIM_387) (117) [SCAL] (1) patients[7].add.u1 = patients[7].one.y ($RES_SIM_388) (118) [SCAL] (1) patients[8].add.u1 = patients[8].one.y ($RES_SIM_389) (119) [SCAL] (1) patients[9].add.u1 = patients[9].one.y ($RES_SIM_390) (120) [SCAL] (1) patients[10].add.u1 = patients[10].one.y ($RES_SIM_391) (121) [SCAL] (1) patients[1].valve_in.inlet.w - patients[1].supply.w = 0.0 ($RES_SIM_392) (122) [SCAL] (1) patients[1].supply.p = patients[1].valve_in.inlet.p ($RES_SIM_393) (123) [SCAL] (1) patients[2].valve_in.inlet.w - patients[2].supply.w = 0.0 ($RES_SIM_394) (124) [SCAL] (1) patients[2].supply.p = patients[2].valve_in.inlet.p ($RES_SIM_395) (125) [SCAL] (1) patients[3].valve_in.inlet.w - patients[3].supply.w = 0.0 ($RES_SIM_396) (126) [SCAL] (1) patients[3].supply.p = patients[3].valve_in.inlet.p ($RES_SIM_397) (127) [SCAL] (1) patients[4].valve_in.inlet.w - patients[4].supply.w = 0.0 ($RES_SIM_398) (128) [SCAL] (1) patients[4].supply.p = patients[4].valve_in.inlet.p ($RES_SIM_399) (129) [FOR-] (10) ($RES_SIM_22) (129) [----] for $i1 in 1:10 loop (129) [----] [SCAL] (1) dutyCycle[$i1].y = dutyCycle[$i1].offset + (if $SEV_2[$i1] then 0.0 else dutyCycle[$i1].height) ($RES_SIM_23) (129) [----] end for; (130) [FOR-] (10) ($RES_SIM_24) (130) [----] for $i1 in 1:10 loop (130) [----] [SCAL] (1) RR[$i1].y = RR[$i1].offset + (if $SEV_3[$i1] then 0.0 else RR[$i1].height) ($RES_SIM_25) (130) [----] end for; (131) [FOR-] (10) ($RES_SIM_26) (131) [----] for $i1 in 1:10 loop (131) [----] [SCAL] (1) patientControllers[$i1].opening = if $SEV_5[$i1] then 1.0 else 0.0 ($RES_SIM_27) (131) [----] end for; (132) [FOR-] (10) ($RES_SIM_28) (132) [----] for $i1 in 1:10 loop (132) [----] [WHEN] (1)when $SEV_6[$i1] then (132) [----] [----] patientControllers[$i1].t_on := time + 60.0 / patientControllers[$i1].RR (132) [----] [----] end when; (132) [----] end for; (133) [FOR-] (10) ($RES_SIM_30) (133) [----] for $i1 in 1:10 loop (133) [----] [WHEN] (1)when $SEV_6[$i1] then (133) [----] [----] patientControllers[$i1].t_off := time + (patientControllers[$i1].dutyCycle * (60.0 / patientControllers[$i1].RR)) / 100.0 (133) [----] [----] end when; (133) [----] end for; (134) [FOR-] (10) ($RES_SIM_32) (134) [----] for $i1 in 1:10 loop (134) [----] [WHEN] (1)when $SEV_7[$i1] then (134) [----] [----] patientControllers[$i1].active := false (134) [----] [----] else when $SEV_0[$i1] then (134) [----] [----] patientControllers[$i1].active := true (134) [----] [----] end when; (134) [----] end for; (135) [SCAL] (1) supplyValveModulating.opening = 0.0 ($RES_SIM_34) (136) [SCAL] (1) linearController.feedback.y = linearController.level_sp - (bellJar.piston.s - 0.5 * bellJar.piston.L) ($RES_SIM_35) (137) [SCAL] (1) $DER.linearController.firstOrder.y = (linearController.firstOrder.k * linearController.feedback.y - linearController.firstOrder.y) / linearController.firstOrder.T ($RES_SIM_36) (138) [SCAL] (1) onOffControllerWithHysteresis.valveOpening = if onOffControllerWithHysteresis.on then 1.0 else 0.0 ($RES_SIM_37) (139) [WHEN] (1)when $SEV_8 then (139) [----] onOffControllerWithHysteresis.on := true (139) [----] else when $SEV_9 then (139) [----] onOffControllerWithHysteresis.on := false (139) [----] end when; (140) [SCAL] (1) supplyValveModulating.q = -supplyValveModulating.outlet.w / supplyValveModulating.air.rho ($RES_SIM_44) (141) [SCAL] (1) -supplyValveModulating.outlet.w = homotopy($FUN_5 * supplyValveModulating.opening * supplyValveModulating.Av * (supplyValveModulating.dp / (supplyValveModulating.dp * supplyValveModulating.dp + supplyValveModulating.dpnom * supplyValveModulating.delta * (supplyValveModulating.dpnom * supplyValveModulating.delta)) ^ 0.25), supplyValveModulating.dp * (supplyValveModulating.wnom / supplyValveModulating.dpnom) * supplyValveModulating.opening) ($RES_SIM_45) (142) [SCAL] (1) supplyValveModulating.dp = pressureSource.prel - supplyValveModulating.pout ($RES_SIM_46) (143) [SCAL] (1) supplyValveModulating.air.rho = (0.0034878994784483773 * (pressureSource.prel + ambient.p)) / ambient.T ($RES_SIM_47) (144) [FOR-] (10) ($RES_SIM_48) (144) [----] for $i1 in 1:10 loop (144) [----] [SCAL] (1) patients[$i1].atmosphere.port.p = patients[$i1].atmosphere.prel ($RES_SIM_49) (144) [----] end for; (145) [FOR-] (10) ($RES_SIM_50) (145) [----] for $i1 in 1:10 loop (145) [----] [SCAL] (1) patients[$i1].leak.outlet.p = patients[$i1].leak.pout ($RES_SIM_51) (145) [----] end for; (146) [FOR-] (10) ($RES_SIM_52) (146) [----] for $i1 in 1:10 loop (146) [----] [SCAL] (1) patients[$i1].leak.inlet.p = patients[$i1].leak.pin ($RES_SIM_53) (146) [----] end for; (147) [FOR-] (10) ($RES_SIM_54) (147) [----] for $i1 in 1:10 loop (147) [----] [SCAL] (1) patients[$i1].leak.outlet.w = -patients[$i1].leak.w ($RES_SIM_55) (147) [----] end for; (148) [FOR-] (10) ($RES_SIM_56) (148) [----] for $i1 in 1:10 loop (148) [----] [SCAL] (1) patients[$i1].leak.inlet.w = patients[$i1].leak.w ($RES_SIM_57) (148) [----] end for; (149) [FOR-] (10) ($RES_SIM_58) (149) [----] for $i1 in 1:10 loop (149) [----] [SCAL] (1) patients[$i1].leak.air.p = patients[$i1].leak.pin + ambient.p ($RES_SIM_59) (149) [----] end for; (150) [FOR-] (10) ($RES_SIM_100) (150) [----] for $i1 in 1:10 loop (150) [----] [SCAL] (1) patients[$i1].valve_out.dp = patients[$i1].valve_out.pin - patients[$i1].valve_out.pout ($RES_SIM_101) (150) [----] end for; (151) [FOR-] (10) ($RES_SIM_102) (151) [----] for $i1 in 1:10 loop (151) [----] [SCAL] (1) patients[$i1].valve_out.air.rho = patients[$i1].valve_out.air.p / (patients[$i1].valve_out.air.Tref * 286.7055103448276) ($RES_SIM_103) (151) [----] end for; (152) [FOR-] (10) ($RES_SIM_104) (152) [----] for $i1 in 1:10 loop (152) [----] [SCAL] (1) patients[$i1].peep.port.p = patients[$i1].peep.prel ($RES_SIM_105) (152) [----] end for; (153) [FOR-] (10) ($RES_SIM_106) (153) [----] for $i1 in 1:10 loop (153) [----] [SCAL] (1) patients[$i1].resistance.pout = patients[$i1].resistance.outlet.p ($RES_SIM_107) (153) [----] end for; (154) [FOR-] (10) ($RES_SIM_108) (154) [----] for $i1 in 1:10 loop (154) [----] [SCAL] (1) patients[$i1].resistance.pin = patients[$i1].resistance.inlet.p ($RES_SIM_109) (154) [----] end for; (155) [FOR-] (10) ($RES_SIM_60) (155) [----] for $i1 in 1:10 loop (155) [----] [SCAL] (1) patients[$i1].leak.q = patients[$i1].leak.w / patients[$i1].leak.air.rho ($RES_SIM_61) (155) [----] end for; (156) [FOR-] (10) ($RES_SIM_62) (156) [----] for $i1 in 1:10 loop (156) [----] [SCAL] (1) patients[$i1].leak.w = homotopy($FUN_4[$i1] * patients[$i1].leak.opening * patients[$i1].leak.Av * (patients[$i1].leak.dp / (patients[$i1].leak.dp * patients[$i1].leak.dp + patients[$i1].leak.dpnom * patients[$i1].leak.delta * (patients[$i1].leak.dpnom * patients[$i1].leak.delta)) ^ 0.25), patients[$i1].leak.dp * (patients[$i1].leak.wnom / patients[$i1].leak.dpnom) * patients[$i1].leak.opening) ($RES_SIM_63) (156) [----] end for; (157) [FOR-] (10) ($RES_SIM_64) (157) [----] for $i1 in 1:10 loop (157) [----] [SCAL] (1) patients[$i1].leak.dp = patients[$i1].leak.pin - patients[$i1].leak.pout ($RES_SIM_65) (157) [----] end for; (158) [FOR-] (10) ($RES_SIM_66) (158) [----] for $i1 in 1:10 loop (158) [----] [SCAL] (1) patients[$i1].leak.air.rho = patients[$i1].leak.air.p / (patients[$i1].leak.air.Tref * 286.7055103448276) ($RES_SIM_67) (158) [----] end for; (159) [FOR-] (10) ($RES_SIM_68) (159) [----] for $i1 in 1:10 loop (159) [----] [SCAL] (1) patients[$i1].one.y = patients[$i1].one.k ($RES_SIM_69) (159) [----] end for; (160) [FOR-] (10) ($RES_SIM_110) (160) [----] for $i1 in 1:10 loop (160) [----] [SCAL] (1) patients[$i1].resistance.w = -patients[$i1].resistance.outlet.w ($RES_SIM_111) (160) [----] end for; (161) [FOR-] (10) ($RES_SIM_112) (161) [----] for $i1 in 1:10 loop (161) [----] [SCAL] (1) patients[$i1].resistance.w = patients[$i1].resistance.inlet.w ($RES_SIM_113) (161) [----] end for; (162) [FOR-] (10) ($RES_SIM_114) (162) [----] for $i1 in 1:10 loop (162) [----] [SCAL] (1) patients[$i1].resistance.air.p = patients[$i1].resistance.pin + ambient.p ($RES_SIM_115) (162) [----] end for; (163) [FOR-] (10) ($RES_SIM_116) (163) [----] for $i1 in 1:10 loop (163) [----] [SCAL] (1) patients[$i1].resistance.dp = patients[$i1].resistance.R * patients[$i1].resistance.q ($RES_SIM_117) (163) [----] end for; (164) [FOR-] (10) ($RES_SIM_118) (164) [----] for $i1 in 1:10 loop (164) [----] [SCAL] (1) patients[$i1].resistance.q = patients[$i1].resistance.w / patients[$i1].resistance.air.rho ($RES_SIM_119) (164) [----] end for; (165) [FOR-] (10) ($RES_SIM_70) (165) [----] for $i1 in 1:10 loop (165) [----] [SCAL] (1) patients[$i1].add.y = patients[$i1].add.k1 * patients[$i1].add.u1 + patients[$i1].add.k2 * patients[$i1].add.u2 ($RES_SIM_71) (165) [----] end for; (166) [SCAL] (1) bellJar.piston.m * bellJar.piston.a = bellJar.piston.flange_a.f + bellJar.cylinder.F ($RES_SIM_200) (167) [FOR-] (10) ($RES_SIM_72) (167) [----] for $i1 in 1:10 loop (167) [----] [SCAL] (1) patients[$i1].compliance.p = patients[$i1].compliance.port.p ($RES_SIM_73) (167) [----] end for; (168) [SCAL] (1) $FUN_1 = sqrt(supplyValveOnOff.air.rho) ($RES_$AUX_485) (169) [SCAL] (1) bellJar.piston.a = $DER.bellJar.piston.v ($RES_SIM_201) (170) [SCAL] (1) bellJar.piston.v = $DER.bellJar.piston.s ($RES_SIM_202) (171) [FOR-] (10) ($RES_SIM_74) (171) [----] for $i1 in 1:10 loop (171) [----] [SCAL] (1) patients[$i1].compliance.w = patients[$i1].compliance.port.w ($RES_SIM_75) (171) [----] end for; (172) [FOR-] (10) ($RES_$AUX_483) (172) [----] for $i1 in 1:10 loop (172) [----] [SCAL] (1) $FUN_2[$i1] = sqrt(patients[$i1].valve_in.air.rho) ($RES_$AUX_484) (172) [----] end for; (173) [FOR-] (10) ($RES_SIM_76) (173) [----] for $i1 in 1:10 loop (173) [----] [SCAL] (1) patients[$i1].compliance.air.p = ambient.p ($RES_SIM_77) (173) [----] end for; (174) [FOR-] (10) ($RES_$AUX_481) (174) [----] for $i1 in 1:10 loop (174) [----] [SCAL] (1) $FUN_3[$i1] = sqrt(patients[$i1].valve_out.air.rho) ($RES_$AUX_482) (174) [----] end for; (175) [SCAL] (1) $SEV_1 = bellJar.piston.s - 0.5 * bellJar.piston.L < onOffControllerWithHysteresis.level_max ($RES_EVT_501) (176) [FOR-] (10) ($RES_SIM_78) (176) [----] for $i1 in 1:10 loop (176) [----] [SCAL] (1) $DER.patients[$i1].compliance.Vb = max($DER.patients[$i1].compliance.V, 0.0) ($RES_SIM_79) (176) [----] end for; (177) [FOR-] (10) ($RES_EVT_502) (177) [----] for $i1 in 1:10 loop (177) [----] [SCAL] (1) $SEV_2[$i1] = time < dutyCycle[$i1].startTime ($RES_EVT_503) (177) [----] end for; (178) [FOR-] (10) ($RES_EVT_504) (178) [----] for $i1 in 1:10 loop (178) [----] [SCAL] (1) $SEV_3[$i1] = time < RR[$i1].startTime ($RES_EVT_505) (178) [----] end for; (179) [FOR-] (10) ($RES_EVT_506) (179) [----] for $i1 in 1:10 loop (179) [----] [SCAL] (1) $SEV_4[$i1] = time < patientControllers[$i1].t_off ($RES_EVT_507) (179) [----] end for; (180) [FOR-] (10) ($RES_EVT_508) (180) [----] for $i1 in 1:10 loop (180) [----] [SCAL] (1) $SEV_5[$i1] = patientControllers[$i1].active and $SEV_4[$i1] ($RES_EVT_509) (180) [----] end for; (181) [FOR-] (10) ($RES_SIM_120) (181) [----] for $i1 in 1:10 loop (181) [----] [SCAL] (1) patients[$i1].resistance.dp = patients[$i1].resistance.pin - patients[$i1].resistance.pout ($RES_SIM_121) (181) [----] end for; (182) [FOR-] (10) ($RES_SIM_122) (182) [----] for $i1 in 1:10 loop (182) [----] [SCAL] (1) patients[$i1].resistance.air.rho = (patients[$i1].resistance.air.pref / (patients[$i1].resistance.air.Tref * 286.7055103448276)) * (1.0 + ((patients[$i1].resistance.air.p - patients[$i1].resistance.air.pref) / patients[$i1].resistance.air.pref) / 1.4) ($RES_SIM_123) (182) [----] end for; (183) [FOR-] (10) ($RES_SIM_124) (183) [----] for $i1 in 1:10 loop (183) [----] [SCAL] (1) patients[$i1].valve_in.outlet.p = patients[$i1].valve_in.pout ($RES_SIM_125) (183) [----] end for; (184) [FOR-] (10) ($RES_SIM_126) (184) [----] for $i1 in 1:10 loop (184) [----] [SCAL] (1) patients[$i1].valve_in.inlet.p = patients[$i1].valve_in.pin ($RES_SIM_127) (184) [----] end for; (185) [FOR-] (10) ($RES_SIM_128) (185) [----] for $i1 in 1:10 loop (185) [----] [SCAL] (1) patients[$i1].valve_in.outlet.w = -patients[$i1].valve_in.w ($RES_SIM_129) (185) [----] end for; (186) [FOR-] (10) ($RES_$AUX_479) (186) [----] for $i1 in 1:10 loop (186) [----] [SCAL] (1) $FUN_4[$i1] = sqrt(patients[$i1].leak.air.rho) ($RES_$AUX_480) (186) [----] end for; (187) [SCAL] (1) $FUN_5 = sqrt(supplyValveModulating.air.rho) ($RES_$AUX_478) (188) [FOR-] (10) ($RES_SIM_80) (188) [----] for $i1 in 1:10 loop (188) [----] [SCAL] (1) $DER.patients[$i1].compliance.V = patients[$i1].compliance.w / patients[$i1].compliance.air.rho ($RES_SIM_81) (188) [----] end for; (189) [FOR-] (10) ($RES_SIM_82) (189) [----] for $i1 in 1:10 loop (189) [----] [SCAL] (1) patients[$i1].compliance.C * $DER.patients[$i1].compliance.p = patients[$i1].compliance.w / patients[$i1].compliance.air.rho ($RES_SIM_83) (189) [----] end for; (190) [SCAL] (1) bellJar.cylinder.F = supplyValveModulating.pout * bellJar.cylinder.A ($RES_SIM_211) (191) [SCAL] (1) bellJar.cylinder.air.p = supplyValveModulating.pout + ambient.p ($RES_SIM_212) (192) [FOR-] (10) ($RES_SIM_84) (192) [----] for $i1 in 1:10 loop (192) [----] [SCAL] (1) patients[$i1].compliance.air.rho = patients[$i1].compliance.air.p / (patients[$i1].compliance.air.Tref * 286.7055103448276) ($RES_SIM_85) (192) [----] end for; (193) [SCAL] (1) bellJar.cylinder.M = bellJar.cylinder.air.rho * bellJar.cylinder.V ($RES_SIM_213) (194) [SCAL] (1) bellJar.cylinder.V = bellJar.cylinder.A * (bellJar.piston.s + 0.5 * bellJar.piston.L) ($RES_SIM_214) (195) [FOR-] (10) ($RES_SIM_86) (195) [----] for $i1 in 1:10 loop (195) [----] [SCAL] (1) patients[$i1].valve_out.outlet.p = patients[$i1].valve_out.pout ($RES_SIM_87) (195) [----] end for; (196) [FOR-] (10) ($RES_EVT_510) (196) [----] for $i1 in 1:10 loop (196) [----] [SCAL] (1) $SEV_6[$i1] = $PRE.patientControllers.active and time >= $PRE.patientControllers.t_on ($RES_EVT_511) (196) [----] end for; (197) [SCAL] (1) $DER.bellJar.cylinder.M = bellJar.cylinder.w_in - bellJar.cylinder.w_out ($RES_SIM_215) (198) [SCAL] (1) bellJar.cylinder.air.rho = ((0.0034878994784483773 * ambient.p) / ambient.T) * (1.0 + 0.7142857142857143 * ((bellJar.cylinder.air.p - ambient.p) / ambient.p)) ($RES_SIM_216) (199) [FOR-] (10) ($RES_SIM_88) (199) [----] for $i1 in 1:10 loop (199) [----] [SCAL] (1) patients[$i1].valve_out.inlet.p = patients[$i1].valve_out.pin ($RES_SIM_89) (199) [----] end for; (200) [FOR-] (10) ($RES_EVT_512) (200) [----] for $i1 in 1:10 loop (200) [----] [SCAL] (1) $SEV_7[$i1] = patientControllers[$i1].RR < 1.0 ($RES_EVT_513) (200) [----] end for; (201) [SCAL] (1) patients[10].valve_out.inlet.w + patients[10].resistance.inlet.w + patients[10].valve_in.outlet.w + patients[10].leak.inlet.w = 0.0 ($RES_SIM_217) (202) [SCAL] (1) patients[9].valve_out.inlet.w + patients[9].resistance.inlet.w + patients[9].valve_in.outlet.w + patients[9].leak.inlet.w = 0.0 ($RES_SIM_218) (203) [SCAL] (1) $SEV_8 = bellJar.piston.s - 0.5 * bellJar.piston.L < onOffControllerWithHysteresis.level_min ($RES_EVT_514) (204) [SCAL] (1) patients[8].valve_out.inlet.w + patients[8].resistance.inlet.w + patients[8].valve_in.outlet.w + patients[8].leak.inlet.w = 0.0 ($RES_SIM_219) (205) [SCAL] (1) $SEV_9 = bellJar.piston.s - 0.5 * bellJar.piston.L > onOffControllerWithHysteresis.level_max ($RES_EVT_515) (206) [SCAL] (1) supplyValveModulating.pout = pipeSegments[1].inlet.p ($RES_SIM_300) (207) [FOR-] (10) ($RES_SIM_130) (207) [----] for $i1 in 1:10 loop (207) [----] [SCAL] (1) patients[$i1].valve_in.inlet.w = patients[$i1].valve_in.w ($RES_SIM_131) (207) [----] end for; (208) [FOR-] (10) ($RES_SIM_132) (208) [----] for $i1 in 1:10 loop (208) [----] [SCAL] (1) patients[$i1].valve_in.air.p = patients[$i1].valve_in.pin + ambient.p ($RES_SIM_133) (208) [----] end for; (209) [FOR-] (10) ($RES_SIM_134) (209) [----] for $i1 in 1:10 loop (209) [----] [SCAL] (1) patients[$i1].valve_in.q = patients[$i1].valve_in.w / patients[$i1].valve_in.air.rho ($RES_SIM_135) (209) [----] end for; (210) [FOR-] (10) ($RES_SIM_136) (210) [----] for $i1 in 1:10 loop (210) [----] [SCAL] (1) patients[$i1].valve_in.w = homotopy($FUN_2[$i1] * patients[$i1].valve_in.opening * patients[$i1].valve_in.Av * (patients[$i1].valve_in.dp / (patients[$i1].valve_in.dp * patients[$i1].valve_in.dp + patients[$i1].valve_in.dpnom * patients[$i1].valve_in.delta * (patients[$i1].valve_in.dpnom * patients[$i1].valve_in.delta)) ^ 0.25), patients[$i1].valve_in.dp * (patients[$i1].valve_in.wnom / patients[$i1].valve_in.dpnom) * patients[$i1].valve_in.opening) ($RES_SIM_137) (210) [----] end for; (211) [FOR-] (10) ($RES_SIM_138) (211) [----] for $i1 in 1:10 loop (211) [----] [SCAL] (1) patients[$i1].valve_in.dp = patients[$i1].valve_in.pin - patients[$i1].valve_in.pout ($RES_SIM_139) (211) [----] end for; (212) [FOR-] (10) ($RES_SIM_90) (212) [----] for $i1 in 1:10 loop (212) [----] [SCAL] (1) patients[$i1].valve_out.outlet.w = -patients[$i1].valve_out.w ($RES_SIM_91) (212) [----] end for; (213) [SCAL] (1) patients[7].valve_out.inlet.w + patients[7].resistance.inlet.w + patients[7].valve_in.outlet.w + patients[7].leak.inlet.w = 0.0 ($RES_SIM_220) (214) [FOR-] (10) ($RES_SIM_92) (214) [----] for $i1 in 1:10 loop (214) [----] [SCAL] (1) patients[$i1].valve_out.inlet.w = patients[$i1].valve_out.w ($RES_SIM_93) (214) [----] end for; (215) [SCAL] (1) patients[6].valve_out.inlet.w + patients[6].resistance.inlet.w + patients[6].valve_in.outlet.w + patients[6].leak.inlet.w = 0.0 ($RES_SIM_221) (216) [SCAL] (1) patients[5].valve_out.inlet.w + patients[5].resistance.inlet.w + patients[5].valve_in.outlet.w + patients[5].leak.inlet.w = 0.0 ($RES_SIM_222) (217) [FOR-] (10) ($RES_SIM_94) (217) [----] for $i1 in 1:10 loop (217) [----] [SCAL] (1) patients[$i1].valve_out.air.p = patients[$i1].valve_out.pin + ambient.p ($RES_SIM_95) (217) [----] end for; (218) [SCAL] (1) patients[4].valve_out.inlet.w + patients[4].resistance.inlet.w + patients[4].valve_in.outlet.w + patients[4].leak.inlet.w = 0.0 ($RES_SIM_223) (219) [SCAL] (1) patients[3].valve_out.inlet.w + patients[3].resistance.inlet.w + patients[3].valve_in.outlet.w + patients[3].leak.inlet.w = 0.0 ($RES_SIM_224) (220) [FOR-] (10) ($RES_SIM_96) (220) [----] for $i1 in 1:10 loop (220) [----] [SCAL] (1) patients[$i1].valve_out.q = patients[$i1].valve_out.w / patients[$i1].valve_out.air.rho ($RES_SIM_97) (220) [----] end for; (221) [SCAL] (1) patients[2].valve_out.inlet.w + patients[2].resistance.inlet.w + patients[2].valve_in.outlet.w + patients[2].leak.inlet.w = 0.0 ($RES_SIM_225) (222) [SCAL] (1) patients[1].valve_out.inlet.w + patients[1].resistance.inlet.w + patients[1].valve_in.outlet.w + patients[1].leak.inlet.w = 0.0 ($RES_SIM_226) (223) [FOR-] (10) ($RES_SIM_98) (223) [----] for $i1 in 1:10 loop (223) [----] [SCAL] (1) patients[$i1].valve_out.w = homotopy($FUN_3[$i1] * patients[$i1].valve_out.opening * patients[$i1].valve_out.Av * (patients[$i1].valve_out.dp / (patients[$i1].valve_out.dp * patients[$i1].valve_out.dp + patients[$i1].valve_out.dpnom * patients[$i1].valve_out.delta * (patients[$i1].valve_out.dpnom * patients[$i1].valve_out.delta)) ^ 0.25), patients[$i1].valve_out.dp * (patients[$i1].valve_out.wnom / patients[$i1].valve_out.dpnom) * patients[$i1].valve_out.opening) ($RES_SIM_99) (223) [----] end for; (224) [SCAL] (1) patients[10].peep.port.w + patients[10].valve_out.outlet.w = 0.0 ($RES_SIM_227) (225) [SCAL] (1) patients[9].peep.port.w + patients[9].valve_out.outlet.w = 0.0 ($RES_SIM_228) (226) [SCAL] (1) patients[8].peep.port.w + patients[8].valve_out.outlet.w = 0.0 ($RES_SIM_229) (227) [SCAL] (1) patients[1].leak.outlet.p = patients[1].atmosphere.port.p ($RES_SIM_312) (228) [SCAL] (1) patients[2].leak.outlet.p = patients[2].atmosphere.port.p ($RES_SIM_313) (229) [SCAL] (1) patients[3].leak.outlet.p = patients[3].atmosphere.port.p ($RES_SIM_314) (230) [SCAL] (1) patients[4].leak.outlet.p = patients[4].atmosphere.port.p ($RES_SIM_315) (231) [FOR-] (10) ($RES_SIM_140) (231) [----] for $i1 in 1:10 loop (231) [----] [SCAL] (1) patients[$i1].valve_in.air.rho = patients[$i1].valve_in.air.p / (patients[$i1].valve_in.air.Tref * 286.7055103448276) ($RES_SIM_141) (231) [----] end for; (232) [SCAL] (1) patients[5].leak.outlet.p = patients[5].atmosphere.port.p ($RES_SIM_316) (233) [SCAL] (1) patients[6].leak.outlet.p = patients[6].atmosphere.port.p ($RES_SIM_317) (234) [FOR-] (10) ($RES_SIM_142) (234) [----] for $i1 in 1:10 loop (234) [----] [SCAL] (1) pipeSegments[$i1].pout = pipeSegments[$i1].outlet.p ($RES_SIM_143) (234) [----] end for; (235) [SCAL] (1) patients[7].leak.outlet.p = patients[7].atmosphere.port.p ($RES_SIM_318) (236) [SCAL] (1) patients[8].leak.outlet.p = patients[8].atmosphere.port.p ($RES_SIM_319) (237) [FOR-] (10) ($RES_SIM_144) (237) [----] for $i1 in 1:10 loop (237) [----] [SCAL] (1) pipeSegments[$i1].pin = pipeSegments[$i1].inlet.p ($RES_SIM_145) (237) [----] end for; (238) [FOR-] (10) ($RES_SIM_146) (238) [----] for $i1 in 1:10 loop (238) [----] [SCAL] (1) pipeSegments[$i1].wout = -pipeSegments[$i1].outlet.w ($RES_SIM_147) (238) [----] end for; (239) [FOR-] (10) ($RES_SIM_148) (239) [----] for $i1 in 1:10 loop (239) [----] [SCAL] (1) pipeSegments[$i1].win = pipeSegments[$i1].inlet.w ($RES_SIM_149) (239) [----] end for; (240) [SCAL] (1) patients[5].valve_in.inlet.w - patients[5].supply.w = 0.0 ($RES_SIM_400) (241) [SCAL] (1) patients[5].supply.p = patients[5].valve_in.inlet.p ($RES_SIM_401) (242) [SCAL] (1) patients[6].valve_in.inlet.w - patients[6].supply.w = 0.0 ($RES_SIM_402) (243) [SCAL] (1) patients[6].supply.p = patients[6].valve_in.inlet.p ($RES_SIM_403) (244) [SCAL] (1) patients[7].valve_in.inlet.w - patients[7].supply.w = 0.0 ($RES_SIM_404) (245) [SCAL] (1) patients[7].supply.p = patients[7].valve_in.inlet.p ($RES_SIM_405) (246) [SCAL] (1) patients[7].peep.port.w + patients[7].valve_out.outlet.w = 0.0 ($RES_SIM_230) (247) [SCAL] (1) patients[8].valve_in.inlet.w - patients[8].supply.w = 0.0 ($RES_SIM_406) (248) [SCAL] (1) patients[6].peep.port.w + patients[6].valve_out.outlet.w = 0.0 ($RES_SIM_231) (249) [SCAL] (1) patients[8].supply.p = patients[8].valve_in.inlet.p ($RES_SIM_407) (250) [SCAL] (1) patients[5].peep.port.w + patients[5].valve_out.outlet.w = 0.0 ($RES_SIM_232) (251) [SCAL] (1) patients[9].valve_in.inlet.w - patients[9].supply.w = 0.0 ($RES_SIM_408) (252) [SCAL] (1) patients[4].peep.port.w + patients[4].valve_out.outlet.w = 0.0 ($RES_SIM_233) (253) [SCAL] (1) patients[9].supply.p = patients[9].valve_in.inlet.p ($RES_SIM_409) (254) [SCAL] (1) patients[3].peep.port.w + patients[3].valve_out.outlet.w = 0.0 ($RES_SIM_234) (255) [SCAL] (1) patients[2].peep.port.w + patients[2].valve_out.outlet.w = 0.0 ($RES_SIM_235) (256) [SCAL] (1) patients[1].peep.port.w + patients[1].valve_out.outlet.w = 0.0 ($RES_SIM_236) (257) [SCAL] (1) patients[10].resistance.outlet.w + patients[10].compliance.port.w = 0.0 ($RES_SIM_237) (258) [SCAL] (1) patients[9].resistance.outlet.w + patients[9].compliance.port.w = 0.0 ($RES_SIM_238) (259) [SCAL] (1) patients[8].resistance.outlet.w + patients[8].compliance.port.w = 0.0 ($RES_SIM_239) (260) [SCAL] (1) patients[9].leak.outlet.p = patients[9].atmosphere.port.p ($RES_SIM_320) (261) [SCAL] (1) patients[10].leak.outlet.p = patients[10].atmosphere.port.p ($RES_SIM_321) (262) [SCAL] (1) patients[1].leak.opening = patients[1].leakOpening.y ($RES_SIM_322) (263) [SCAL] (1) patients[2].leak.opening = patients[2].leakOpening.y ($RES_SIM_323) (264) [SCAL] (1) patients[3].leak.opening = patients[3].leakOpening.y ($RES_SIM_324) (265) [SCAL] (1) patients[4].leak.opening = patients[4].leakOpening.y ($RES_SIM_325) (266) [FOR-] (10) ($RES_SIM_150) (266) [----] for $i1 in 1:10 loop (266) [----] [SCAL] (1) pipeSegments[$i1].air.p = pipeSegments[$i1].p ($RES_SIM_151) (266) [----] end for; (267) [SCAL] (1) patients[5].leak.opening = patients[5].leakOpening.y ($RES_SIM_326) (268) [SCAL] (1) patients[6].leak.opening = patients[6].leakOpening.y ($RES_SIM_327) (269) [FOR-] (10) ($RES_SIM_152) (269) [----] for $i1 in 1:10 loop (269) [----] [SCAL] (1) pipeSegments[$i1].A * pipeSegments[$i1].dpout = pipeSegments[$i1].uout2 * pipeSegments[$i1].omega * pipeSegments[$i1].air.rho * (pipeSegments[$i1].cf / 2.0) * pipeSegments[$i1].l ($RES_SIM_153) (269) [----] end for; (270) [SCAL] (1) patients[7].leak.opening = patients[7].leakOpening.y ($RES_SIM_328) (271) [SCAL] (1) patients[8].leak.opening = patients[8].leakOpening.y ($RES_SIM_329) (272) [FOR-] (10) ($RES_SIM_154) (272) [----] for $i1 in 1:10 loop (272) [----] [SCAL] (1) pipeSegments[$i1].A * pipeSegments[$i1].dpin = pipeSegments[$i1].uin2 * pipeSegments[$i1].omega * pipeSegments[$i1].air.rho * (pipeSegments[$i1].cf / 2.0) * pipeSegments[$i1].l ($RES_SIM_155) (272) [----] end for; (273) [FOR-] (10) ($RES_SIM_156) (273) [----] for $i1 in 1:10 loop (273) [----] [SCAL] (1) pipeSegments[$i1].dp = pipeSegments[$i1].dpin + pipeSegments[$i1].dpout ($RES_SIM_157) (273) [----] end for; (274) [FOR-] (10) ($RES_BND_457) (274) [----] for $i1 in 1:10 loop (274) [----] [SCAL] (1) pipeSegments[$i1].air.pref = ambient.p ($RES_BND_458) (274) [----] end for; (275) [FOR-] (10) ($RES_SIM_158) (275) [----] for $i1 in 1:10 loop (275) [----] [SCAL] (1) pipeSegments[$i1].dpout = pipeSegments[$i1].p - pipeSegments[$i1].pout ($RES_SIM_159) (275) [----] end for; (276) [SCAL] (1) patients[10].valve_in.inlet.w - patients[10].supply.w = 0.0 ($RES_SIM_410) (277) [FOR-] (10) ($RES_BND_459) (277) [----] for $i1 in 1:10 loop (277) [----] [SCAL] (1) pipeSegments[$i1].air.Tref = ambient.T ($RES_BND_460) (277) [----] end for; (278) [SCAL] (1) patients[10].supply.p = patients[10].valve_in.inlet.p ($RES_SIM_411) (279) [SCAL] (1) patients[1].valve_out.outlet.p = patients[1].peep.port.p ($RES_SIM_412) (280) [SCAL] (1) patients[2].valve_out.outlet.p = patients[2].peep.port.p ($RES_SIM_413) (281) [SCAL] (1) patients[3].valve_out.outlet.p = patients[3].peep.port.p ($RES_SIM_414) (282) [SCAL] (1) patients[4].valve_out.outlet.p = patients[4].peep.port.p ($RES_SIM_415) (283) [SCAL] (1) patients[7].resistance.outlet.w + patients[7].compliance.port.w = 0.0 ($RES_SIM_240) (284) [SCAL] (1) patients[5].valve_out.outlet.p = patients[5].peep.port.p ($RES_SIM_416) (285) [SCAL] (1) patients[6].resistance.outlet.w + patients[6].compliance.port.w = 0.0 ($RES_SIM_241) (286) [SCAL] (1) patients[6].valve_out.outlet.p = patients[6].peep.port.p ($RES_SIM_417) (287) [SCAL] (1) patients[5].resistance.outlet.w + patients[5].compliance.port.w = 0.0 ($RES_SIM_242) (288) [SCAL] (1) patients[7].valve_out.outlet.p = patients[7].peep.port.p ($RES_SIM_418) (289) [SCAL] (1) patients[4].resistance.outlet.w + patients[4].compliance.port.w = 0.0 ($RES_SIM_243) (290) [SCAL] (1) patients[8].valve_out.outlet.p = patients[8].peep.port.p ($RES_SIM_419) (291) [SCAL] (1) patients[3].resistance.outlet.w + patients[3].compliance.port.w = 0.0 ($RES_SIM_244) (292) [SCAL] (1) patients[2].resistance.outlet.w + patients[2].compliance.port.w = 0.0 ($RES_SIM_245) (293) [SCAL] (1) patients[1].resistance.outlet.w + patients[1].compliance.port.w = 0.0 ($RES_SIM_246) (294) [SCAL] (1) patients[10].leak.outlet.w + patients[10].atmosphere.port.w = 0.0 ($RES_SIM_247) (295) [SCAL] (1) patients[9].leak.outlet.w + patients[9].atmosphere.port.w = 0.0 ($RES_SIM_248) (296) [SCAL] (1) patients[8].leak.outlet.w + patients[8].atmosphere.port.w = 0.0 ($RES_SIM_249) (297) [SCAL] (1) patients[9].leak.opening = patients[9].leakOpening.y ($RES_SIM_330) (298) [SCAL] (1) patients[10].leak.opening = patients[10].leakOpening.y ($RES_SIM_331) (299) [SCAL] (1) patients[1].valve_in.outlet.p = patients[1].valve_out.inlet.p ($RES_SIM_332) (300) [SCAL] (1) patients[1].valve_in.outlet.p = patients[1].resistance.inlet.p ($RES_SIM_333) (301) [SCAL] (1) patients[1].valve_in.outlet.p = patients[1].leak.inlet.p ($RES_SIM_334) (302) [SCAL] (1) patients[2].valve_in.outlet.p = patients[2].valve_out.inlet.p ($RES_SIM_335) (303) [FOR-] (10) ($RES_SIM_160) (303) [----] for $i1 in 1:10 loop (303) [----] [SCAL] (1) pipeSegments[$i1].dpin = pipeSegments[$i1].pin - pipeSegments[$i1].p ($RES_SIM_161) (303) [----] end for; (304) [SCAL] (1) patients[2].valve_in.outlet.p = patients[2].resistance.inlet.p ($RES_SIM_336) (305) [ARRY] (10) patients.leakOpening.y = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, if $TEV_0 then 0.0 else 1.0} ($RES_BND_461) (306) [SCAL] (1) patients[2].valve_in.outlet.p = patients[2].leak.inlet.p ($RES_SIM_337) (307) [FOR-] (10) ($RES_SIM_162) (307) [----] for $i1 in 1:10 loop (307) [----] [SCAL] (1) pipeSegments[$i1].uout2 = homotopy(pipeSegments[$i1].uout * sqrt(pipeSegments[$i1].uout * pipeSegments[$i1].uout + pipeSegments[$i1].delta * pipeSegments[$i1].unom * pipeSegments[$i1].delta * pipeSegments[$i1].unom), pipeSegments[$i1].uout * pipeSegments[$i1].unom) ($RES_SIM_163) (307) [----] end for; (308) [FOR-] (10) ($RES_BND_462) (308) [----] for $i1 in 1:10 loop (308) [----] [SCAL] (1) patients[$i1].leak.air.Tref = ambient.T ($RES_BND_463) (308) [----] end for; (309) [SCAL] (1) patients[3].valve_in.outlet.p = patients[3].valve_out.inlet.p ($RES_SIM_338) (310) [SCAL] (1) patients[3].valve_in.outlet.p = patients[3].resistance.inlet.p ($RES_SIM_339) (311) [FOR-] (10) ($RES_SIM_164) (311) [----] for $i1 in 1:10 loop (311) [----] [SCAL] (1) pipeSegments[$i1].uin2 = homotopy(pipeSegments[$i1].uin * sqrt(pipeSegments[$i1].uin * pipeSegments[$i1].uin + pipeSegments[$i1].delta * pipeSegments[$i1].unom * pipeSegments[$i1].delta * pipeSegments[$i1].unom), pipeSegments[$i1].uin * pipeSegments[$i1].unom) ($RES_SIM_165) (311) [----] end for; (312) [FOR-] (10) ($RES_BND_464) (312) [----] for $i1 in 1:10 loop (312) [----] [SCAL] (1) patients[$i1].compliance.air.Tref = ambient.T ($RES_BND_465) (312) [----] end for; (313) [FOR-] (10) ($RES_SIM_166) (313) [----] for $i1 in 1:10 loop (313) [----] [SCAL] (1) pipeSegments[$i1].uout = pipeSegments[$i1].wout / (pipeSegments[$i1].A * pipeSegments[$i1].air.rho) ($RES_SIM_167) (313) [----] end for; (314) [FOR-] (10) ($RES_BND_466) (314) [----] for $i1 in 1:10 loop (314) [----] [SCAL] (1) patients[$i1].valve_out.air.Tref = ambient.T ($RES_BND_467) (314) [----] end for; (315) [FOR-] (10) ($RES_SIM_168) (315) [----] for $i1 in 1:10 loop (315) [----] [SCAL] (1) pipeSegments[$i1].uin = pipeSegments[$i1].win / (pipeSegments[$i1].A * pipeSegments[$i1].air.rho) ($RES_SIM_169) (315) [----] end for; (316) [FOR-] (10) ($RES_BND_468) (316) [----] for $i1 in 1:10 loop (316) [----] [SCAL] (1) patients[$i1].resistance.air.pref = ambient.p ($RES_BND_469) (316) [----] end for; (317) [SCAL] (1) patients[9].valve_out.outlet.p = patients[9].peep.port.p ($RES_SIM_420) (318) [SCAL] (1) patients[10].valve_out.outlet.p = patients[10].peep.port.p ($RES_SIM_421) (319) [SCAL] (1) patients[1].compliance.port.p = patients[1].resistance.outlet.p ($RES_SIM_422) (320) [SCAL] (1) patients[2].compliance.port.p = patients[2].resistance.outlet.p ($RES_SIM_423) (321) [SCAL] (1) patients[3].compliance.port.p = patients[3].resistance.outlet.p ($RES_SIM_424) (322) [SCAL] (1) patients[4].compliance.port.p = patients[4].resistance.outlet.p ($RES_SIM_425) (323) [SCAL] (1) patients[7].leak.outlet.w + patients[7].atmosphere.port.w = 0.0 ($RES_SIM_250) (324) [SCAL] (1) patients[5].compliance.port.p = patients[5].resistance.outlet.p ($RES_SIM_426) (325) [SCAL] (1) patients[6].leak.outlet.w + patients[6].atmosphere.port.w = 0.0 ($RES_SIM_251) (326) [SCAL] (1) patients[6].compliance.port.p = patients[6].resistance.outlet.p ($RES_SIM_427) (327) [SCAL] (1) patients[5].leak.outlet.w + patients[5].atmosphere.port.w = 0.0 ($RES_SIM_252) (328) [SCAL] (1) patients[7].compliance.port.p = patients[7].resistance.outlet.p ($RES_SIM_428) (329) [SCAL] (1) patients[4].leak.outlet.w + patients[4].atmosphere.port.w = 0.0 ($RES_SIM_253)