Skip to content

Commit

Permalink
Release (#6)
Browse files Browse the repository at this point in the history
* release candidate

This is v2.2.0-wsm and needs to be adapted to be compatible with Open Modelica

* Update FUNDING.yml

added PayPal Link

* Update FUNDING.yml

* delete redundant Icon and Diagram annotations

Great catch!

* Update ConstantConverterBoolean.mo

Remove redundant Icon() and Diagram() annotations

* Update package.mo

Fix missing </a> in hyperlink of documentation

* make type Icons invisible

Icon layer of a replaceable type should not be inherited by dependent classes

* fix output connector icons

output connectors with replaceable type OutputType should not inherit the letter "R" from the type component. Using IconMap at the right place this is now fixed.

* Update DataTransferRate.mo

corrected syntax error in revision annotation

* adapt to Open Modelica backend

Avoid array slicing in initial equation sections for DelayN. Remove "Press F1 for documentation" diagram displays.

* adapt examples

Adapt examples to Open Modelica and other tools, which do not allow for entering non-SI units of time like years or months. All models are now stricly in seconds, which are to be interpreted as "standard model unit of time".

* Update SoftwareReleaseProject.mo

add diagram display of unit of time interpretation

* fix missing diagram titles

Diagram titles and page definitions were lost in last commit and needed to be replaced

* Update SimpleProductionChain.mo

* preparing the release

Everything should now run smoothly in OMEdit.
  • Loading branch information
gwr69 authored Apr 4, 2024
1 parent 0130f5e commit 608cf49
Show file tree
Hide file tree
Showing 564 changed files with 2,530 additions and 1,427 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
custom: "https://www.paypal.com/donate/?hosted_button_id=GXVZT8LD7CFXN"
12 changes: 6 additions & 6 deletions BusinessSimulation/CausalLoop/Aggregation.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ within BusinessSimulation.CausalLoop;

model Aggregation "Generalized mean function for multiple stock information inputs"
import BusinessSimulation.Units.*;
import BusinessSimulation.Interfaces.Connectors.{StockInfoMultiInput,StockInfoOutput};
import BusinessSimulation.Interfaces.Connectors.{StockInfoMultiInput, StockInfoOutput};
import BusinessSimulation.Types.AggregateFunctions;
import BusinessSimulation.Types.StockInformation;
import BusinessSimulation.Sensors.AbsoluteSensor;
Expand All @@ -15,11 +15,11 @@ model Aggregation "Generalized mean function for multiple stock information inpu
protected
StockInformation aggregateStockInformation "Aggregate stock information";
AbsoluteSensor[nin] absoluteSensor annotation(Placement(visible = true, transformation(origin = {-100, 0}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
AggregatePerformance aggregateIN(nin = nin, func = func, useWeights = true, hasConstantWeights = true, weights = weights, redeclare type OutputType = Rate) annotation(Placement(visible = true, transformation(origin = {-0, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
AggregatePerformance aggregateIN(nin = nin, func = func, useWeights = true, hasConstantWeights = true, weights = weights) annotation(Placement(visible = true, transformation(origin = {-0, 70}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
AggregatePerformance aggregateS(nin = nin, func = func, useWeights = true, hasConstantWeights = true, weights = weights) annotation(Placement(visible = true, transformation(origin = {0, 30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
AggregatePerformance aggregateMRT(nin = nin, func = func, useWeights = true, hasConstantWeights = true, weights = weights, redeclare type OutputType = Time) annotation(Placement(visible = true, transformation(origin = {0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
AggregatePerformance aggregateF(nin = nin, func = func, useWeights = true, hasConstantWeights = true, weights = weights, redeclare type OutputType = Rate) annotation(Placement(visible = true, transformation(origin = {0, -30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
AggregatePerformance aggregateOUT(nin = nin, func = func, useWeights = true, hasConstantWeights = true, weights = weights, redeclare type OutputType = Rate) annotation(Placement(visible = true, transformation(origin = {-0, -70}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
AggregatePerformance aggregateMRT(nin = nin, func = func, useWeights = true, hasConstantWeights = true, weights = weights, redeclare replaceable type OutputType = Unspecified) annotation(Placement(visible = true, transformation(origin = {0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
AggregatePerformance aggregateF(nin = nin, func = func, useWeights = true, hasConstantWeights = true, weights = weights) annotation(Placement(visible = true, transformation(origin = {0, -30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
AggregatePerformance aggregateOUT(nin = nin, func = func, useWeights = true, hasConstantWeights = true, weights = weights) annotation(Placement(visible = true, transformation(origin = {-0, -70}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(stockInfoInput, absoluteSensor.u_stockInfo) annotation(Line(visible = true, origin = {-124.5, 0}, points = {{-20.5, 0}, {20.5, 0}}, color = {128, 0, 128}));
connect(absoluteSensor.inFlow, aggregateIN.u) annotation(Line(visible = true, origin = {-54.6, 28.607}, points = {{-41.4, -18.607}, {19.6, -18.607}, {19.6, 41.393}, {43.6, 41.393}}, color = {1, 37, 163}));
Expand All @@ -31,7 +31,7 @@ equation
stockInfoOutput = aggregateStockInformation;
/* block, information processing */
annotation(defaultComponentName = "b", Documentation(info = "<html>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL).</p>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL). Please support this work and <a href=\"https://www.paypal.com/donate/?hosted_button_id=GXVZT8LD7CFXN\" style=\"font-weight:bold; color:orange; text-decoration:none;\">&#9658;&nbsp;donate</a>.</p>
<p>The component uses the selected aggreagation function <code>func</code> applying constant <code>weights</code> to aggregate each information (→<a href=\"modelica://BusinessSimulation.Types.StockInformation\"><code>StockInformation</code></a>) provided within the <code>nin</code> input connectors (<code>stockInfoInput[nin</code>). The output is given via a single <code>stockInfoOutput</code>.</p>
<h4>See also</h4>
<p>
Expand Down
2 changes: 1 addition & 1 deletion BusinessSimulation/CausalLoop/Aggregation_Info.mo
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ equation
connect(aggregateInformation.y, y) annotation(Line(visible = true, origin = {86.543, 0}, points = {{-75.543, 0}, {75.543, 0}}, color = {1, 37, 163}));
/* block, information processing */
annotation(ddefaultComponentName = "b", Documentation(info = "<html>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL).</p>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL). Please support this work and <a href=\"https://www.paypal.com/donate/?hosted_button_id=GXVZT8LD7CFXN\" style=\"font-weight:bold; color:orange; text-decoration:none;\">&#9658;&nbsp;donate</a>.</p>
<p>The output <strong>y</strong> is obtained by applying the selected aggregation function <code>func</code> with constant weights to <code>nin</code> inputs <strong>u</strong><code>[nin]</code>.</p>
<h4>See also</h4>
<p>
Expand Down
2 changes: 1 addition & 1 deletion BusinessSimulation/CausalLoop/ComplexInteraction.mo
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ equation
connect(complexInteraction.y1_A, y_A) annotation(Line(visible = true, origin = {-63.354, -22.5}, points = {{52.854, 17.5}, {23.354, 17.5}, {23.354, -17.5}, {-99.563, -17.5}}, color = {1, 37, 163}));
/* flow */
annotation(defaultComponentName = "f", Documentation(info = "<html>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL).</p>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL). Please support this work and <a href=\"https://www.paypal.com/donate/?hosted_button_id=GXVZT8LD7CFXN\" style=\"font-weight:bold; color:orange; text-decoration:none;\">&#9658;&nbsp;donate</a>.</p>
<p>Using →<a href = \"modelica://BusinessSimulation.Flows.Interaction.ComplexInteraction\"><code>ComplexInteraction</code></a> this component allows to logically connect two flows influencing two stocks <strong>A</strong> (connected to <code>portA</code>) and <strong>B</strong> (connected to <code>portB</code>). The formula for the resulting flows (using <a href=\"https://wiki2.org/en/Newton%27s_notation+Brights.4#Newton's_notation\">Newton's dot notation</a>) has <em>linear</em> and <em>nonlinear</em> terms:</p>
<p><img src=\"modelica://BusinessSimulation/Resources/Images/Flows/Interaction/ComplexInteraction/Formula.svg\" alt=\"Formula.svg\"></p>
<p>The coefficients are given by parameters, which are multiplied either with 1 (<code>hasFactor = false</code>) or an exogenous factor <strong>u</strong> (<code>hasFactor = true</code>). Upon setting <code>hasRateOutput = true</code> the component will report the current rate of flows via output connectors (<code>y_A, y_B</code>).</p>
Expand Down
4 changes: 2 additions & 2 deletions BusinessSimulation/CausalLoop/Elasticity.mo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ model Elasticity "Fractional rate of change is proportional to that of the influ
parameter Boolean isCCR = true "= true, if the factional rate given is assumed to be a continuously compounding rate else the rate will be converted (growing.isCCR)" annotation(Evaluate = true, Dialog(group = "Structural Parameters"));
protected
SourcesOrSinks.ExponentialChange exponentiallyChanging(isCCR = isCCR) annotation(Placement(visible = true, transformation(origin = {0, 0}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Converters.Division_Guarded fracGrowthRateStock(redeclare final type OutputType = Units.Rate) "Zero if divided by zero" annotation(Placement(visible = true, transformation(origin = {-80, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Converters.Division_Guarded fracGrowthRateStock "Zero if divided by zero" annotation(Placement(visible = true, transformation(origin = {-80, 10}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
Converters.Product_2 fracGrowthRate annotation(Placement(visible = true, transformation(origin = {-30, 25}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
equation
connect(absoluteSensor1.stock, fracGrowthRateStock.u2) annotation(Line(visible = true, origin = {-103.5, 4.976}, points = {{-12.5, -0.024}, {-1.5, -0.024}, {-1.5, 0.024}, {15.5, 0.024}}, color = {1, 37, 163}));
Expand All @@ -19,7 +19,7 @@ equation
connect(exponentiallyChanging.y1, y1) annotation(Line(visible = true, origin = {63.146, -22.5}, points = {{-52.646, 17.5}, {-23.146, 17.5}, {-23.146, -17.5}, {98.937, -17.5}}, color = {1, 37, 163}));
/* relation */
annotation(defaultComponentName = "r", Documentation(info = "<html>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL).</p>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL). Please support this work and <a href=\"https://www.paypal.com/donate/?hosted_button_id=GXVZT8LD7CFXN\" style=\"font-weight:bold; color:orange; text-decoration:none;\">&#9658;&nbsp;donate</a>.</p>
<p>In a dynamic relation, a given <em>elasticity coefficient</em> (<code>coefficient</code>) implies that the fractional rate of change for an influenced stock <strong>B</strong> is proportional to the fractional rate of change for the influencing stock <strong>A</strong>, which is connected via the <code>stockInfoInput</code>. The factor of proportionality in this case is called the <a href=\"https://wiki2.org/en/Elasticity_(economics)+Brights.4\"><em>A-elasticity of B</em></a>. The rate of change for the stock <strong>B</strong> that is connected to the <code>flowPort</code> accordingly is given by the following equation, which uses <a href=\"https://wiki2.org/en/Newton%27s_notation+Brights.4#Newton's_notation\">Newton's dot notation</a> for rates:
<p><img src=\"modelica://BusinessSimulation/Resources/Images/CausalLoop/Elasticity/Formula.svg\" alt=\"Ḃ = ... \"></p>
<h4>Implementation</h4>
Expand Down
2 changes: 1 addition & 1 deletion BusinessSimulation/CausalLoop/ElasticityDelayed.mo
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ equation
connect(absoluteSensor.outFlow, y1) annotation(Line(visible = true, origin = {60.785, 4.8}, points = {{-50.785, 19.2}, {-50.785, 35.2}, {-0.785, 35.2}, {-0.785, -44.8}, {101.298, -44.8}}, color = {1, 37, 163}));
/* relation */
annotation(defaultComponentName = "r", Documentation(info = "<html>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL).</p>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL). Please support this work and <a href=\"https://www.paypal.com/donate/?hosted_button_id=GXVZT8LD7CFXN\" style=\"font-weight:bold; color:orange; text-decoration:none;\">&#9658;&nbsp;donate</a>.</p>
<p>The <em>ElasticityDelayed</em> compactly combines →<a href=\"modelica://BusinessSimulation.CausalLoop.Elasticity\"><code>Elasticity</code></a> with →<a href=\"modelica://BusinessSimulation.CausalLoop.ExponentialDelay\"><code>ExponentialDelay</code></a>.</p>
<h4>Notes</h4>
<p>There are no optional input connectors for this component. If exogenous inputs (e.g., factors) are needed, then <code>Elasticity</code> and <code>ExponentialDelay</code> have to be used in combination.</p>
Expand Down
2 changes: 1 addition & 1 deletion BusinessSimulation/CausalLoop/ExponentialChange.mo
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ equation
connect(exponentiallyChanging.y1, y1) annotation(Line(visible = true, origin = {63.146, -22.5}, points = {{-52.646, 17.5}, {-23.146, 17.5}, {-23.146, -17.5}, {98.937, -17.5}}, color = {1, 37, 163}));
/* process */
annotation(defaultComponentName = "p", Documentation(info = "<html>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL).</p>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL). Please support this work and <a href=\"https://www.paypal.com/donate/?hosted_button_id=GXVZT8LD7CFXN\" style=\"font-weight:bold; color:orange; text-decoration:none;\">&#9658;&nbsp;donate</a>.</p>
<p>Using the →<a href=\"modelica://BusinessSimulation.SourcesOrSinks.ExponentialChange\"><code>ExponentialChange</code></a> component from the <code>SourcesOrSinks</code> package, this component allows to model exponential change at either a constant fractional <code>rate</code> or at an exogneous rate given by the input <code>u_rate</code>.</p>
<p>The process by default is active over the whole simulation run, but can be restricted to an <em>on-off period</em> using <code>tc = TimingChoices.period</code> and the parameters <code>startTime</code> and <code>stopTime</code>. Any given rate—<code>rate</code> or <code>u_rate</code>—can be <em>modified</em> by multiplication with an optionally given input <strong>u</strong>.</p>
<h4>Implementation</h4>
Expand Down
2 changes: 1 addition & 1 deletion BusinessSimulation/CausalLoop/ExponentialDelay.mo
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ equation
connect(actualStockB.u2, outflowDelay.y2) annotation(Line(visible = true, origin = {60.417, -31.333}, points = {{21.583, 77.333}, {39.583, 77.333}, {39.583, -43.667}, {-30.417, -43.667}, {-30.417, -33.667}, {-39.917, -33.667}}, color = {1, 37, 163}));
/* delay */
annotation(defaultComponentName = "d", Documentation(info = "<html>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL).</p>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL). Please support this work and <a href=\"https://www.paypal.com/donate/?hosted_button_id=GXVZT8LD7CFXN\" style=\"font-weight:bold; color:orange; text-decoration:none;\">&#9658;&nbsp;donate</a>.</p>
<p>The →<a href=\"modelica://BusinessSimulation.Stocks.DelayN\"><code>DelayN</code></a> is used to model an <em>exponential delay</em> of order <code>ORD</code>. The aggregate nature of causal loop modeling requires to make a clear distinction between delaying an <em>inflow to</em> as opposed to an <em>outflow from</em> the stock connected to the <code>flowPort</code>: A delayed inflow will <em>reach</em> the stock with a delay, while a delayed outflow will <em>leave</em> the stock with a delay.</p>
<p>While modeling a delayed inflow is uncontroversial, modeling a delayed outflow imposes choices: Setting <code>subtractDelayedOutflow = true</code> will report the current amount in the stock less the amount that is in the process of being delayed at the <code>stockPort</code>. Accordingly, a process of <em>exponential decay</em> will not drain the stock below zero.</p>
<p>If this is not wanted, setting <code>subtractDelayedOutflow = false</code> will report the actual stock level, i.e., any material that has not yet left the stock will be considered a still <em>active</em> member of the stock in the process . Accordingly, a delayed process of exponential decay could drain the stock below zero.</p>
Expand Down
2 changes: 1 addition & 1 deletion BusinessSimulation/CausalLoop/ForceToInputValue.mo
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ equation
connect(changing.y1, y1) annotation(Line(visible = true, origin = {53.146, -22.5}, points = {{-42.646, 17.5}, {-33.146, 17.5}, {-33.146, -17.5}, {108.937, -17.5}}, color = {1, 37, 163}));
/* control */
annotation(defaultComponentName = "c", Documentation(info = "<html>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL).</p>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL). Please support this work and <a href=\"https://www.paypal.com/donate/?hosted_button_id=GXVZT8LD7CFXN\" style=\"font-weight:bold; color:orange; text-decoration:none;\">&#9658;&nbsp;donate</a>.</p>
<p>The <em>force to input value notation</em> follows the one proposed by van Zijderveld [<a href=\"modelica://BusinessSimulation.UsersGuide.References\">24</a>]. It indicates some form of <em>control</em> as the input <strong>u</strong> provides the setpoint for a process of \"<em>closing the gap</em>\" adjustment (<a href = \"modelica://BusinessSimulation.MoleculesOfStructure.Policy.CloseGap\"><code>CloseGap</code></a>) with regard to the influenced stock connected to the component's <code>flowPort</code>.</p>
<h4>Implementation</h4>
<p>
Expand Down
2 changes: 1 addition & 1 deletion BusinessSimulation/CausalLoop/ForceToStockValue.mo
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ equation
connect(changing.y1, y1) annotation(Line(visible = true, origin = {63.146, -22.5}, points = {{-52.646, 17.5}, {-23.146, 17.5}, {-23.146, -17.5}, {98.937, -17.5}}, color = {1, 37, 163}));
/* control */
annotation(defaultComponentName = "c", Documentation(info = "<html>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL).</p>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL). Please support this work and <a href=\"https://www.paypal.com/donate/?hosted_button_id=GXVZT8LD7CFXN\" style=\"font-weight:bold; color:orange; text-decoration:none;\">&#9658;&nbsp;donate</a>.</p>
<p>The <em>force to stock value notation</em> follows the one proposed by van Zijderveld [<a href=\"modelica://BusinessSimulation.UsersGuide.References\">24</a>]. It indicates some form of <em>control</em> as the influencing stock's value—connected to the <code>stockInfoInput</code>—provides the setpoint for a process of \"<em>closing the gap</em>\" adjustment (<a href = \"modelica://BusinessSimulation.MoleculesOfStructure.Policy.CloseGap\"><code>CloseGap</code></a>) with regard to the influenced stock connected to the component's <code>flowPort</code>.</p>
<h4>Implementation</h4>
<p>
Expand Down
2 changes: 1 addition & 1 deletion BusinessSimulation/CausalLoop/InfoFlowIndicator.mo
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ model InfoFlowIndicator "Directional indicator for information flows in a diagra
extends ICON;
/* label */
annotation(defaultComponentName = "lab", Documentation(info = "<html>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL).</p>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL). Please support this work and <a href=\"https://www.paypal.com/donate/?hosted_button_id=GXVZT8LD7CFXN\" style=\"font-weight:bold; color:orange; text-decoration:none;\">&#9658;&nbsp;donate</a>.</p>
<p>The <em>information flow indicator</em> can be used to clarify direction of information flows where appropriate in more complex diagrams. The component will not introduce any equations and is intended for diagramming purposes only.</p>
<h4>See also</h4>
<p>
Expand Down
2 changes: 1 addition & 1 deletion BusinessSimulation/CausalLoop/InputControl.mo
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ equation
connect(rampInput.y, y) annotation(Line(visible = true, origin = {64.833, 0}, points = {{-96.833, 0}, {96.833, 0}}, color = {1, 37, 163}));
/* control */
annotation(defaultComponentName = "c", Documentation(info = "<html>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL).</p>
<p class=\"aside\">This information is part of the Business Simulation&nbsp;Library (BSL). Please support this work and <a href=\"https://www.paypal.com/donate/?hosted_button_id=GXVZT8LD7CFXN\" style=\"font-weight:bold; color:orange; text-decoration:none;\">&#9658;&nbsp;donate</a>.</p>
<p><em>InputControl</em> is an InformationSource, whose output <strong>y</strong> is given by a →<a href=\"modelica://BusinessSimulation.InformationSources.RampInput\"><code>RampInput</code></a>. It can be used to model some kind of intervention that changes an information input, which the component is connected to, from <code>initialInput</code> to <code>finalInput</code> in a linear fashion over a time span set by the parameter <code>duration</code> starting at <code>startTime</code>.</p>
<h4>Notes</h4>
<p>This component can be used to indicate interventions that set or change rates of processes (using optional input connectors) or goals, i.e., setpoints.</p>
Expand Down
Loading

0 comments on commit 608cf49

Please sign in to comment.