ExponentialsCurrent

model ExponentialsCurrent "Rising and falling exponential current source"
    parameter Real iMax(start = 1) "Upper bound for rising edge";
    parameter SI.Time riseTime(min = 0, start = 0.5) "Rise time";
    parameter SI.Time riseTimeConst(min = Modelica.Constants.small, start = 0.1) "Rise time constant";
    parameter SI.Time fallTimeConst(min = Modelica.Constants.small, start = riseTimeConst) "Fall time constant";

    extends Interfaces.CurrentSource(redeclare Modelica.Blocks.Sources.Exponentials signalSource(final outMax = iMax, final riseTime = riseTime, final riseTimeConst = riseTimeConst, final fallTimeConst = fallTimeConst));

    annotation (
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Line(
                    points = {
                        {-76, -59}, 
                        {-73.2, -44.3}, 
                        {-70.3, -31.1}, 
                        {-66.8, -16.6}, 
                        {-63.3, -4}, 
                        {-59.7, 6.92}, 
                        {-55.5, 18.18}, 
                        {-51.3, 27.7}, 
                        {-46.3, 37}, 
                        {-40.6, 45.5}, 
                        {-34.3, 53.1}, 
                        {-27.2, 59.6}, 
                        {-18.7, 65.3}, 
                        {-8.1, 70.2}, 
                        {-6, 71}, 
                        {-3.88, 58.5}, 
                        {-1.05, 43.7}, 
                        {1.78, 30.8}, 
                        {4.606, 19.45}, 
                        {8.14, 7.3}, 
                        {11.68, -3}, 
                        {15.9, -13.2}, 
                        {20.2, -21.6}, 
                        {25.1, -29.5}, 
                        {30.8, -36.4}, 
                        {37.1, -42.3}, 
                        {44.9, -47.5}, 
                        {54.8, -51.8}, 
                        {64, -54.4}},
                    color = {192, 192, 192})}),
        Diagram(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Line(
                    points = {
                        {-100, -70}, 
                        {100, -70}},
                    color = {192, 192, 192}), 
                Polygon(
                    points = {
                        {100, -70}, 
                        {84, -64}, 
                        {84, -76}, 
                        {100, -70}},
                    lineColor = {192, 192, 192},
                    fillColor = {192, 192, 192},
                    fillPattern = FillPattern.Solid), 
                Line(
                    points = {
                        {-40, -30}, 
                        {-37.2, -15.3}, 
                        {-34.3, -2.1}, 
                        {-30.8, 12.4}, 
                        {-27.3, 25}, 
                        {-23.7, 35.92}, 
                        {-19.5, 47.18}, 
                        {-15.3, 56.7}, 
                        {-10.3, 66}, 
                        {-4.6, 74.5}, 
                        {1.7, 82.1}, 
                        {8.8, 88.6}, 
                        {17.3, 94.3}, 
                        {27.9, 99.2}, 
                        {30, 100}, 
                        {32.12, 87.5}, 
                        {34.95, 72.7}, 
                        {37.78, 59.8}, 
                        {40.606, 48.45}, 
                        {44.14, 36.3}, 
                        {47.68, 26}, 
                        {51.9, 15.8}, 
                        {56.2, 7.4}, 
                        {61.1, -0.5}, 
                        {66.8, -7.4}, 
                        {73.1, -13.3}, 
                        {80.9, -18.5}, 
                        {90.8, -22.8}, 
                        {100, -25.4}},
                    thickness = 0.5), 
                Polygon(
                    points = {
                        {-80, 90}, 
                        {-88, 68}, 
                        {-72, 68}, 
                        {-80, 90}},
                    lineColor = {192, 192, 192},
                    fillColor = {192, 192, 192},
                    fillPattern = FillPattern.Solid), 
                Line(
                    points = {
                        {-80, 90}, 
                        {-80, -80}},
                    color = {192, 192, 192}), 
                Polygon(
                    points = {
                        {-40, -70}, 
                        {-42, -60}, 
                        {-38, -60}, 
                        {-40, -70}, 
                        {-40, -70}},
                    lineColor = {192, 192, 192},
                    fillColor = {192, 192, 192},
                    fillPattern = FillPattern.Solid), 
                Line(
                    points = {
                        {-40, -30}, 
                        {-40, -60}},
                    color = {192, 192, 192}), 
                Polygon(
                    points = {
                        {-40, -30}, 
                        {-42, -40}, 
                        {-38, -40}, 
                        {-40, -30}},
                    lineColor = {192, 192, 192},
                    fillColor = {192, 192, 192},
                    fillPattern = FillPattern.Solid), 
                Line(
                    points = {
                        {-39, -30}, 
                        {-80, -30}},
                    thickness = 0.5), 
                Text(
                    extent = {
                        {-59, -71}, 
                        {-13, -89}},
                    lineColor = {160, 160, 164},
                    textString = "startTime"), 
                Polygon(
                    points = {
                        {-40, -30}, 
                        {-31, -28}, 
                        {-31, -32}, 
                        {-40, -30}},
                    lineColor = {192, 192, 192},
                    fillColor = {192, 192, 192},
                    fillPattern = FillPattern.Solid), 
                Line(
                    points = {
                        {-40, -30}, 
                        {30, -30}},
                    color = {192, 192, 192}), 
                Polygon(
                    points = {
                        {30, -30}, 
                        {22, -28}, 
                        {22, -32}, 
                        {30, -30}},
                    lineColor = {192, 192, 192},
                    fillColor = {192, 192, 192},
                    fillPattern = FillPattern.Solid), 
                Text(
                    extent = {
                        {-26, -12}, 
                        {19, -28}},
                    lineColor = {160, 160, 164},
                    textString = "riseTime"), 
                Line(
                    points = {
                        {-40, -30}, 
                        {-80, -30}},
                    thickness = 0.5), 
                Line(
                    points = {
                        {30, 100}, 
                        {30, -34}},
                    color = {192, 192, 192},
                    pattern = LinePattern.Dash), 
                Text(
                    extent = {
                        {-73, 75}, 
                        {-53, 95}},
                    lineColor = {192, 192, 192},
                    textString = "i")}),
        Documentation(
            revisions = "<html>\n<ul>\n<li><em> 1998   </em>\n       by Christoph Clauss<br> initially implemented<br>\n       </li>\n</ul>\n</html>",
            info = "<html>\n<p>This current source uses the corresponding signal source of the Modelica.Blocks.Sources package. Care for the meaning of the parameters in the Blocks package. Furthermore, an offset parameter is introduced, which is added to the value calculated by the blocks source. The startTime parameter allows to shift the blocks source behavior on the time axis.</p>\n</html>"));
end ExponentialsCurrent;