bslMS / BusinessSimulation

Dynamic modeling for business, economics, and ecology using the system dynamics approach
https://bsl-support.de/BusinessSimulation/BusinessSimulation
European Union Public License 1.2
20 stars 6 forks source link

CausalLoop.UnidirectionalFlow does not use the parameter rate #3

Closed gwr69 closed 1 year ago

gwr69 commented 2 years ago

The model CausalLoop.UnidirectionalFlow has a global parameter rate but that is not used in the ConstantConverter baseRate.

Thus the current library code:

model UnidirectionalFlow "Interaction with linear and nonlinear terms"
  import BusinessSimulation.Units.Rate;
  extends Interfaces.PartialCLD.Flow;
  parameter Rate rate = 1 "Base rate of flow from A to B";
  Converters.Product_2 actualRate "Rate of flow";
  Flows.Unidirectional.Transition flowingFromAToB;
  Converters.ConstantConverter baseRate(redeclare replaceable type OutputType = Rate, value = 1) "Base rate of flow";
equation
  ...
end UnidirectionalFlow;

Needs to be changed to:

model UnidirectionalFlow "Interaction with linear and nonlinear terms"
  import BusinessSimulation.Units.Rate;
  extends Interfaces.PartialCLD.Flow;
  parameter Rate rate = 1 "Base rate of flow from A to B";
protected
  Converters.Product_2 actualRate "Rate of flow";
  Flows.Unidirectional.Transition flowingFromAToB;
  Converters.ConstantConverter baseRate(redeclare replaceable type OutputType = Rate, value = rate) "Base rate of flow";
equation
  ...
end UnidirectionalFlow;
gwr69 commented 1 year ago

Fixed in v2.1.0.