blockArithmeticMean

(Weighted) arithmetic 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 a convex combination of the components of the input vector u:

y = sum_i u[i] w[i]

Notes

  • If useWeights = false then all weights are assumed to be one.

  • Weights will be normalized to add up to one; negative weights will be set to zero.

See also

arithmeticMean, GeometricMean

Parameters

TypeNameDefaultDescription
Realweightsones(nin)Weights to be used for inputs
Structural Parameters
Integernin (from MISO)2Number of input signals
BooleanuseWeightsfalse= true, if the output is to be a weighted arithmetic mean
BooleanhasConstantWeightstrue= true, if the weights are constant

Connectors

TypeNameDefaultDescription
Connectors.RealMultiInput[nin]u (from MISO)Input
Interfaces.Connectors.RealMultiInput[nin]u_weightsInput of weights

Components

TypeNameDefaultDescription
RealOutputy (from SO)