The IoT and its related applications will require engineering of edge devices that can autonomously optimize their non-functional performance. We present a hierarchical model of small-footprint embedded systems that (1) cleanly separates and shows the interactions between their physical and computational aspects and (2) enables their control and optimization. This model exposes power use, energy use, and temporal responsiveness as functions of the hardware configuration of the processor and surrounding peripherals, including sleep mode, voltage/frequency scaling, and clock/power gating. The foundation layer consists of a coupled hybrid systems model for energy measurement and system control; this layer underpins a multi-stage graph model of execution that admits optimization using dynamic programming. In this paper, we demonstrate on-line achievement of energy subsistence, wherein the system uses the minimum energy possible given all controllable hardware resources. We describe a software/hardware implementation architecture, and illustrate the approach using an experimental networked embedded system platform.