blockGeometricMean
(Weighted) geometric mean
Extends from Interfaces.PartialConverters.MISO (Converter with multiple inputs and a single output).
Information
This information is part of the Business Simulation Library (BSL). Please support this work and ► donate.
The scalar output y is obtained as the geometric mean of the components of the input vector u. Optionally weights can be given, either as constants (weights) or as variable inputs (u_weights).
Notes
- If
useWeights = falsethen all weights are assumed to be one. - If any of the components of u is less than or equal to zero, the output y will be zero.
- Negative weights will be set to zero.
See also
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Real | weights | ones(nin) | Weights to be used for inputs |
| Structural Parameters | |||
| Integer | nin (from MISO) | 2 | Number of input signals |
| Boolean | useWeights | false | = true, if the output is to be a weighted geometric mean |
| Boolean | hasConstantWeights | true | = true, if the weights are constant |
Connectors
| Type | Name | Default | Description |
|---|---|---|---|
| Connectors.RealMultiInput[nin] | u (from MISO) | Input | |
| Interfaces.Connectors.RealMultiInput[nin] | u_weights | Input of weights |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| RealOutput | y (from SO) |