Gym Interface for LQR-Family Problems
Gym-LQR is a one-stop shop for data-driven LQR research.
Gym-LQR creates a discrete-time LQR environment from a subset of COMPleib problems. Currently supported systems:
- HEx - Helicopter models
- REAx - Reactor models
- DISx - Decentralized interconnected systems
- TG1 - 1072 MVA nuclear-powered turbo-generator
- AGS - Automobile gas turbine
- BDT1 - Realistic model of binary distillation tower
- MFP - Moored floating platform
- UWV - Control surface servo for underwater vehicle
- EBx - Euler-Bernoulli beam
- PAS - Piezoelectric bimorph actuator system design
- TF - Terrain following model
- PSM - Two-area interconnected power system
- NNx - Academic test problems
- DLRx - Models of space structure
- ROCx - Reduced order control problems
Installation
pip install gym-lqr
Requires Python 3.10+.
Basic Usage
Single-agent (Centralized LQR)
Single-agent interface follows a familiar Gymnasium (ex- OpenAI Gym) gymnasium>=0.26 API.
import gymnasium as gym
# Register the LQR environment
import gym_lqr
# Create a Linear HE1 helicopter model from the COMPleib example set
# Discretize at a sampling rate of dt=0.1
env = gym.make('LQR-v0', env_id='HE1', dt=0.1)
# Fix the random seed for reproducibility
env.action_space.seed(1337)
# Reset the environment to generate the first observation
observation, info = env.reset(seed=1337)
for _ in range(100):
# this is where you would insert your policy
action = env.action_space.sample()
# step (transition) through the environment with the action
# receiving the next observation, reward and if the episode has terminated or truncated
observation, reward, terminated, truncated, info = env.step(action)
# If the episode has ended then we can reset to start a new episode
if terminated or truncated:
observation, info = env.reset()
env.close()
Multi-agent (Distributed LQR)
In development.
Future Releases
- Support for more COMPleib problems.
- Multi-agent (Distributed LQR) interface based on the PettingZoo API.
References
- Gymnasium - an API standard for reinforcement learning with a diverse collection of reference environments. Web: https://gymnasium.farama.org/index.html
- COMPleib: COnstraint Matrix-optimization Problem library. Web: http://www.complib.de/
- "Predictive Control for Linear and Hybrid Systems" by Francesco Borrelli, Alberto Bemporad, Manfred Morari (2017). Web: http://cse.lab.imtlucca.it/~bemporad/publications/papers/BBMbook.pdf
Metadata
Release files for gym-lqr 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| gym_lqr-0.0.2.tar.gz | 30.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| gym_lqr-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 58.8 kB
Release files / gym_lqr-0.0.2.tar.gz
| Download URL | gym_lqr-0.0.2.tar.gz |
|---|---|
| Size | 30.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
75c61032fdce9dadecdd81f822809b26b5d8c6a48a8024ecb3fb65eb5bf6509e
|
|
BLAKE2b-256 checksum How to use checksums |
3ecc01930d69227bc486112000d6b13fa91927ea7df1de67a39098a802669fb7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|
Release files / gym_lqr-0.0.2-py3-none-any.whl
| Download URL | gym_lqr-0.0.2-py3-none-any.whl |
|---|---|
| Size | 27.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
57cb92590b0ce95c1f74f324a2d2023da0bdcc7869abe3ac290c2fa68ee47939
|
|
BLAKE2b-256 checksum How to use checksums |
c2f05319007387bf9467abe179271e895cb0a6ee869c15652724af62f141efac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.11.11
|