Skip to content

benchmarks

Hybrid system benchmark suite.

BenchmarkSpec(name, factory, tags, description, t_span, input_stream=None) dataclass

Metadata and factory for a benchmark system.

registry()

Return the benchmark registry keyed by name.

Source code in src/flowcean/hybrid/benchmarks/__init__.py
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
def registry() -> dict[str, BenchmarkSpec]:
    """Return the benchmark registry keyed by name."""
    specs = [
        BenchmarkSpec(
            name="Bouncing Ball",
            factory=bouncing_ball,
            tags=("reset", "impact", "nonlinear"),
            description="Ballistic motion with velocity reset on impact.",
            t_span=(0.0, 3.0),
        ),
        BenchmarkSpec(
            name="Thermostat",
            factory=thermostat,
            tags=("hysteresis", "threshold", "switching"),
            description="Two-location thermostat with temperature thresholds.",
            t_span=(0.0, 10.0),
            input_stream=thermostat_target_stream,
        ),
        BenchmarkSpec(
            name="Hybrid Oscillator",
            factory=hybrid_oscillator,
            tags=("oscillator", "piecewise", "damping"),
            description="Oscillator with side-dependent damping.",
            t_span=(0.0, 15.0),
        ),
        BenchmarkSpec(
            name="Switched Linear",
            factory=switched_linear,
            tags=("linear", "threshold", "switching"),
            description="Switching linear dynamics by state threshold.",
            t_span=(0.0, 10.0),
        ),
        BenchmarkSpec(
            name="Relay Integrator",
            factory=relay_integrator,
            tags=("relay", "hysteresis", "control"),
            description="Relay-controlled integrator with hysteresis.",
            t_span=(0.0, 20.0),
        ),
        BenchmarkSpec(
            name="Time-Varying Event Surface",
            factory=time_varying_event_surface,
            tags=("time", "event-surface", "switching"),
            description="Time-varying event surface induces switching.",
            t_span=(0.0, 20.0),
            input_stream=time_varying_input_stream,
        ),
        BenchmarkSpec(
            name="Time-Forced Switch",
            factory=time_forced_switch,
            tags=("time", "periodic", "switching"),
            description="Periodic time-driven location switching.",
            t_span=(0.0, 5.0),
        ),
        BenchmarkSpec(
            name="Piecewise Affine",
            factory=piecewise_affine,
            tags=("affine", "multidim", "threshold"),
            description=(
                "Piecewise affine dynamics with a linear event surface."
            ),
            t_span=(0.0, 20.0),
        ),
        BenchmarkSpec(
            name="Impact Oscillator",
            factory=impact_oscillator,
            tags=("impact", "time", "reset"),
            description="Oscillator with periodic forcing and impacts.",
            t_span=(0.0, 20.0),
            input_stream=impact_input_stream,
        ),
        BenchmarkSpec(
            name="PID-Controlled Plant",
            factory=pid_controlled_plant,
            tags=("control", "pid", "saturation"),
            description="PID-controlled plant with actuator saturation.",
            t_span=(0.0, 20.0),
        ),
        BenchmarkSpec(
            name="Tank Valves",
            factory=tank_valves,
            tags=("flow", "valves", "nonlinear"),
            description="Two-tank system with valve-controlled flow.",
            t_span=(0.0, 5.0),
        ),
        BenchmarkSpec(
            name="Location Cycle",
            factory=lambda: mode_cycle(modes=6, dimension=3, dwell_time=0.4),
            tags=("scalable", "time", "multimode"),
            description=(
                "Scalable cycle of linear locations with clock resets."
            ),
            t_span=(0.0, 10.0),
        ),
    ]

    return {spec.name: spec for spec in specs}

all_specs()

Return all benchmarks in deterministic order.

Source code in src/flowcean/hybrid/benchmarks/__init__.py
135
136
137
def all_specs() -> Sequence[BenchmarkSpec]:
    """Return all benchmarks in deterministic order."""
    return list(registry().values())