---
library: "bootstrap"
slug: "Hysteresis"
name: "Hysteresis"
ref: "Hysteresis#c2d1"
hash: "sema:Hysteresis#mh:SHA-256:c2d174f3fa513ed81bcd5b731aa651a3e4662a671748e514d758582657a5bf9a"
type: "Primitives"
layer: "Infrastructure"
version: "0.11.0"
root: "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5"
license: null
url: "https://semahash.org/vocabularies/bootstrap/patterns/Hysteresis"
---

# Hysteresis

Preventing oscillation via asymmetric thresholds

Infrastructure · Primitives

## Mechanism

Asymmetric Thresholds: [State](https://semahash.org/vocabularies/bootstrap/patterns/State.md) change from A→B requires crossing threshold T_up. [State](https://semahash.org/vocabularies/bootstrap/patterns/State.md) change from B→A requires crossing lower threshold T_down. Gap between thresholds prevents oscillation near boundary. Thresholds fixed or adaptive. It uses a [Dampen](https://semahash.org/vocabularies/bootstrap/patterns/Dampen.md) effect on state transitions, requiring the signal to cross distinct upper and lower thresholds to switch modes.

## Invariants

- `upper_threshold` is strictly greater than `lower_threshold`.
- The gap between them is at most `max_gap`.
- A→B needs `upper_threshold` crossed; B→A needs `lower_threshold` crossed.

## Parameters

- upper_threshold: type=Float, range=[0.0, 1.0], description=Level the signal must exceed to switch from A to B.
- lower_threshold: type=Float, range=[0.0, 1.0], description=Level the signal must fall below to switch back from B to A.
- max_gap: type=Float, range=(0.0, 1.0), description=Widest permitted band between the thresholds, so the system can still return.

## Failure modes

- Stuck [State](https://semahash.org/vocabularies/bootstrap/patterns/State.md): the band is wide enough that the signal never reaches `lower_threshold` again.
- Chatter: the band is narrow enough that noise alone crosses both thresholds.

## Where this came from

—

## Builds on

- [Dampen](https://semahash.org/vocabularies/bootstrap/patterns/Dampen.md) (references)
- [State](https://semahash.org/vocabularies/bootstrap/patterns/State.md) (references)

## Used by

- [EbbFlowSync](https://semahash.org/vocabularies/bootstrap/patterns/EbbFlowSync.md) (references)
- [OsmoticFilter](https://semahash.org/vocabularies/bootstrap/patterns/OsmoticFilter.md) (references)

## Identity

- Library: bootstrap 0.11.0 (root a6a3d1ff0f98)
- Ref: Hysteresis#c2d1
- Hash: sema:Hysteresis#mh:SHA-256:c2d174f3fa513ed81bcd5b731aa651a3e4662a671748e514d758582657a5bf9a

## Links

- Page: https://semahash.org/vocabularies/bootstrap/patterns/Hysteresis
- JSON: https://semahash.org/vocabularies/bootstrap/patterns/Hysteresis.json
- Library: https://semahash.org/vocabularies/bootstrap
- Library index: https://semahash.org/vocabularies/bootstrap/index.json
