|
| 1 | +within OpenIPSL.NonElectrical.Nonlinear; |
| 2 | +block 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}}))); |
| 9 | +equation |
| 10 | + 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}), |
| 21 | + Line(points={{-100,60},{-60,60},{0,0}}, color={0,0,127}), |
| 22 | + Line(points={{-100,-60},{-60,-60},{0,0}}, color={0,0,127}), |
| 23 | + Ellipse(lineColor={0,0,127}, extent={{-50,-50},{50,50}}, |
| 24 | + fillColor={255,255,255}, |
| 25 | + fillPattern=FillPattern.Solid), |
| 26 | + Line(points={{50,0},{100,0}}, color={0,0,127}), |
| 27 | + Line(points={{-30,0},{30,0}}), |
| 28 | + Ellipse(fillPattern=FillPattern.Solid, extent={{-5,20},{5,30}}), |
| 29 | + Ellipse(fillPattern=FillPattern.Solid, extent={{-5,-30},{5,-20}}), |
| 30 | + Text( |
| 31 | + extent={{-70,94},{80,54}}, |
| 32 | + textColor={128,128,128}, |
| 33 | + textString="u1 / u2"), |
| 34 | + Text( |
| 35 | + extent={{-102,-60},{100,-100}}, |
| 36 | + textColor={238,46,47}, |
| 37 | + textString="div0protect")})); |
| 38 | +end Div0block; |
0 commit comments