*2.1. Overview*

The real-time optimal control mainly consists of two steps (see Figure 1): (1) Triggering optimal control; (2) solving the optimal control problem using a certain search algorithm subject to operation constraints. Finally, optimal control settings will be sent to the AC system to supervise the operation. In this study, the triggering of optimal control will be studied, and three triggering approaches will be discussed, i.e., The time-driven approach, part-load ratio (PLR)-based event-driven, optimal control (EDOC) approach and the system coe fficient of performance (SCOP)-based EDOC approach.

A case commercial AC system is simulated in the Transient System Simulation Tool (TRNSYS) with validated component models. The optimal control codes and basic local control codes are programmed in MATLAB. Actual weather and cooling load data are used as the simulation inputs. The actual system operation is simulated through co-simulation between TRNSYS and MATLAB (Figure 2). Typical weather and load profiles are tested with each case in 24 h. The typical load profiles are identified using a PPA-based K-means clustering approach (see Appendix D). At last, the simulation results are compared to evaluate the performance.

**Figure 1.** Overview of the research.

**Figure 2.** Simulation diagram and software.

## *2.2. Optimal Control Triggering Approaches*
