SampleIfTrue

Samples input, if Boolean trigger is true

Information

This information is part of the Business Simulation Library (BSL). Please support this work and ► donate.

The (discrete) output y is sampled from the input u whenever the Boolean input trigger becomes true.

Notes

  • The parameter init in the Advanced tab allows to select →InitializationOptions:
    • FixedValue (default) will use the parameter initialValue to determine the initial output y to be given before the sampling starts.

    • SteadyState will set the initial output y equal to the initial input u.

    • Free there will be no initial equation and thus the solver is free to find an initial output using initialValue as an initial guess.

See also

Sampler

Parameters (2)

initialValue

Value: 0

Type: OutputType

Description: Initial Value to be reported before sampling starts

init

Value: modelSettings.init

Type: InitializationOptions

Description: Provide InitializationOptions (Free, FixedValue, SteadyState)

Connectors (3)

u

Type: RealInput

Description: Input

y

Type: RealOutput

Description: Output signal

trigger

Type: BooleanInput

Description: Triggers sampling upon `true`

Components (1)

modelSettings

Type: ModelSettings

Description: Setting important global variables within a model