6 ms·
One of my coworkers (colmmacc@ on twitter) has been giving talks [1][2] for years on how PID loops and control systems theory apply to software, and that I’m to
by ragona 7y ago
One of my coworkers (colmmacc@ on twitter) has been giving talks [1][2] for years on how PID loops and control systems theory apply to software, and that I’m totally convinced that it’s an undermined vein of excellent thought. I’m working on applying this to a piece of software I’m building and I’m very excited.
1: https://www.infoq.com/presentations/pid-loops/ https://www.infoq.com/presentations/pid-loops/
2: https://m.youtube.com/watch?v=O8xLxNje30M https://m.youtube.com/watch?v=O8xLxNje30M
- ssivark 7y agoI know little about web services orchestration, but I feel that a lot of algorithms from control theory / signal processing / optimization / continuous math / etc will apply to software contexts if one “squints right”. And such solutions will often end up being more robust and better behaved (and arguably more intuitive) — an ounce of math often saves a thousand lines of clumsy code. As Peter Naur argued, writing software is primarily about building a functional theory of the domain.
- bloaf 7y agoI personally feel process control is a significantly under-appreciated discipline. I've been at an academic lecture where a process control engineer used the example of air conditioning to explain that when your system is controlled, you have to be extremely careful about correlation and causation. If you're not, you can very easily conclude that because the room is hot whenever the AC is running hard, that the AC running hard makes the room hot. He then showed that biologists were making this mistake with respect to certain biomarkers and cancer. Process control is interesting even in philosophy. For example, there is a process control theorem which proves that the maximally efficient regulator must have an accurate model of the process being regulated. Therefore, anyone who argues that evolution gives us no reason to expect our brains give us an accurate picture of the world must be ignorant of process control. After all, our brains are regulators of our environment for our survival; therefore the maximally efficient way for our brain to regulate our environment is for our brain to have an accurate model of our environment.
- yters 7y agoor apply both insights and modus tollens, and conclude our brains were not produced by evolution
- bch 7y ago> I've been at an academic lecture where a process control engineer used the example of air conditioning to explain that when your system is controlled, you have to be extremely careful about correlation and causation. If you're not, you can very easily conclude that because the room is hot whenever the AC is running hard, that the AC running hard makes the room hot. He then showed that biologists were making this mistake with respect to certain biomarkers and cancer. I’d enjoy hearing more about this. Go on, or point to more info?
- TeMPOraL 7y agoNot a process engineer, but I'm guessing that if you're looking at correlation between temperature data vs. AC power, and AC is reacting to changes in temperature (i.e. derivative, D in PID), you'll see AC ramping up power before the temperature meaningfully increases. A naive analysis could then conclude that it's AC that causes high temperature.
- bloaf 7y agoOr more simply than that, if you only ever look at "cold" and "hot" rooms (e.g. analysis of cancerous and non-cancerous patients) you're never going to see the dynamics at all. But more fundamentally, I believe there is a theorem which asserts that it is in general impossible to extract the open loop behavior of a system (i.e. a model of how the system would respond without a controller) solely from closed loop data (i.e. data collected from the system when the controller is on.)
- bloaf 7y agoIt was several years ago, so I don't remember the details, but I have heard echos of the sentiment in the recent criticism of alzheimers research. I.e. that amyloid plaques may actually be the equivalent of a cellular AC that's been misidentified as the reason the room is hot. https://www.nature.com/articles/d41586-018-05719-4 https://www.nature.com/articles/d41586-018-05719-4 >“The current approach is based on the idea that amyloid-β is bad,” says Perry. “My idea is the opposite.” He suggests that amyloid-β and tau accumulation is actually a protective response to age-related metabolic pressures in the cell.
- m-hilgendorf 7y ago> will apply to software contexts if one “squints right" Not just "squint right." All systems can be represented as a pair of functions that map current state to next state and the observation of current state, in response to some perturbation. Aka state evolution/observation. F: s_n, x_n -> s_n+1 G: s_n, x_n -> y_n Everything from Markov Chains, stochastic processes, ANNs, controls, signal processes, electrical systems, finite automata, Turing machines, etc can all be formulated in those terms. The cool part is when you break apart those specific formulations into the abstract notion of a signal flow graph (a directed graph that represents the operations of F and G) you start thinking a lot about homological algebra, category theory, and the general nature of things. Abstractions in programming that express this nature cleanly are often the ones that we find the most beautiful, at least for me. For example, an iterator has a void perturbation, F is the next() function, and G is just the observation of the current element (the actual state may be hidden behind a getter of some kind). The abstractions that we build on top of iterators through combinators like map/flatten/fold, etc are then homomorphisms between various iterators by chaining the state evolution/observation functions with other operations. So if you go one degree higher than an iterator you get a generator, where your perturbation might be non-void. In controls then, you can express your plant and controller (even the "hardware" stages) as one generator composed of smaller ones and combinators across them. A lot of the math behind this in the general case is kind of heady, at least for me (just an undergrad experience here). There's a lot of ground to be covered in particular understanding for machine learning and other nonlinear dynamical systems where analysis/synthesis of a state-space formulation is currently lacking in formal methods.
- AgentMatt 7y ago> Everything from Markov Chains, stochastic processes, ANNs, controls, signal processes, electrical systems, finite automata, Turing machines, etc can all be formulated in those terms. The cool part is when you break apart those specific formulations into the abstract notion of a signal flow graph (a directed graph that represents the operations of F and G) you start thinking a lot about homological algebra, category theory, and the general nature of things. Very interesting! Do you have any references where such reformulations are done? Or where control problems are formulated in terms of algebra or category theory?
- GlenTheMachine 7y agoControls PhD here... He’s not wrong, but the fundamental problem is that control theory has a very limited view of “correct behavior”: stability around a desired point or trajectory. If you can define your desired system state as a fixed or time varying value that can be determined ahead of time, and you would like to prove that your system stays close to that point for some definition of “close”, then this tool may be for you. But if you can’t, it’s much harder to see how to apply it. And a lot of software problems can’t be defined in such strictly mathematical terms. Also, if your system is linear or approximately linear then we have good tools. If your system is really honestly nonlinear it gets more dicey. You have to either hope that somebody has already derived a controller for systems of the class you are using, or you have to do novel numerical analysis in order to derive a controller that will stabilize it.
- bloaf 7y agoProcess control definitely seems like one of those disciplines where the old adage There are two kinds of problems in the world, problems that are linear, and problems I can't solve. holds true.
- patrick5415 7y agoI did my PhD in controls too, and I’d pretty much agree with all of that. There is a ton of really heavy math flying around with little to show for it. If your system is anything beyond weakly nonlinear, you are basically screwd. The best and effectively only tool we have otherwise was invented over a 100 years ago by lyapunov. And using it requires, I’m not joking, nearly divine inspiration.
- miketery 7y agoCan you expand on what this tool is?
- dreamcompiler 7y agohttps://en.m.wikipedia.org/wiki/Lyapunov_function https://en.m.wikipedia.org/wiki/Lyapunov_function
- signa11 7y agooh most definitely yes. there is an introductory o'reilly book as well "feedback control for computer systems" which is pretty good.
- mdn0420 7y agoGame developer here - I used a PID controller to implement some vehicle controls/animations in our game recently and it works quite lovely.