Optimal Scheduling for Constant-Rate Multi-Mode Systems Rajeev Alur University of Pennsylvania, Philadelphia, USA alur@cis.upenn.edu Ashutosh Trivedi University of Pennsylvania, Philadelphia, USA ashut@cis.upenn.edu Dominik Wojtczak University of Liverpool, Liverpool, UK d.wojtczak@liv.ac.uk ABSTRACT Constant-rate multi-mode systems are hybrid systems that can switch freely among a finite set of modes, and whose dynamics is specified by a finite number of real-valued vari- ables with mode-dependent constant rates. The schedulabil- ity problem for such systems is to design a mode-switching policy that maintains the state within a specified safety set. The main result of the paper is that schedulability can be decided in polynomial time. We also generalize our result to optimal schedulability problems with average cost and reachability cost objectives. Polynomial-time scheduling al- gorithms make this class an appealing formal model for de- sign of energy-optimal policies. The key to tractability is that the only constraints on when a scheduler can switch the mode are specified by global objectives. Adding local constraints by associating either invariants with modes, or guards with mode switches, lead to undecidability, and re- quiring the scheduler to make decisions only at multiples of a given sampling rate, leads to a PSPACE-complete schedu- lability problem. Categories and Subject Descriptors D.4.7 [Organization and Design]: Real-time systems and embedded systems; B.5.2 [Design Aids]: Optimization, Verification; I.2.8 [Problem Solving, Control Methods, and Search]: Scheduling General Terms Theory, Verification Keywords Switched Systems, Cyber-Physical Systems, Peak Minimiza- tion, Green Scheduling, Hybrid Automata 1. INTRODUCTION Our study of optimal scheduling on constant-rate multi- mode systems is motivated largely by a series of work by Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. HSCC’12, April 17–19, 2012, Beijing, China. Copyright 2012 ACM 978-1-4503-1220-2/12/04 ...$10.00. Nghiem et al. [18, 19] on energy peak demand reduction within a large organization by synchronizing switching deci- sions of various “heating, ventilation, and air conditioning” (HVAC) systems. The correlation between extreme weather and energy demand peaks is well documented [6, 21], and hence reducing the energy peak demand due to HVAC sys- tems can potentially significantly reduce the total energy peak demand. In [18] Nghiem et al. considered a model of an organization where at any given time the HVAC system of a zone can be in either ON or OFF mode, and in each mode the temperature of the corresponding zone changes with a mode-dependent constant rate. In order to minimize peak energy-usage they studied the following schedulability problem: find a switching schedule of HVAC systems across different zones so as to maintain the temperature in each zone within a given interval, with the restriction that si- multaneously at most a fix number of HVAC systems are switched ON. They showed that the schedulability problem can be reduced to testing an inequality involving the rates of temperature change. Our motivation is to explore that to what extent this result can be generalized, and to identify where this result fits into the existing literature on schedu- lability such as real-time scheduling theory [9] and hybrid automata based schedulability analysis [1, 2]. Real-time scheduling is a mature research area [9] with an excellent collection of well-studied algorithms for periodic scheduling, for instance the rate monotonic and the earliest deadline first algorithms. However, as noted by Nghiem et al. [19], generally these algorithms are restricted to tasks whose worst case execution times are fixed and known in advance, and hence they are not directly applicable to energy peak reduction problem as posed in [19, 18]. Another prominent approach [1, 2] to real-time schedu- lability analysis is via reduction to optimization problems on timed and hybrid automata. Timed automata [3] can model multi-mode systems with a finite set of continuous variables, called clocks, that grow with uniform rate. Clocks can be used to constrain mode-switches and to specify mode- dependent invariants. The decidability of a number of opti- mization problems [4, 7] on timed automata, and availabil- ity of efficient tool support, e.g. Kronos and UPPAAL [16, 20], make them an attractive choice for real-time scheduling. They are, however, not applicable in energy peak reduction problem as the temperature variables in our system grow with non-uniform rates. Hybrid automata generalize timed automata by allowing mode-dependent variable rates, how- ever having two variables with different rates leads to unde- cidability [12] even for reachability problems. As we see later