TL;DR
This paper introduces PC-Gym, a new open-source toolkit designed to standardize and accelerate the development and evaluation of reinforcement learning (RL) algorithms for chemical process control. It provides a suite of realistic, customizable environments that allow researchers to benchmark RL agents against established methods like NMPC, highlighting performance gaps and guiding future research.
What Problem Does This Paper Address?
Controlling complex chemical processes presents unique challenges due to their nonlinear dynamics, disturbances, and strict safety and economic constraints. While reinforcement learning (RL) offers a powerful data-driven approach, applying it to these systems requires specialized environments that can accurately simulate these complexities. Existing RL benchmark environments often lack the domain-specific features needed for chemical process control, hindering the development and comparison of RL algorithms in this critical field. PC-Gym aims to bridge this gap by providing a standardized, flexible, and realistic platform for this purpose.
Methods
PC-Gym is built upon the Gymnasium (formerly OpenAI Gym) interface, ensuring compatibility with existing RL tools. Its core innovation lies in providing a suite of chemical process environments that incorporate:
- Realistic Dynamics: Simulating complex, nonlinear chemical processes.
- Disturbance Generation: Allowing users to define and inject various types of disturbances (e.g., step changes in temperature) to test algorithm robustness.
- Constraint Handling: Mechanisms to incorporate operational constraints (e.g., temperature limits) into the learning process, either through reward shaping or by directly penalizing violations.
- Customizable Reward Functions: Enabling users to define reward functions tailored to specific control objectives (e.g., setpoint tracking, minimizing error).
- NMPC Oracle: A Nonlinear Model Predictive Controller that acts as a near-optimal benchmark, providing a performance ceiling for RL agents.
The framework supports popular RL algorithms like PPO, SAC, and DDPG, allowing for direct comparison of their performance.
Datasets
PC-Gym introduces four benchmark environments for process control:
- Continuously Stirred Tank Reactor (CSTR)
- Multistage Extraction Column
- Crystallization Reactor
- Four-Tank System
These environments are used for training and evaluating RL algorithms and are compared against the NMPC oracle.
Key Insights and Ideas
- Standardization is Key: PC-Gym's adherence to the Gymnasium interface and its comprehensive feature set (disturbances, constraints, rewards) are crucial for enabling reproducible research and direct comparison of RL algorithms in process control.
- Performance Gaps Exist: The benchmarking results consistently show that while RL algorithms can track setpoints, they often exhibit performance gaps compared to the NMPC oracle, especially in terms of consistency and optimality. This highlights areas where RL algorithms need further development for real-world process control.
- Algorithm Choice Matters: The "best" RL algorithm is highly dependent on the specific process and control objective. For instance, SAC often shows consistent performance, while DDPG or PPO might excel in specific scenarios.
- Disturbances and Constraints are Critical: The ability to simulate realistic disturbances and incorporate operational constraints is vital for developing robust and safe RL controllers for chemical processes. PC-Gym's features in these areas are essential for bridging the gap to industrial application.
Key Results
- CSTR: SAC and DDPG showed close performance to the NMPC oracle, with DDPG achieving a higher reward despite a wider distribution.
- Multistage Extraction: SAC demonstrated the best performance, closely matching the oracle and achieving the highest median reward. DDPG also performed well but with a wider reward distribution. PPO struggled with setpoint tracking.
- Crystallization Reactor: All RL algorithms performed poorly compared to the oracle, with PPO showing the best performance among the RL agents.
- Four-Tank System: SAC achieved the highest median reward with a narrow distribution, while PPO and DDPG showed lower median rewards and wider distributions.
- Optimality Gap & MAD: Tables 4 and 5 quantify the optimality gap and median absolute deviation for different algorithms across environments, showing varying performance and consistency. For example, SAC achieved the lowest optimality gap in the Multistage Extraction (0.002) and Four Tank (0.579) systems.
- Constraint Handling: In the CSTR example, a reward-shaped agent significantly reduced constraint violation probability (0.0003) compared to a base reward agent (0.0727), demonstrating the effectiveness of PC-Gym's constraint mechanisms.
Limitations and Future Work
- Limitations:
- The current evaluation focuses on fixed policies trained with large budgets, not on online learning or sample-constrained scenarios.
- The NMPC oracle assumes perfect state estimation and perfect knowledge of the system model within its prediction horizon.
- Future Work:
- Expand the library with more diverse and complex chemical process models, encouraging community contributions.
- Implement an online learning feature to test algorithms in sample-efficient settings.
- Develop interfaces for real-time data streaming and hardware-in-the-loop testing to facilitate the transition to real-world implementation.
Summary updated