blockDivision_Guarded
Division guarded for division by zero
Extends from Interfaces.PartialConverters.SO (Generic converter for signals).
Information
This information is part of the Business Simulation Library (BSL). Please support this work and ► donate.
The output y is obtained by guarded division of the nominator input u1 and the denominator input u2:
y = u1/u2If u2 is equal to zero, then outputIfZero is returned.
Implementation
y = if noEvent(u2 < 0 or u2 > 0) then u1 / u2 else outputIfZero;
See also
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| OutputType | outputIfZero | 0 | Output, if denominator (u2) is zero (default = 0) |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Interfaces.Connectors.RealInput | u1 | Nominator input | |
| Interfaces.Connectors.RealInput | u2 | Denominator input |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| RealOutput | y (from SO) |