Skip to main content

Process Dynamics Engine

Project description

PDEngine - Process Dynamics Engine

Process Dynamics Engine (PDEngine) is an online, iterative simulator for process control models described by transfer functions or state space representations. PDE is implemented in Python and uses the Python Control Systems Library. Users can interact with the simulation by using an API to send control actions (e.g. increasing a reflux rate or shutting off a valve) and query process variables like temperature and pressure. PDE is intended to be an educational tool in chemical engineering process control courses.

Usage

Models are defined by inheriting from the Model parent class. An example using the Wood-Berry distillation model (3 inputs - 2 MVs, 1 FF & 2 outputs) is provided in /src/WoodBerryModel.py.

A PDEngine Model must include:

  • Name (e.g. Wood-Berry Distillation)
  • Input names (e.g. $R$ - Reflux flow rate, $S$ - Steam flow rate, $F$ - Feed flow rate)
  • Ouput names (e.g. $X_D$ - top composition, $X_B$ - bottom composition)
  • Steady-state values for inputs and outputs
  • Validity limits for inputs and outputs
  • Typical moves for inputs

A driver program is then created to set up the simulation and initialize the model. Users must define:

  • The simulation step size, $dt$
  • Simulation speed, in terms of a time delay, $T_D$ between steps
wm = WoodBerryModel()
dt=0.02 # in minutes, for the Wood-Berry model
woodberry = wm.create_system(dt=dt) # make the actual generator with step size = 0.02

At each iteration of the simulation, users can send values to the simulation by using send() with a dictionary with the Input names as keys:

# the main engine loop
for i in range(N):        
    y = woodberry.send({'R': 0.01, 'S': 0.01, 'F': 0.05}) # send this value to the model
    time.sleep(0.001) # this is the time delay T_D for the simulation speed

An example driver program is provided in the Example.ipynb notebook that uses the Wood-Berry distillation example.

Development

Recommended environment setup:

conda create -n pdengine python=3.10
conda activate pdengine
conda install -c conda-forge ipykernel slycot
python -m pip install control jupyter
python -m ipykernel install --user --name=pdengine

For an editable development environment, navigate to the pd-engine folder, then run:

python -m pip install -e .

If everything is working correctly, you should be able to run the example notebooks.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pdengine-0.0.6.tar.gz (11.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pdengine-0.0.6-py3-none-any.whl (13.4 kB view details)

Uploaded Python 3

File details

Details for the file pdengine-0.0.6.tar.gz.

File metadata

  • Download URL: pdengine-0.0.6.tar.gz
  • Upload date:
  • Size: 11.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for pdengine-0.0.6.tar.gz
Algorithm Hash digest
SHA256 58a99435b5162e3063790c0d4effc815d57604b7892f271daa6d488936fbb0dd
MD5 674c85d076e449709bd3b48724e364b0
BLAKE2b-256 437b3caeae363fccb8286afb593377ca7146159b34b0b0fce2f0517bd86baf89

See more details on using hashes here.

File details

Details for the file pdengine-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: pdengine-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 13.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for pdengine-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 557e5a3307f786b68321c15077290300ecdc3c3efe4851697b912dcaee75209b
MD5 1a325359cd62ed0030b23964853925df
BLAKE2b-256 1f8c4cb14fc4314ff05a1b388b209817d53af2b8568400b8b7b37ee54f6e08fa

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page