11within OpenIPSL.NonElectrical.Nonlinear;
22block Div0block "Block that implements division by zero protection"
3- Modelica.Blocks.Interfaces.RealInput u1
4- annotation (Placement(transformation(extent={{-140,40},{-100,80}})));
5- Modelica.Blocks.Interfaces.RealInput u2
6- annotation (Placement(transformation(extent={{-140,-80},{-100,-40}})));
7- Modelica.Blocks.Interfaces.RealOutput y
8- annotation (Placement(transformation(extent={{100,-10},{120,10}})));
3+ extends Modelica.Blocks.Interfaces.SI2SO;
94equation
105 y = OpenIPSL.NonElectrical.Functions.div0protect(u1, u2)
11- annotation (Icon(coordinateSystem(preserveAspectRatio=false)), Diagram(
12- coordinateSystem(preserveAspectRatio=false)));
13- annotation (Icon(graphics={ Rectangle(
14- extent={{-100,-100},{100,100}},
15- lineColor={0,0,127},
16- fillColor={255,255,255},
17- fillPattern=FillPattern.Solid), Text(
18- extent={{-150,150},{150,110}},
19- textString="%name" ,
20- textColor={0,0,255}),
6+ annotation (Icon(graphics={
7+ Text(
8+ extent={{-150,150},{150,110}},
9+ textString="%name" ,
10+ textColor={0,0,255}),
2111 Line(points={{-100,60},{-60,60},{0,0}}, color={0,0,127}),
2212 Line(points={{-100,-60},{-60,-60},{0,0}}, color={0,0,127}),
2313 Ellipse(lineColor={0,0,127}, extent={{-50,-50},{50,50}},
@@ -28,11 +18,11 @@ equation
2818 Ellipse(fillPattern=FillPattern.Solid, extent={{-5,20},{5,30}}),
2919 Ellipse(fillPattern=FillPattern.Solid, extent={{-5,-30},{5,-20}}),
3020 Text(
31- extent={{-70,94 },{80,54 }},
21+ extent={{-80,90 },{82,60 }},
3222 textColor={128,128,128},
3323 textString="u1 / u2" ),
3424 Text(
35- extent={{-102 ,-60},{100,-100}},
25+ extent={{-100 ,-60},{100,-100}},
3626 textColor={238,46,47},
3727 textString="div0protect" )}));
3828end Div0block;
0 commit comments