From e238d27c296a1951ee34de02f0be3bb7d73f6980 Mon Sep 17 00:00:00 2001
From: Christian Gutsche <christian.gutsche@mailbox.tu-dresden.de>
Date: Mon, 2 Oct 2023 14:07:28 +0200
Subject: [PATCH] Better gas components

---
 Backend/EnergeticFlowPlace.mo | 64 ++++---------------------
 Distribution/CO2Pipe.mo       |  4 +-
 Distribution/DCACConverter.mo | 29 +++++++++++
 Distribution/HeatPipe.mo      |  4 +-
 Distribution/HydrogenPipe.mo  |  4 +-
 Distribution/OxygenPipe.mo    |  4 +-
 Distribution/WaterPipe.mo     |  4 +-
 Distribution/package.order    |  1 +
 Examples/EnergyPark.mo        | 18 +++----
 Examples/simpleExample.mo     | 10 ++--
 README.md                     | 90 +++--------------------------------
 11 files changed, 75 insertions(+), 157 deletions(-)
 create mode 100644 Distribution/DCACConverter.mo

diff --git a/Backend/EnergeticFlowPlace.mo b/Backend/EnergeticFlowPlace.mo
index a466978..39af9c1 100644
--- a/Backend/EnergeticFlowPlace.mo
+++ b/Backend/EnergeticFlowPlace.mo
@@ -1,10 +1,9 @@
 within PNRG.Backend;
 
-// The following code is modified Code from PNlib library.
-
 model EnergeticFlowPlace
+  // The following code is modified Code from PNlib library.
   Real t "marking";
-    //****MODIFIABLE PARAMETERS AND VARIABLES BEGIN****//
+  //****MODIFIABLE PARAMETERS AND VARIABLES BEGIN****//
   parameter Integer nIn(min = 0) = 0 "number of input transitions" annotation(
     Dialog(enable = true, group = "Connector sizing"));
   parameter Integer nOut(min = 0) = 0 "number of output transitions" annotation(
@@ -91,61 +90,18 @@ protected
   Real decFactorIn[nIn] "decreasing factors for input transitions";
   Real decFactorOut[nOut] "decreasing factors for output transitions";
 public
-  PNlib.Interfaces.PlaceIn inTransition[nIn](each t=t_,
-  each tint=1,
-  each maxTokens=maxMarks,
-  each maxTokensint=1,
-  enable=enableIn.TEin_,
-  each emptied = emptying.anytrue,
-  decreasingFactor = decFactorIn,
-  each disPlace =  false,
-  each speedSum= firingSumOut.conFiringSum,
-  fire=fireIn,
-  disTransition=disTransitionIn,
-  active=activeIn,
-  arcWeight=arcWeightIn,
-  instSpeed=instSpeedIn,
-  maxSpeed=maxSpeedIn,
-  prelimSpeed=prelimSpeedIn,
-  enabledByInPlaces=enabledByInPlaces) if nIn > 0 "connector for input transitions" annotation(Placement(
-        transformation(extent={{-114, -10}, {-98, 10}}, rotation=0),
-    iconTransformation(extent={{-116, -10}, {-100, 10}})));
-  PNlib.Interfaces.PlaceOut outTransition[nOut](each t = t_,
-  each tint=1,
-  each minTokens=minMarks,
-  each minTokensint=1,
-  enable=enableOut.TEout_,
-  each fed=feeding.anytrue,
-  decreasingFactor=decFactorOut,
-  each disPlace=false,
-  each arcType=PNlib.Types.ArcType.NormalArc,
-  each speedSum=firingSumIn.conFiringSum,
-  each tokenInOut=pre(disMarksInOut),
-  fire=fireOut,
-  disTransition=disTransitionOut,
-  active=activeOut,
-  arcWeight=arcWeightOut,
-  instSpeed=instSpeedOut,
-  maxSpeed=maxSpeedOut,
-  prelimSpeed=prelimSpeedOut,
-  each testValue=-1,
-  each testValueint=-1,
-  each normalArc=false) if nOut > 0 "connector for output transitions" annotation(Placement(
-        transformation(extent={{100, -10}, {116, 10}}, rotation=0)));
-  Modelica.Blocks.Interfaces.RealOutput pc_t=t
-    "connector for Simulink connection" annotation(Placement(
-        transformation(extent={{-36, 68}, {-16, 88}}), iconTransformation(
-        extent={{-10, -10}, {10, 10}},
-        rotation=90,
-        origin={0, 108})));
-
-
+  PNlib.Interfaces.PlaceIn inTransition[nIn](each t = t_, each tint = 1, each maxTokens = maxMarks, each maxTokensint = 1, enable = enableIn.TEin_, each emptied = emptying.anytrue, decreasingFactor = decFactorIn, each disPlace = false, each speedSum = firingSumOut.conFiringSum, fire = fireIn, disTransition = disTransitionIn, active = activeIn, arcWeight = arcWeightIn, instSpeed = instSpeedIn, maxSpeed = maxSpeedIn, prelimSpeed = prelimSpeedIn, enabledByInPlaces = enabledByInPlaces) if nIn > 0 "connector for input transitions" annotation(
+    Placement(transformation(extent = {{-114, -10}, {-98, 10}}, rotation = 0), iconTransformation(extent = {{-116, -10}, {-100, 10}})));
+  PNlib.Interfaces.PlaceOut outTransition[nOut](each t = t_, each tint = 1, each minTokens = minMarks, each minTokensint = 1, enable = enableOut.TEout_, each fed = feeding.anytrue, decreasingFactor = decFactorOut, each disPlace = false, each arcType = PNlib.Types.ArcType.NormalArc, each speedSum = firingSumIn.conFiringSum, each tokenInOut = pre(disMarksInOut), fire = fireOut, disTransition = disTransitionOut, active = activeOut, arcWeight = arcWeightOut, instSpeed = instSpeedOut, maxSpeed = maxSpeedOut, prelimSpeed = prelimSpeedOut, each testValue = -1, each testValueint = -1, each normalArc = false) if nOut > 0 "connector for output transitions" annotation(
+    Placement(transformation(extent = {{100, -10}, {116, 10}}, rotation = 0)));
+  Modelica.Blocks.Interfaces.RealOutput pc_t = t "connector for Simulink connection" annotation(
+    Placement(transformation(extent = {{-36, 68}, {-16, 88}}), iconTransformation(extent = {{-10, -10}, {10, 10}}, rotation = 90, origin = {0, 108})));
 equation
   for i in 1:nOut loop
-    arcWeightOut[i] = arcWeightOutSplit[i] * actualPower;
+    arcWeightOut[i] = arcWeightOutSplit[i]*actualPower;
   end for;
   for i in 1:nIn loop
-    actualPowers[i] = if fireIn[i] then arcWeightIn[i] * instSpeedIn[i] / maxSpeedIn[i] else 0;
+    actualPowers[i] = if fireIn[i] then arcWeightIn[i]*instSpeedIn[i]/maxSpeedIn[i] else 0;
   end for;
   power = sum(arcWeightIn);
   actualPower = sum(actualPowers);
diff --git a/Distribution/CO2Pipe.mo b/Distribution/CO2Pipe.mo
index fbb6e37..740d062 100644
--- a/Distribution/CO2Pipe.mo
+++ b/Distribution/CO2Pipe.mo
@@ -8,6 +8,7 @@ parameter Integer NIn "Number of Inputs" annotation(
   parameter Integer prioOut[NOut] "Priority of Outputs" annotation(
     Dialog(enable = true, group = "General properties"));
   Real massInput(unit = "kg");
+  Real massInputs[NIn];
   Real totalLoad(unit = "kg");
   PNRG.Interfaces.CO2Input co2Input[NIn] annotation(
     Placement(visible = true, transformation(origin = {-110, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-110, 80}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
@@ -18,9 +19,10 @@ parameter Integer NIn "Number of Inputs" annotation(
   PNlib.Components.PC p1(enablingPrioOut = prioOut, nIn = 1, nOut = NOut) annotation(
     Placement(visible = true, transformation(origin = {46, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
 equation
-  massInput = t1.power*t1.actualSpeed./t1.maximumSpeed;
+  massInput = sum(massInputs);
   totalLoad = sum(co2Output.arcWeight);
   for i in 1:NIn loop
+    massInputs[i] = co2Input[i].arcWeight*co2Input[i].instSpeed/co2Input[i].maxSpeed;
     connect(co2Input[i], t1.inPlaces[i]) annotation(
       Line(points = {{-31.2, 0}, {34.8, 0}}, thickness = 0.5));
   end for;
diff --git a/Distribution/DCACConverter.mo b/Distribution/DCACConverter.mo
new file mode 100644
index 0000000..f6e64f9
--- /dev/null
+++ b/Distribution/DCACConverter.mo
@@ -0,0 +1,29 @@
+within PNRG.Distribution;
+
+model DCACConverter
+  Real inputPower(unit = "kW");
+  Real outputPower(unit = "kW");
+  
+  parameter Real efficiency "Energy conversion effiency" annotation(
+    Dialog(enable = true, group = "General properties"));
+  Interfaces.ElectricalInput electricalInput annotation(
+    Placement(visible = true, transformation(origin = {-110, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-110, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+  Interfaces.ElectricalOutput electricalOutput annotation(
+    Placement(visible = true, transformation(origin = {110, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {110, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+  Backend.EnergeticFlowPlace p1(nIn = 1, nOut = 1)  annotation(
+    Placement(visible = true, transformation(origin = {60, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+  Backend.EnergeticTransitionWithoutActivator t11(arcWeightOut = {outputPower}, maximumSpeed = 1/3600, nIn = 1, nOut = 1) annotation(
+    Placement(visible = true, transformation(origin = {2, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+equation
+  inputPower = t11.power;
+  outputPower = inputPower*efficiency;
+  connect(t11.outPlaces[1], p1.inTransition[1]) annotation(
+    Line(points = {{6, 0}, {50, 0}}, thickness = 0.5));
+  connect(p1.outTransition[1], electricalOutput) annotation(
+    Line(points = {{70, 0}, {110, 0}}));
+  connect(t11.inPlaces[1], electricalInput) annotation(
+    Line(points = {{-2, 0}, {-110, 0}}));
+  annotation(
+    Icon(graphics = {Rectangle(fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-100, 100}, {100, -100}}), Text(origin = {-45, 119}, extent = {{-53, 23}, {53, -23}}, textString = "%name"), Line(points = {{-100, -100}, {100, 100}, {100, 100}}), Rectangle(origin = {-49, 75}, lineColor = {255, 200, 0}, fillColor = {255, 200, 0}, fillPattern = FillPattern.Solid, extent = {{-37, 7}, {37, -7}}), Text(origin = {37, -60}, textColor = {255, 200, 0}, extent = {{-227, 108}, {227, -108}}, textString = "~", fontName = "Arial"), Rectangle(origin = {-49, 53}, lineColor = {255, 200, 0}, fillColor = {255, 200, 0}, fillPattern = FillPattern.Solid, extent = {{-37, 7}, {37, -7}})}),
+    Diagram(coordinateSystem(extent = {{-120, 100}, {120, -160}})));
+end DCACConverter;
diff --git a/Distribution/HeatPipe.mo b/Distribution/HeatPipe.mo
index 7d925eb..28226c0 100644
--- a/Distribution/HeatPipe.mo
+++ b/Distribution/HeatPipe.mo
@@ -10,6 +10,7 @@ parameter Integer NIn "Number of Inputs" annotation(
     Dialog(enable = true, group = "General properties"));
   Real powerDifference(unit = "kW") "Difference between power suply and consumption";
   Real powerInput(unit = "kW");
+  Real powerInputs[NIn];
   Real totalLoad(unit = "kW");
   PNRG.Interfaces.HeatInput heatInput[NIn] annotation(
     Placement(visible = true, transformation(origin = {-110, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-110, 80}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
@@ -20,10 +21,11 @@ parameter Integer NIn "Number of Inputs" annotation(
   PNlib.Components.PC p1(enablingPrioOut = prioOut, nIn = 1, nOut = NOut) annotation(
     Placement(visible = true, transformation(origin = {46, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
 equation
-  powerInput = t1.power*t1.actualSpeed./t1.maximumSpeed;
+  powerInput = sum(powerInputs);
   totalLoad = sum(heatOutput.arcWeight);
   powerDifference = powerInput - totalLoad;
   for i in 1:NIn loop
+    powerInputs[i] = heatInput[i].arcWeight*heatInput[i].instSpeed/heatInput[i].maxSpeed;
     connect(heatInput[i], t1.inPlaces[i]) annotation(
       Line(points = {{-31.2, 0}, {34.8, 0}}, thickness = 0.5));
   end for;
diff --git a/Distribution/HydrogenPipe.mo b/Distribution/HydrogenPipe.mo
index 45e4f9e..fa65476 100644
--- a/Distribution/HydrogenPipe.mo
+++ b/Distribution/HydrogenPipe.mo
@@ -10,6 +10,7 @@ parameter Integer NIn "Number of Inputs" annotation(
     Dialog(enable = true, group = "General properties"));
   Real powerDifference(unit = "kW") "Difference between power suply and consumption";
   Real powerInput(unit = "kW");
+  Real massInputs[NIn];
   Real totalLoad(unit = "kW");
   PNRG.Interfaces.HydrogenInput hydrogenInput[NIn] annotation(
     Placement(visible = true, transformation(origin = {-110, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-110, 80}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
@@ -20,10 +21,11 @@ parameter Integer NIn "Number of Inputs" annotation(
   PNlib.Components.PC p1(enablingPrioOut = prioOut, nIn = 1, nOut = NOut) annotation(
     Placement(visible = true, transformation(origin = {46, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
 equation
-  powerInput = t1.power*t1.actualSpeed./t1.maximumSpeed;
+  powerInput = sum(massInputs);
   totalLoad = sum(hydrogenOutput.arcWeight);
   powerDifference = powerInput - totalLoad;
   for i in 1:NIn loop
+    massInputs[i] = hydrogenInput[i].arcWeight*hydrogenInput[i].instSpeed/hydrogenInput[i].maxSpeed;
     connect(hydrogenInput[i], t1.inPlaces[i]) annotation(
       Line(points = {{-31.2, 0}, {34.8, 0}}, thickness = 0.5));
   end for;
diff --git a/Distribution/OxygenPipe.mo b/Distribution/OxygenPipe.mo
index f7721b5..f68551b 100644
--- a/Distribution/OxygenPipe.mo
+++ b/Distribution/OxygenPipe.mo
@@ -8,6 +8,7 @@ parameter Integer NIn "Number of Inputs" annotation(
   parameter Integer prioOut[NOut] "Priority of Outputs" annotation(
     Dialog(enable = true, group = "General properties"));
   Real massInput(unit = "kg");
+  Real massInputs[NIn];
   Real totalLoad(unit = "kg");
   PNRG.Interfaces.OxygenInput oxygenInput[NIn] annotation(
     Placement(visible = true, transformation(origin = {-110, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-110, 80}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
@@ -18,9 +19,10 @@ parameter Integer NIn "Number of Inputs" annotation(
   PNlib.Components.PC p1(enablingPrioOut = prioOut, nIn = 1, nOut = NOut) annotation(
     Placement(visible = true, transformation(origin = {46, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
 equation
-  massInput = t1.power*t1.actualSpeed./t1.maximumSpeed;
+  massInput = sum(massInputs);
   totalLoad = sum(oxygenOutput.arcWeight);
   for i in 1:NIn loop
+    massInputs[i] = oxygenInput[i].arcWeight*oxygenInput[i].instSpeed/oxygenInput[i].maxSpeed;
     connect(oxygenInput[i], t1.inPlaces[i]) annotation(
       Line(points = {{-31.2, 0}, {34.8, 0}}, thickness = 0.5));
   end for;
diff --git a/Distribution/WaterPipe.mo b/Distribution/WaterPipe.mo
index 372f835..34940d8 100644
--- a/Distribution/WaterPipe.mo
+++ b/Distribution/WaterPipe.mo
@@ -10,6 +10,7 @@ parameter Integer NIn "Number of Inputs" annotation(
     Dialog(enable = true, group = "General properties"));
   Real powerDifference(unit = "kg") "Difference between power suply and consumption";
   Real powerInput(unit = "kg");
+  Real massInputs[NIn];
   Real totalLoad(unit = "kg");
   PNRG.Interfaces.WaterInput waterInput[NIn] annotation(
     Placement(visible = true, transformation(origin = {-110, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0), iconTransformation(origin = {-110, 80}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
@@ -20,10 +21,11 @@ parameter Integer NIn "Number of Inputs" annotation(
   PNlib.Components.PC p1(enablingPrioOut = prioOut, nIn = 1, nOut = NOut) annotation(
     Placement(visible = true, transformation(origin = {46, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
 equation
-  powerInput = t1.power*t1.actualSpeed./t1.maximumSpeed;
+  powerInput = sum(massInputs);
   totalLoad = sum(waterOutput.arcWeight);
   powerDifference = powerInput - totalLoad;
   for i in 1:NIn loop
+    massInputs[i] = waterInput[i].arcWeight*waterInput[i].instSpeed/waterInput[i].maxSpeed;
     connect(waterInput[i], t1.inPlaces[i]) annotation(
       Line(points = {{-31.2, 0}, {34.8, 0}}, thickness = 0.5));
   end for;
diff --git a/Distribution/package.order b/Distribution/package.order
index bd094af..827d0e8 100644
--- a/Distribution/package.order
+++ b/Distribution/package.order
@@ -8,3 +8,4 @@ OxygenPipe
 HeatPipe
 CO2Pipe
 NaturalGasPipe
+DCACConverter
diff --git a/Examples/EnergyPark.mo b/Examples/EnergyPark.mo
index 8218630..362325b 100644
--- a/Examples/EnergyPark.mo
+++ b/Examples/EnergyPark.mo
@@ -18,7 +18,7 @@ model EnergyPark
   PNRG.PowerPlants.PVPowerPlant pVPowerPlant(areaPV = 1000) annotation(
     Placement(visible = true, transformation(origin = {-120, 74}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
   PNRG.EnergyConsumer.ElectricityConsumer electricityConsumer annotation(
-    Placement(visible = true, transformation(origin = {182, 114}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
+    Placement(visible = true, transformation(origin = {182, 116}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
   PNRG.Distribution.OxygenPipe oxygenPipe(NIn = 1, NOut = 1, prioOut = {1})  annotation(
     Placement(visible = true, transformation(origin = {-4, 56}, extent = {{-12, 4}, {12, 12}}, rotation = 0)));
   PNRG.Distribution.HydrogenPipe hydrogenPipe(NIn = 1, NOut = 1, prioOut = {1})  annotation(
@@ -34,7 +34,7 @@ model EnergyPark
   PNRG.Distribution.WaterPipe waterPipe1(NIn = 1, NOut = 1, prioOut = {1})  annotation(
     Placement(visible = true, transformation(origin = {62, 36}, extent = {{12, 4}, {-12, 12}}, rotation = 0)));
   PNRG.Sources.FileToTransitionOutput fileToTransitionOutput11(NOut = 1, fileName = "P:/Programs/PNRG/data4.txt", tableName = "tab1") annotation(
-    Placement(visible = true, transformation(origin = {182, 134}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
+    Placement(visible = true, transformation(origin = {182, 136}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
   PNRG.Logics.LogicalExpression logicalExpression(NOut = 1, expression = time > 70000)  annotation(
     Placement(visible = true, transformation(origin = {96, 188}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
   PNRG.Logics.LogicalExpression logicalExpression1(NOut = 1, expression = time > 70000)  annotation(
@@ -43,13 +43,13 @@ model EnergyPark
     Placement(visible = true, transformation(origin = {72, 174}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
   PNRG.Logics.LogicalExpression logicalExpression111(NOut = 1, expression = time > 70000)  annotation(
     Placement(visible = true, transformation(origin = {72, 200}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
-  PNRG.Logics.LogicalExpression logicalExpression1111(NOut = 1, expression = 39.4 + electricityConsumer.powerConsumption < distributionPowerGrid.powerInput)  annotation(
+  PNRG.Logics.LogicalExpression logicalExpression1111(NOut = 1, expression = true)  annotation(
     Placement(visible = true, transformation(origin = {-28, 202}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
-  PNRG.Logics.LogicalExpression logicalExpression11111(NOut = 1, expression = 39.4 + electricityConsumer.powerConsumption < distributionPowerGrid.powerInput)  annotation(
+  PNRG.Logics.LogicalExpression logicalExpression11111(NOut = 1, expression = true)  annotation(
     Placement(visible = true, transformation(origin = {-28, 176}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
-  PNRG.Logics.LogicalExpression logicalExpression111111(NOut = 1, expression = 39.4 + electricityConsumer.powerConsumption < distributionPowerGrid.powerInput)  annotation(
+  PNRG.Logics.LogicalExpression logicalExpression111111(NOut = 1, expression = true)  annotation(
     Placement(visible = true, transformation(origin = {-28, 150}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
-  PNRG.Logics.LogicalExpression logicalExpression1111111(NOut = 1, expression = 39.4 + electricityConsumer.powerConsumption < distributionPowerGrid.powerInput)  annotation(
+  PNRG.Logics.LogicalExpression logicalExpression1111111(NOut = 1, expression = true)  annotation(
     Placement(visible = true, transformation(origin = {-52, 164}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
   PNRG.Sources.StochasticSource stochasticSource(NOut = 1) annotation(
     Placement(visible = true, transformation(origin = {182, 38}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
@@ -57,7 +57,7 @@ model EnergyPark
     Placement(visible = true, transformation(origin = {182, 18}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
   PNRG.Storage.Battery battery(power = 2)  annotation(
     Placement(visible = true, transformation(origin = {20, 138}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
-  PNRG.Logics.LogicalExpression logicalExpression2(NOut = 1, expression = 39.4 + electricityConsumer.powerConsumption+ 10 < distributionPowerGrid.powerInput) annotation(
+  PNRG.Logics.LogicalExpression logicalExpression2(NOut = 1, expression =   time> 50000) annotation(
     Placement(visible = true, transformation(origin = {96, 162}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
   PNRG.Logics.LogicalExpression logicalExpression21(NOut = 1, expression = false) annotation(
     Placement(visible = true, transformation(origin = {-52, 190}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
@@ -111,7 +111,7 @@ equation
   connect(h2Tank.hydrogenOutput, hydrogenPipe1.hydrogenInput[1]) annotation(
     Line(points = {{41, 84}, {51, 84}}, color = {106, 168, 79}));
   connect(fileToTransitionOutput11.fileOutput[1], electricityConsumer.fileInput) annotation(
-    Line(points = {{171, 134}, {166, 134}, {166, 120}, {171, 120}}, color = {150, 150, 150}));
+    Line(points = {{171, 136}, {166, 136}, {166, 122}, {171, 122}}, color = {150, 150, 150}));
   connect(logicalExpression111111.logicalOutput[1], h2Tank.logicalInput) annotation(
     Line(points = {{-17, 150}, {2, 150}, {2, 90}, {19, 90}}, color = {53, 28, 117}));
   connect(logicalExpression11111.logicalOutput[1], o2Tank.logicalInput) annotation(
@@ -181,7 +181,7 @@ equation
   connect(fileToTransitionOutput.fileOutput[2], sTEPowerPlant.fileInput) annotation(
     Line(points = {{-149, 74}, {-141, 74}, {-141, 24}, {-131, 24}}, color = {150, 150, 150}));
   connect(distributionPowerGrid.electricalOutput[1], electricityConsumer.electricalInput) annotation(
-    Line(points = {{40.5, 116}, {104.75, 116}, {104.75, 114}, {171, 114}}, color = {255, 200, 0}));
+    Line(points = {{40.5, 116}, {171, 116}}, color = {255, 200, 0}));
   connect(naturalGasPowerPlant2.electricalOutput, distributionPowerGrid.electricalInput[4]) annotation(
     Line(points = {{-87, -39}, {-87, -38.5}, {-81, -38.5}, {-81, 116}, {7.5, 116}}, color = {255, 200, 0}));
 protected
diff --git a/Examples/simpleExample.mo b/Examples/simpleExample.mo
index b0c1822..9f2a42b 100644
--- a/Examples/simpleExample.mo
+++ b/Examples/simpleExample.mo
@@ -15,7 +15,7 @@ model simpleExample
     Placement(visible = true, transformation(origin = {-80, -44}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
   PNRG.EnergyConsumer.ElectricityConsumer electricityConsumer annotation(
     Placement(visible = true, transformation(origin = {150, -14}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
-  PNRG.PowerPlants.WindPowerPlant windPowerPlant(efficiencyTurbine = 0.5, number = testController.N, rotorLength = 3) annotation(
+  PNRG.PowerPlants.WindPowerPlant windPowerPlant(efficiencyTurbine = 0.4, number = testController.N, rotorLength = 3) annotation(
     Placement(visible = true, transformation(origin = {-80, -20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
   PNRG.Storage.Battery battery(power = 10)  annotation(
     Placement(visible = true, transformation(origin = {64, -12}, extent = {{10, -10}, {-10, 10}}, rotation = 0)));
@@ -38,7 +38,7 @@ model simpleExample
   EnergyConsumer.ElectricityConsumer electricityConsumer1 annotation(
     Placement(visible = true, transformation(origin = {150, -44}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
   PNRG.Logics.LogicalAnd logicalAnd annotation(
-    Placement(visible = true, transformation(origin = {-50, 48}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
+    Placement(visible = true, transformation(origin = {-50, 56}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
   Logics.LogicalOr logicalOr annotation(
     Placement(visible = true, transformation(origin = {82, 40}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
   Logics.LogicalExpression logicalExpression2(NOut = 1, expression = testController.N < testController.NMax) annotation(
@@ -77,11 +77,11 @@ equation
   connect(fileToTransitionOutput11.fileOutput[1], electricityConsumer1.fileInput) annotation(
     Line(points = {{121, 50}, {128, 50}, {128, -38}, {139, -38}}, color = {150, 150, 150}));
   connect(logicalAnd.logicalOutput, testController.logicalInput1) annotation(
-    Line(points = {{-50, 37}, {-50.5, 37}, {-50.5, 31}, {-51, 31}}, color = {53, 28, 117}));
+    Line(points = {{-50, 45}, {-50.5, 45}, {-50.5, 31}, {-51, 31}}, color = {53, 28, 117}));
   connect(logicalExpression.logicalOutput[2], logicalAnd.logicalInput1) annotation(
-    Line(points = {{22, 98}, {30, 98}, {30, 78}, {-45, 78}, {-45, 59}}, color = {53, 28, 117}));
+    Line(points = {{22, 98}, {30, 98}, {30, 78}, {-45, 78}, {-45, 67}}, color = {53, 28, 117}));
   connect(logicalExpression11.logicalOutput[1], logicalAnd.logicalInput2) annotation(
-    Line(points = {{-69, 78}, {-55, 78}, {-55, 59}}, color = {53, 28, 117}));
+    Line(points = {{-69, 78}, {-55, 78}, {-55, 67}}, color = {53, 28, 117}));
   connect(logicalOr.logicalOutput, battery.logicalInput) annotation(
     Line(points = {{82, 30}, {82, -6}, {76, -6}}, color = {53, 28, 117}));
   connect(logicalExpression.logicalOutput[1], logicalOr.logicalInput) annotation(
diff --git a/README.md b/README.md
index 4584349..f07a656 100644
--- a/README.md
+++ b/README.md
@@ -1,92 +1,14 @@
 # PNRG
 
+The Petri Net Renewable Energy Grids library (PNRG) is a library for modeling energy systems based on Hybrid Petri net. The models are based on the Petri net implementation of the [PNlib library](https://github.com/AMIT-HSBI/PNlib/tree/master).
 
+The goal is to model energy systems in different states and to control the state transitions within Modelica using the same Petri net structure that is used for the model itself.
 
-## Getting started
-
-To make it easy for you to get started with GitLab, here's a list of recommended next steps.
-
-Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)!
-
-## Add your files
-
-- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files
-- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command:
-
-```
-cd existing_repo
-git remote add origin https://git-st.inf.tu-dresden.de/cgutsche/PNRG.git
-git branch -M main
-git push -uf origin main
-```
-
-## Integrate with your tools
-
-- [ ] [Set up project integrations](https://git-st.inf.tu-dresden.de/cgutsche/PNRG/-/settings/integrations)
-
-## Collaborate with your team
-
-- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/)
-- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html)
-- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically)
-- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/)
-- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html)
-
-## Test and Deploy
-
-Use the built-in continuous integration in GitLab.
-
-- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html)
-- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/)
-- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html)
-- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
-- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
-
-***
-
-# Editing this README
-
-When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
-
-## Suggestions for a good README
-Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
-
-## Name
-Choose a self-explaining name for your project.
-
-## Description
-Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
-
-## Badges
-On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
-
-## Visuals
-Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
-
-## Installation
-Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
-
-## Usage
-Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
-
-## Support
-Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
-
-## Roadmap
-If you have ideas for releases in the future, it is a good idea to list them in the README.
-
-## Contributing
-State if you are open to contributions and what your requirements are for accepting them.
-
-For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
+## License
 
-You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
+This Modelica package is free software and the use is completely at your own risk; it can be redistributed and/or modified under the terms of the [Modelica License 2](https://modelica.org/licenses/ModelicaLicense2/).
 
-## Authors and acknowledgment
-Show your appreciation to those who have contributed to the project.
 
-## License
-For open source projects, say how it is licensed.
+## Contact
 
-## Project status
-If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
+For questions, remarks and suggestions please send me an e-mail: christian.gutsche@tu-dresden.de
\ No newline at end of file
-- 
GitLab