What is the "gain" of the bi-metallic switching element in a thermostat used in a bang-bang temperature-control control system? Whatever it is, it is irrelevant provided it is high enough.
To my knowledge the term "gain" involves an output-to-input ratio which is defined for equal signal forms at the output and the input.
Well, it is peripheral to the main point I've been making, but: no, not at all.
Easy example: a transconductance amplifier has an input voltage and an output current. Imagine a pressure control system: the input would be pressure and the output (say) voltage, so the gain would be measured in V/Pa.
I put the word "gain" in quotes to indicate that it is not a simple definition. But then it doesn't need to be.
With other words: The term "gain" applies to a linear system only - and, hence, not to a bang-bang controller.
No. In practice the gain (and hence the stability analysis) would be based on the mean output, even though the output is never at the mean.
Think about how you would measure and/or analyse, for example, a class-D amplifier.