diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/MEV 1.1.1-master/openmodelica.metadata.json" "converted-libraries/.openmodelica/libraries/MEV 1.1.1-master/openmodelica.metadata.json"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/MEV 1.1.1-master/openmodelica.metadata.json"	2022-03-10 09:57:37.012144001 +0000
+++ "converted-libraries/.openmodelica/libraries/MEV 1.1.1-master/openmodelica.metadata.json"	2022-03-10 09:57:52.660145984 +0000
@@ -1 +1 @@
-{"path":"MEV", "sha":"04d85ca089f284081ca2df4ca68039780f47a90f", "support":"noSupport", "uses":{"Modelica":"3.2.3"}, "version":"1.1.1-master", "zipfile":"https://github.com/looms-polimi/MEV/archive/04d85ca089f284081ca2df4ca68039780f47a90f.zip"}
+{"path": "MEV", "sha": "04d85ca089f284081ca2df4ca68039780f47a90f", "support": "noSupport", "uses": {"Modelica": "4.0.0"}, "version": "1.1.1-master", "zipfile": "https://github.com/looms-polimi/MEV/archive/04d85ca089f284081ca2df4ca68039780f47a90f.zip", "extraInfo": "Conversion script /home/hudson/saved_omc/libraries/.openmodelica/libraries/Modelica 4.0.0+maint.om//Resources/Scripts/Conversion/ConvertModelica_from_3.2.3_to_4.0.0.mos was applied"}
\ No newline at end of file
diff -ur "/home/hudson/saved_omc/libraries/.openmodelica/libraries/MEV 1.1.1-master/package.mo" "converted-libraries/.openmodelica/libraries/MEV 1.1.1-master/package.mo"
--- "/home/hudson/saved_omc/libraries/.openmodelica/libraries/MEV 1.1.1-master/package.mo"	2022-03-10 09:57:37.012144001 +0000
+++ "converted-libraries/.openmodelica/libraries/MEV 1.1.1-master/package.mo"	2022-03-10 09:57:52.652145984 +0000
@@ -27,11 +27,11 @@
   end Info;
 
   model Ambient
-    constant Modelica.SIunits.SpecificHeatCapacity Rstar = Modelica.Constants.R / MM "Gas constant for air";
-    constant Modelica.SIunits.MolarMass MM = 0.029 "Molar mass of air";
-    constant Modelica.SIunits.PerUnit gamma = 1.4 "cp/cv";
+    constant Modelica.Units.SI.SpecificHeatCapacity Rstar = Modelica.Constants.R / MM "Gas constant for air";
+    constant Modelica.Units.SI.MolarMass MM = 0.029 "Molar mass of air";
+    constant Modelica.Units.SI.PerUnit gamma = 1.4 "cp/cv";
     parameter Types.AbsolutePressure p = 101325 "Ambient absolute pressure";
-    parameter Modelica.SIunits.Temperature T = 298.15 "Reference gas temperature";
+    parameter Modelica.Units.SI.Temperature T = 298.15 "Reference gas temperature";
     parameter Boolean useOnOffControl = false "=true uses on-off controller, otherwise linear controller";
     annotation(
       Icon(coordinateSystem(preserveAspectRatio = false), graphics = {Rectangle(extent = {{-100, 100}, {100, -100}}, lineColor = {0, 0, 0}), Text(extent = {{-80, 64}, {80, -58}}, lineColor = {28, 108, 200}, textString = "Ambient")}),
@@ -110,18 +110,18 @@
       Interfaces.PneumaticPort_b outlet annotation(
         Placement(visible = true, transformation(origin = {100, -98}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {60, -80}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
       outer Ambient ambient;
-      parameter Modelica.SIunits.Area A "Cylinder cross section";
-      parameter Modelica.SIunits.Volume Vref "Cylinder volume at reference level";
-      parameter Modelica.SIunits.Length yref "Reference level";
-      parameter Modelica.SIunits.Length ystart "Start value of the level";
-      parameter Modelica.SIunits.Length ymin = 1e-3 "Minimum level";
-      parameter Modelica.SIunits.Length ymax "Maximum level";
+      parameter Modelica.Units.SI.Area A "Cylinder cross section";
+      parameter Modelica.Units.SI.Volume Vref "Cylinder volume at reference level";
+      parameter Modelica.Units.SI.Length yref "Reference level";
+      parameter Modelica.Units.SI.Length ystart "Start value of the level";
+      parameter Modelica.Units.SI.Length ymin = 1e-3 "Minimum level";
+      parameter Modelica.Units.SI.Length ymax "Maximum level";
       parameter Types.RelativePressure pstart = 0 "Start value of relative pressure";
-      Modelica.SIunits.Mass M(stateSelect = StateSelect.prefer) "Mass";
-      Modelica.SIunits.Length y(stateSelect = StateSelect.prefer) "Level";
+      Modelica.Units.SI.Mass M(stateSelect = StateSelect.prefer) "Mass";
+      Modelica.Units.SI.Length y(stateSelect = StateSelect.prefer) "Level";
       Types.Volume V "Volume";
       Types.RelativePressure p "Relative air pressure in the cylinder";
-      Modelica.SIunits.Force F "Net force applied to the piston, discounting external atmospheric pressure";
+      Modelica.Units.SI.Force F "Net force applied to the piston, discounting external atmospheric pressure";
       Types.MassFlowRate w_in "Entering mass flow rate";
       Types.MassFlowRate w_out "Leaving mass flow rate";
       final Types.AbsolutePressure pamb = ambient.p "Ambient pressure";
@@ -162,17 +162,17 @@
         Placement(visible = true, transformation(origin = {-100, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-100, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
       Interfaces.PneumaticPort_b outlet annotation(
         Placement(visible = true, transformation(origin = {100, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {100, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
-      parameter Modelica.SIunits.Length D "Pipe diameter";
-      parameter Modelica.SIunits.Length L "Pipe length";
-      parameter Modelica.SIunits.PerUnit cf = 0.005 "Fanning friction factor";
+      parameter Modelica.Units.SI.Length D "Pipe diameter";
+      parameter Modelica.Units.SI.Length L "Pipe length";
+      parameter Modelica.Units.SI.PerUnit cf = 0.005 "Fanning friction factor";
       parameter Types.Velocity unom "Nominal air speed";
-      parameter Modelica.SIunits.PerUnit delta = 0.1 "Fraction of nominal velocity for friction regularization";
+      parameter Modelica.Units.SI.PerUnit delta = 0.1 "Fraction of nominal velocity for friction regularization";
       parameter Types.RelativePressure pstart = 0 "start value for relative pressure p";
-      constant Modelica.SIunits.PerUnit pi = Modelica.Constants.pi;
-      final parameter Modelica.SIunits.Area A = pi * D ^ 2 / 4 "Pipe cross-sectional surface";
-      final parameter Modelica.SIunits.Volume V = A * L;
-      final parameter Modelica.SIunits.Length omega = pi * D "Wet perimeter";
-      final parameter Modelica.SIunits.Length l = L / 2 "Length of a single finite vol.";
+      constant Modelica.Units.SI.PerUnit pi = Modelica.Constants.pi;
+      final parameter Modelica.Units.SI.Area A = pi * D ^ 2 / 4 "Pipe cross-sectional surface";
+      final parameter Modelica.Units.SI.Volume V = A * L;
+      final parameter Modelica.Units.SI.Length omega = pi * D "Wet perimeter";
+      final parameter Modelica.Units.SI.Length l = L / 2 "Length of a single finite vol.";
       Media.AirAdiabatic air;
       Types.MassFlowRate win "Entering flow rate";
       Types.MassFlowRate wout "Leaving flow rate";
@@ -186,7 +186,7 @@
       Types.VelocitySquared uin2 "Regularized squared inlet velocity";
       Types.VelocitySquared uout2 "Regularized squared inlet velocity";
       Types.RelativePressure p(stateSelect = StateSelect.prefer) "Relative pressure at the middle of the pipe";
-      Modelica.SIunits.Mass M(stateSelect = StateSelect.avoid) "Mass of fluid in the pipe";
+      Modelica.Units.SI.Mass M(stateSelect = StateSelect.avoid) "Mass of fluid in the pipe";
     protected
       function regSquare = Modelica.Fluid.Utilities.regSquare;
     equation
@@ -201,8 +201,8 @@
       dpin = pin - p;
       dpout = p - pout;
       dp = dpin + dpout;
-      A*dpin = cf/2*air.rho*omega*uin2*l "Momentum balance, entering side";
-      A*dpout= cf/2*air.rho*omega*uout2*l "Momentum balance, leaving side";
+      A * dpin = cf / 2 * air.rho * omega * uin2 * l "Momentum balance, entering side";
+      A * dpout = cf / 2 * air.rho * omega * uout2 * l "Momentum balance, leaving side";
 // Air model
       air.p = p;
 // Boundary values
@@ -283,7 +283,7 @@
       parameter Types.MassFlowRate wnom "Nominal mass flow rate";
       parameter Types.RelativePressure dpnom "Nominal pressure drop";
       parameter Types.Density rhonom(displayUnit = "kg/m3") = 1.2 "Nominal air density";
-      parameter Modelica.SIunits.PerUnit delta = 0.1 "Fraction of nominal mass flow rate for friction regularization";
+      parameter Modelica.Units.SI.PerUnit delta = 0.1 "Fraction of nominal mass flow rate for friction regularization";
       Media.AirAdiabatic air;
       Types.MassFlowRate w "Flow rate";
       Types.RelativePressure pin "Entering relative pressure";
@@ -313,16 +313,16 @@
       Modelica.Blocks.Interfaces.RealInput opening(unit = "1") annotation(
         Placement(visible = true, transformation(origin = {-4, 64}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {0, 42}, extent = {{-20, -20}, {20, 20}}, rotation = -90)));
       outer Ambient ambient "Ambient model";
-      parameter Modelica.SIunits.Area Av "Maximum flow coefficient";
+      parameter Modelica.Units.SI.Area Av "Maximum flow coefficient";
       parameter Types.MassFlowRate wnom "Nominal mass flow rate";
       parameter Types.RelativePressure dpnom "Nominal delta-p";
-      parameter Modelica.SIunits.PerUnit delta = 0.01 "Fraction of nominal delta-p for sqrt regularization";
+      parameter Modelica.Units.SI.PerUnit delta = 0.01 "Fraction of nominal delta-p for sqrt regularization";
       final parameter Real Cv = Av * 1e6 / 24 "Cv coefficient of the valve";
       final parameter Real Kv = Av * 1e6 / 27.7 "Kv coefficient of the valve";
       Media.Air air "inlet air properties";
       Types.MassFlowRate w "Mass flow rate";
       Types.RelativePressure pin "Entering pressure, relative";
-      Modelica.SIunits.Pressure pout "Leaving pressure, relative";
+      Modelica.Units.SI.Pressure pout "Leaving pressure, relative";
       Types.RelativePressure dp "Valve delta-p";
       Types.VolumeFlowRate q "Volume flow rate";
     protected
@@ -347,17 +347,17 @@
 
     model BellJar
       outer Ambient ambient "Ambient conditions";
-      constant Modelica.SIunits.Acceleration g = Modelica.Constants.g_n "Acceleration of gravity";
-      parameter Modelica.SIunits.Area A = 20e-3 / 0.174 "Cylinder cross section";
-      parameter Modelica.SIunits.Length ystart = (ymin + ymax) / 2 "Start value of the level";
-      parameter Modelica.SIunits.Length ymax = 0.174 "Maximum level";
-      parameter Modelica.SIunits.Length ymin = 0 "Minimum level";
-      parameter Modelica.SIunits.Length yref = ymin "Reference level";
-      parameter Modelica.SIunits.Volume Vref = 15.27e-3 "Volume at reference level";
+      constant Modelica.Units.SI.Acceleration g = Modelica.Constants.g_n "Acceleration of gravity";
+      parameter Modelica.Units.SI.Area A = 20e-3 / 0.174 "Cylinder cross section";
+      parameter Modelica.Units.SI.Length ystart = (ymin + ymax) / 2 "Start value of the level";
+      parameter Modelica.Units.SI.Length ymax = 0.174 "Maximum level";
+      parameter Modelica.Units.SI.Length ymin = 0 "Minimum level";
+      parameter Modelica.Units.SI.Length yref = ymin "Reference level";
+      parameter Modelica.Units.SI.Volume Vref = 15.27e-3 "Volume at reference level";
       parameter Types.RelativePressure pdes = 2400 "Relative supply pressure design value";
-      final parameter Modelica.SIunits.Mass M = pdes * A / g "Piston weight";
+      final parameter Modelica.Units.SI.Mass M = pdes * A / g "Piston weight";
       final parameter Types.AbsolutePressure pa = ambient.p "Absolute ambient pressure";
-      parameter Modelica.SIunits.TranslationalDampingConstant d = 10 "Damping constant";
+      parameter Modelica.Units.SI.TranslationalDampingConstant d = 10 "Damping constant";
       Components.Cylinder cylinder(A = A, Vref = Vref, yref = yref, ystart = ystart, ymax = ymax, ymin = ymin, pstart = pstart, init_y = true, init_p = true) annotation(
         Placement(transformation(extent = {{-40, -62}, {0, -22}})));
       Modelica.Mechanics.Translational.Components.Mass piston(m = M, v(fixed = true)) annotation(
@@ -436,11 +436,11 @@
         Placement(transformation(extent = {{84, 70}, {64, 90}})));
       Modelica.Blocks.Interfaces.RealInput valveCommand annotation(
         Placement(transformation(extent = {{-134, 60}, {-94, 100}}), iconTransformation(extent = {{-100, -16}, {-68, 16}})));
-      parameter Types.Compliance C = 40/1e6 / (0.01*9.81*999) "Compliance";
-      parameter Types.Resistance R = 12/100 * 9.81*999/0.001 "Resistance";
+      parameter Types.Compliance C = 40 / 1e6 / (0.01 * 9.81 * 999) "Compliance";
+      parameter Types.Resistance R = 12 / 100 * 9.81 * 999 / 0.001 "Resistance";
       parameter Types.RelativePressure pstart = 1200 "Initial relative pressure";
-      parameter Modelica.SIunits.PerUnit kC = 1 "Correction factor for compliance";
-      parameter Modelica.SIunits.PerUnit kR = 1 "Correction factor for resistance";
+      parameter Modelica.Units.SI.PerUnit kC = 1 "Correction factor for compliance";
+      parameter Modelica.Units.SI.PerUnit kR = 1 "Correction factor for resistance";
       Components.ControlValve leak(Av = 2e-4, wnom = 0.01, dpnom = 100) annotation(
         Placement(transformation(extent = {{-10, 10}, {10, -10}}, rotation = -90, origin = {-30, -24})));
       Modelica.Blocks.Sources.RealExpression leakOpening annotation(
@@ -512,11 +512,11 @@
         Line(points = {{-168, 0}, {-140, 0}, {-140, -24}, {-120, -24}}, color = {111, 164, 171}));
       connect(supplyValveOnOff.outlet, bellJar.inlet) annotation(
         Line(points = {{-104, -24}, {-40, -24}, {-40, 0}, {-22, 0}}, color = {111, 164, 171}));
-  connect(bellJar.outlet, pipeSegments[1].inlet) annotation(
+      connect(bellJar.outlet, pipeSegments[1].inlet) annotation(
         Line(points = {{14, 0}, {48, 0}}, color = {111, 164, 171}));
-  connect(pipeSegments.outlet, patients.supply) annotation(
+      connect(pipeSegments.outlet, patients.supply) annotation(
         Line(points = {{92, 0}, {118, 0}, {118, -31}}, color = {111, 164, 171}));
-  connect(pipeSegments[1:N - 1].outlet, pipeSegments[2:N].inlet) annotation(
+      connect(pipeSegments[1:N - 1].outlet, pipeSegments[2:N].inlet) annotation(
         Line(points = {{92, 0}, {48, 0}}, color = {111, 164, 171}));
       connect(pressureSource.port, supplyValveModulating.inlet) annotation(
         Line(points = {{-168, 0}, {-140, 0}, {-140, 12}, {-120, 12}}, color = {111, 164, 171}));
@@ -530,49 +530,27 @@
         Line(points = {{-73, 58}, {-112, 58}, {-112, 15.36}}, color = {0, 0, 127}));
       connect(onOffControllerWithHysteresis.valveOpening, supplyValveOnOff.opening) annotation(
         Line(points = {{-73, 28}, {-88, 28}, {-88, -6}, {-112, -6}, {-112, -20.64}}, color = {0, 0, 127}));
-  connect(patientControllers.opening, patients.valveCommand) annotation(
+      connect(patientControllers.opening, patients.valveCommand) annotation(
         Line(points = {{60, -60}, {75, -60}, {75, -48}, {100, -48}}, color = {0, 0, 127}, thickness = 0.5));
-  connect(RR.y, patientControllers.RR) annotation(
+      connect(RR.y, patientControllers.RR) annotation(
         Line(points = {{21, -40}, {28, -40}, {28, -54}, {40, -54}}, color = {0, 0, 127}, thickness = 0.5));
-  connect(dutyCycle.y, patientControllers.dutyCycle) annotation(
+      connect(dutyCycle.y, patientControllers.dutyCycle) annotation(
         Line(points = {{21, -76}, {28, -76}, {28, -66}, {40, -66}}, color = {0, 0, 127}, thickness = 0.5));
       annotation(
         Icon(coordinateSystem(preserveAspectRatio = false, extent = {{-180, -100}, {180, 100}})),
-        Diagram(coordinateSystem(extent = {{-200, -100}, {140, 100}}), graphics = {Text(origin = {6, -4},lineColor = {28, 108, 200}, extent = {{52, 20}, {76, 12}}, textString = "10 X"), Text(lineColor = {28, 108, 200}, extent = {{88, -56}, {112, -64}}, textString = "10 X")}));
+        Diagram(coordinateSystem(extent = {{-200, -100}, {140, 100}}), graphics = {Text(origin = {6, -4}, lineColor = {28, 108, 200}, extent = {{52, 20}, {76, 12}}, textString = "10 X"), Text(lineColor = {28, 108, 200}, extent = {{88, -56}, {112, -64}}, textString = "10 X")}));
     end BaseSystem;
 
     model StandardPatientMixSystem "System with standard mix of 10 patients"
-      extends MEV.SystemModels.BaseSystem(
-        patients(
-          C               = {30, 30, 30, 40, 40, 40, 40, 60, 60, 60}/1e6/(0.01*9.81*999),
-          R               = { 6, 12, 18,  6, 12, 12, 18,  6, 12, 18}/100*9.81*999/0.001),
-        RR(height         = {30, 29, 28, 23, 22, 21, 19, 16, 15, 14},
-           each startTime = -10),
-        dutyCycle(offset  = {40, 40, 40, 33, 33, 33, 33, 20, 25, 33}));
+      extends MEV.SystemModels.BaseSystem(patients(C = {30, 30, 30, 40, 40, 40, 40, 60, 60, 60} / 1e6 / (0.01 * 9.81 * 999), R = {6, 12, 18, 6, 12, 12, 18, 6, 12, 18} / 100 * 9.81 * 999 / 0.001), RR(height = {30, 29, 28, 23, 22, 21, 19, 16, 15, 14}, each startTime = -10), dutyCycle(offset = {40, 40, 40, 33, 33, 33, 33, 20, 25, 33}));
     end StandardPatientMixSystem;
 
     model WorstCasePatientSystem "Worst case with 10 patients max C min R"
-      extends MEV.SystemModels.BaseSystem(
-        patients(
-          each C = 60/1e6/(0.01*9.81*999),
-          each R = 6/100*9.81*999/0.001),
-        RR(each height = 16,
-           each startTime = -10),
-        dutyCycle(each offset = 20));
+      extends MEV.SystemModels.BaseSystem(patients(each C = 60 / 1e6 / (0.01 * 9.81 * 999), each R = 6 / 100 * 9.81 * 999 / 0.001), RR(each height = 16, each startTime = -10), dutyCycle(each offset = 20));
     end WorstCasePatientSystem;
 
     model StandardPatientMix2XSystem "System with 2X standard mix of patients"
-      extends MEV.SystemModels.BaseSystem(N = 20,
-        patients(
-          C = {30, 30, 30, 40, 40, 40, 40, 60, 60, 60,
-               30, 30, 30, 40, 40, 40, 40, 60, 60, 60}/1e6/(0.01*9.81*999),
-          R = { 6, 12, 18,  6, 12, 12, 18,  6, 12, 18,
-                6, 12, 18,  6, 12, 12, 18,  6, 12, 18}/100*9.81*999/0.001),
-          RR(height         = {30, 29, 28, 23, 22, 21, 19, 16, 15, 14,
-                               30, 29, 28, 23, 22, 21, 19, 16, 15, 14},
-             each startTime = -10),
-          dutyCycle(offset  = {40, 40, 40, 33, 33, 33, 33, 20, 25, 33,
-                               40, 40, 40, 33, 33, 33, 33, 20, 25, 33}));
+      extends MEV.SystemModels.BaseSystem(N = 20, patients(C = {30, 30, 30, 40, 40, 40, 40, 60, 60, 60, 30, 30, 30, 40, 40, 40, 40, 60, 60, 60} / 1e6 / (0.01 * 9.81 * 999), R = {6, 12, 18, 6, 12, 12, 18, 6, 12, 18, 6, 12, 18, 6, 12, 12, 18, 6, 12, 18} / 100 * 9.81 * 999 / 0.001), RR(height = {30, 29, 28, 23, 22, 21, 19, 16, 15, 14, 30, 29, 28, 23, 22, 21, 19, 16, 15, 14}, each startTime = -10), dutyCycle(offset = {40, 40, 40, 33, 33, 33, 33, 20, 25, 33, 40, 40, 40, 33, 33, 33, 33, 20, 25, 33}));
     end StandardPatientMix2XSystem;
   end SystemModels;
 
@@ -584,9 +562,7 @@
 
       model Scenario1 "System turned on, first patient attached at time = 10, linear control"
         extends Modelica.Icons.Example;
-        extends SystemModels.StandardPatientMixSystem(
-          RR(startTime = {1e6, 1e6, 1e6, 1e6, 10, 1e6, 1e6, 1e6, 1e6, 1e6}),
-          bellJar(ystart = bellJar.ymin + 0.005));
+        extends SystemModels.StandardPatientMixSystem(RR(startTime = {1e6, 1e6, 1e6, 1e6, 10, 1e6, 1e6, 1e6, 1e6, 1e6}), bellJar(ystart = bellJar.ymin + 0.005));
         annotation(
           Diagram(coordinateSystem(extent = {{-200, -100}, {140, 100}})),
           experiment(StopTime = 25, Interval = 0.005, Tolerance = 1e-06, StartTime = 0));
@@ -594,8 +570,7 @@
 
       model Scenario2 "Five patients attached, linear control"
         extends Modelica.Icons.Example;
-        extends SystemModels.StandardPatientMixSystem(
-          RR(startTime = {-10, 1e6, -10, 1e6, -10, 1e6, 1e6, -10, 1e6, -10}));
+        extends SystemModels.StandardPatientMixSystem(RR(startTime = {-10, 1e6, -10, 1e6, -10, 1e6, 1e6, -10, 1e6, -10}));
         annotation(
           Diagram(coordinateSystem(extent = {{-200, -100}, {140, 100}})),
           experiment(StopTime = 15, Interval = 0.005, Tolerance = 1e-06, StartTime = 0));
@@ -611,8 +586,7 @@
 
       model Scenario4 "Nine patients attached, one more is attached at time = 10, linear control"
         extends Modelica.Icons.Example;
-        extends SystemModels.StandardPatientMixSystem(
-          RR(startTime = {-10, -10, -10, -10, -10, 10, -10, -10, -10, -10}));
+        extends SystemModels.StandardPatientMixSystem(RR(startTime = {-10, -10, -10, -10, -10, 10, -10, -10, -10, -10}));
         annotation(
           Diagram(coordinateSystem(extent = {{-200, -100}, {140, 100}})),
           experiment(StopTime = 15, Interval = 5e-3, Tolerance = 1e-06));
@@ -628,9 +602,7 @@
 
       model Scenario6 "Ten patients attached,leak on the last patient at time = 5"
         extends Modelica.Icons.Example;
-        extends SystemModels.StandardPatientMixSystem(
-          RR(each startTime = -10),
-          patients(leakOpening(y = {0, 0, 0, 0, 0, 0, 0, 0, 0, if time < 5 then 0 else 1})));
+        extends SystemModels.StandardPatientMixSystem(RR(each startTime = -10), patients(leakOpening(y = {0, 0, 0, 0, 0, 0, 0, 0, 0, if time < 5 then 0 else 1})));
         annotation(
           Diagram(coordinateSystem(extent = {{-200, -100}, {140, 100}})),
           experiment(StopTime = 15, Interval = 5e-3, Tolerance = 1e-06));
@@ -638,8 +610,7 @@
 
       model Scenario7 "Twenty patients attached, linear control"
         extends Modelica.Icons.Example;
-        extends SystemModels.StandardPatientMix2XSystem(
-          RR(each startTime = -10));
+        extends SystemModels.StandardPatientMix2XSystem(RR(each startTime = -10));
         annotation(
           Diagram(coordinateSystem(extent = {{-200, -100}, {140, 100}})),
           experiment(StopTime = 25, Interval = 5e-3, Tolerance = 1e-06));
@@ -1034,8 +1005,7 @@
     end TestPatientController1;
 
     model TestPatientController2
-      extends MEV.Test.TestPatientController1(
-        RR(table = [0, 0; 10, 0; 10, 30; 48, 30; 48, 20; 79, 20; 79, 0; 100, 0]));
+      extends MEV.Test.TestPatientController1(RR(table = [0, 0; 10, 0; 10, 30; 48, 30; 48, 20; 79, 20; 79, 0; 100, 0]));
       annotation(
         experiment(StartTime = 0, StopTime = 100, Tolerance = 1e-06, Interval = 0.2));
     end TestPatientController2;
@@ -1046,9 +1016,9 @@
 
     model AirAdiabatic "Air model assuming adiabatic reversible compression"
       outer Ambient ambient "Ambient model";
-      constant Modelica.SIunits.SpecificHeatCapacity Rstar = ambient.Rstar "Gas constant for air";
-      constant Modelica.SIunits.MolarMass MM = ambient.MM "Molar mass of air";
-      constant Modelica.SIunits.PerUnit gamma = 1.4 "cp/cv";
+      constant Modelica.Units.SI.SpecificHeatCapacity Rstar = ambient.Rstar "Gas constant for air";
+      constant Modelica.Units.SI.MolarMass MM = ambient.MM "Molar mass of air";
+      constant Modelica.Units.SI.PerUnit gamma = 1.4 "cp/cv";
       connector InputAbsolutePressure = input Types.AbsolutePressure;
       Types.Temperature Tref = ambient.T "Reference gas temperature";
       Types.AbsolutePressure pref = ambient.p "Reference gas pressure";
@@ -1063,8 +1033,8 @@
 
     model Air "Air model"
       outer Ambient ambient "Ambient model";
-      constant Modelica.SIunits.SpecificHeatCapacity Rstar = ambient.Rstar "Gas constant for air";
-      constant Modelica.SIunits.MolarMass MM = ambient.MM "Molar mass of air";
+      constant Modelica.Units.SI.SpecificHeatCapacity Rstar = ambient.Rstar "Gas constant for air";
+      constant Modelica.Units.SI.MolarMass MM = ambient.MM "Molar mass of air";
       connector InputAbsolutePressure = input Types.AbsolutePressure;
       Types.Temperature Tref = ambient.T "Reference gas temperature";
       InputAbsolutePressure p "Absolute pressure";
@@ -1082,16 +1052,16 @@
 
   package Types "Custom types definitions"
     extends Modelica.Icons.TypesPackage;
-    type RelativePressure = Modelica.SIunits.PressureDifference(nominal = 1000, displayUnit = "Pa");
-    type AbsolutePressure = Modelica.SIunits.Pressure(nominal = 1e5, displayUnit = "bar");
-    type MassFlowRate = Modelica.SIunits.MassFlowRate(nominal = 1e-4);
-    type VolumeFlowRate = Modelica.SIunits.VolumeFlowRate(nominal = 1e-4);
-    type Volume = Modelica.SIunits.Volume(displayUnit = "l");
-    type Density = Modelica.SIunits.Density(nominal = 1.2, start = 1.2, displayUnit = "kg/m3");
-    type Length = Modelica.SIunits.Length;
-    type Velocity = Modelica.SIunits.Velocity;
+    type RelativePressure = Modelica.Units.SI.PressureDifference(nominal = 1000, displayUnit = "Pa");
+    type AbsolutePressure = Modelica.Units.SI.Pressure(nominal = 1e5, displayUnit = "bar");
+    type MassFlowRate = Modelica.Units.SI.MassFlowRate(nominal = 1e-4);
+    type VolumeFlowRate = Modelica.Units.SI.VolumeFlowRate(nominal = 1e-4);
+    type Volume = Modelica.Units.SI.Volume(displayUnit = "l");
+    type Density = Modelica.Units.SI.Density(nominal = 1.2, start = 1.2, displayUnit = "kg/m3");
+    type Length = Modelica.Units.SI.Length;
+    type Velocity = Modelica.Units.SI.Velocity;
     type VelocitySquared = Real(unit = "m2/s2");
-    type Temperature = Modelica.SIunits.Temperature(start = 288.15, nominal = 300);
+    type Temperature = Modelica.Units.SI.Temperature(start = 288.15, nominal = 300);
     type Compliance = Real(unit = "m3/Pa");
     type Resistance = Real(unit = "Pa.s/m3");
   end Types;
@@ -1132,7 +1102,7 @@
       outer Ambient ambient "Ambient model";
       parameter Types.Length level_sp "Level set point";
       parameter Real Kp "Proportional Gain";
-      parameter Modelica.SIunits.Time T "Time Constant";
+      parameter Modelica.Units.SI.Time T "Time Constant";
       Modelica.Blocks.Interfaces.RealInput level "Level of bell jar [m]" annotation(
         Placement(transformation(extent = {{-20, -20}, {20, 20}}, rotation = 90, origin = {-36, -64}), iconTransformation(extent = {{-140, -20}, {-100, 20}})));
       Modelica.Blocks.Interfaces.RealOutput valveOpening "Valve opening in p.u." annotation(
@@ -1173,7 +1143,7 @@
       parameter Integer N = 10 "Max number of patients";
       parameter Real Nr = 20 "Number of respiratory acts per minute";
       parameter Real phases[:] = {0, 180, 90, 270, 45, 225, 135, 315, 22, 202, 112, 292, 158, 338, 68, 158, 11, 191, 281, 56, 237, 146} "Phase angle of each patient";
-      final parameter Modelica.SIunits.Time T = 60 / Nr;
+      final parameter Modelica.Units.SI.Time T = 60 / Nr;
       Modelica.Blocks.Interfaces.RealOutput valveCommands[N] annotation(
         Placement(transformation(extent = {{-338, 6}, {-318, 26}}), iconTransformation(extent = {{100, -20}, {140, 20}})));
       Modelica.Blocks.Interfaces.RealInput dutyCycles[N] "Duty cycle of each patient in percent" annotation(
@@ -1188,13 +1158,13 @@
     end PatientValveSequencer;
 
     model DutyCycleGenerator
-      parameter Modelica.SIunits.Time T "Sampling time";
+      parameter Modelica.Units.SI.Time T "Sampling time";
       parameter Real phase "Phase angle in degrees";
       Modelica.Blocks.Interfaces.RealInput dutyCycle annotation(
         Placement(visible = true, transformation(origin = {-100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0), iconTransformation(origin = {-100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
       Modelica.Blocks.Interfaces.RealOutput opening annotation(
         Placement(visible = true, transformation(origin = {102, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {100, 0}, extent = {{-20, -20}, {20, 20}}, rotation = 0)));
-      discrete Modelica.SIunits.Time offTime(start = -1e6, fixed = true);
+      discrete Modelica.Units.SI.Time offTime(start = -1e6, fixed = true);
     equation
       when sample(phase / 360 * T, T) then
         offTime = time + T * dutyCycle / 100;
@@ -1211,13 +1181,13 @@
         Placement(visible = true, transformation(extent = {{-130, -36}, {-90, 4}}, rotation = 0), iconTransformation(extent = {{-120, -80}, {-80, -40}}, rotation = 0)));
       Modelica.Blocks.Interfaces.RealInput RR "Respiratory rate [acts/min]" annotation(
         Placement(visible = true, transformation(extent = {{-130, 16}, {-90, 56}}, rotation = 0), iconTransformation(extent = {{-120, 40}, {-80, 80}}, rotation = 0)));
-      discrete Modelica.SIunits.Time t_on "Next opening time";
-      discrete Modelica.SIunits.Time t_off "Next closing time";
+      discrete Modelica.Units.SI.Time t_on "Next opening time";
+      discrete Modelica.Units.SI.Time t_off "Next closing time";
       Boolean active "The controller is activated";
     initial equation
       active = if RR > 1 then true else false;
       if active then
-        t_on = time + 60/RR;
+        t_on = time + 60 / RR;
         t_off = time + 60 / RR * dutyCycle / 100;
       else
         t_on = time;
@@ -1242,5 +1212,5 @@
   end Controls;
   annotation(
     version = "1.1.1",
-    uses(Modelica(version = "3.2.3")));
-end MEV;
+    uses(Modelica(version = "4.0.0")));
+end MEV;
\ No newline at end of file
Only in converted-libraries/.openmodelica/libraries/MEV 1.1.1-master: package.mo.after
Only in converted-libraries/.openmodelica/libraries/MEV 1.1.1-master: package.mo.before
