diff --git a/Modelica/Blocks/Sources.mo b/Modelica/Blocks/Sources.mo index 8fbd5f270a..99b77f17d7 100644 --- a/Modelica/Blocks/Sources.mo +++ b/Modelica/Blocks/Sources.mo @@ -244,13 +244,13 @@ The Real output y is a step signal: block Ramp "Generate ramp signal" parameter Real height=1 "Height of ramp" annotation(Dialog(groupImage="modelica://Modelica/Resources/Images/Blocks/Sources/Ramp.png")); - parameter SI.Time duration(min=0.0, start=2) - "Duration of ramp (= 0.0 gives a Step)"; + parameter SI.Time duration(min=Constants.small, start=2) + "Duration of ramp"; extends Interfaces.SignalSource; equation - y = offset + (if time < startTime then 0 else if time < (startTime + - duration) then (time - startTime)*height/duration else height); + y = smooth(0, offset + (if time < startTime then 0 else if time < (startTime + + duration) then (time - startTime)*height/duration else height)); annotation ( Icon(coordinateSystem( preserveAspectRatio=true, @@ -281,10 +281,6 @@ The Real output y is a ramp signal: \"Ramp.png\" - -

-If parameter duration is set to 0.0, the limiting case of a Step signal is achieved. -

")); end Ramp; diff --git a/Modelica/Fluid/Examples/BranchingDynamicPipes.mo b/Modelica/Fluid/Examples/BranchingDynamicPipes.mo index 106aeb4690..61fb08c110 100644 --- a/Modelica/Fluid/Examples/BranchingDynamicPipes.mo +++ b/Modelica/Fluid/Examples/BranchingDynamicPipes.mo @@ -81,17 +81,16 @@ replaceable package Medium=Modelica.Media.Air.MoistAir constrainedby p=100000) annotation (Placement( transformation(extent={{10,-10},{-10,10}}, rotation=90, origin={0,60}))); - Modelica.Blocks.Sources.Ramp ramp1( + Modelica.Blocks.Sources.Step step1( offset=1e5, startTime=2, - height=1e5, - duration=0) annotation (Placement(transformation(extent={{-40,70},{-20,90}}))); + height=1e5) annotation (Placement(transformation(extent={{-40,70},{-20,90}}))); Modelica.Thermal.HeatTransfer.Sources.FixedHeatFlow[ pipe2.nNodes] heat2(Q_flow=200* pipe2.dxs, alpha=-1e-2*ones(pipe2.n)) annotation (Placement(transformation(extent={{-60,-20},{-40,0}}))); equation - connect(ramp1.y, boundary4.p_in) annotation (Line( + connect(step1.y, boundary4.p_in) annotation (Line( points={{-19,80},{-8,80},{-8,72}}, color={0,0,127}, thickness=0.5));