Reinforcement learning suite of process control problems.
Project description
Reinforcement learning environments for process control
Quick start ⚡
Setup a CSTR environment with a setpoint change
import pcgym
# Simulation variables
nsteps = 100
T = 25
# Setpoint
SP = {'Ca': [0.85 for i in range(int(nsteps/2))] + [0.9 for i in range(int(nsteps/2))]}
# Action and observation Space
action_space = {'low': np.array([295]), 'high': np.array([302])}
observation_space = {'low': np.array([0.7,300,0.8]),'high': np.array([1,350,0.9])}
# Construct the environment parameter dictionary
env_params = {
'N': nsteps, # Number of time steps
'tsim':T, # Simulation Time
'SP' :SP,
'o_space' : observation_space,
'a_space' : action_space,
'x0': np.array([0.8, 330, 0.8]), # Initial conditions [Ca, T, Ca_SP]
'model': 'cstr_ode', # Select the model
}
# Create environment
env = pcgym.make_env(env_params)
# Reset the environment
obs, state = env.reset()
# Sample a random action
action = env.action_space.sample()
# Perform a step in the environment
obs, rew, done, term, info = env.step(action)
Documentation
You can read the full documentation here!
Installation ⏳
The latest pc-gym version can be installed from PyPI:
pip install pcgym
Examples
TODO: Link example notebooks here
Implemented Process Control Environments 🎛️
Environment | Reference | Source | Documentation |
---|---|---|---|
CSTR | Hedengren, 2022 | Source | |
First Order Sytem | N/A | Source | |
Multistage Extraction Column | Ingham et al, 2007 (pg 471) | Source |
Citing pc-gym
If you use pc-gym
in your research, please cite using the following
@software{pcgym2024,
author = {Max Bloor and ...},
title = {{pc-gym}: Reinforcement Learning Envionments for Process Control},
url = {https://github.com/MaximilianB2/pc-gym},
version = {0.0.4},
year = {2024},
}
Other Great Gyms 🔍
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pcgym-0.0.9.tar.gz
(19.3 kB
view details)
Built Distribution
pcgym-0.0.9-py3-none-any.whl
(19.3 kB
view details)
File details
Details for the file pcgym-0.0.9.tar.gz
.
File metadata
- Download URL: pcgym-0.0.9.tar.gz
- Upload date:
- Size: 19.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0caf4e8c09e893d33ce57a43dd509b89357c9c332b5aa47a562c1ef0fd8b2bf |
|
MD5 | f8e3e47864b1f4fbaf48e677775d076e |
|
BLAKE2b-256 | eccf6402b4eb16800b4ffedcd14c437906495088ac85fee675ba6d0261625291 |
File details
Details for the file pcgym-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: pcgym-0.0.9-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | eb792b5cf37c6ce153f6f554571cd6eb5feab6a7ef1ca7f26c81306e842fc027 |
|
MD5 | c827ccecf8f458f85cee14f77f778361 |
|
BLAKE2b-256 | 77d865899930d8e0c29089fc4045db960d7f610bb69f0406da348539aaa70dc8 |