Foundations of Analog Algorithms