DWSIM automation with python for chemical process simulation optimization
Project description
dwsimopt: DWSIM simulation optimization with Python!
The DWSIM Optimization (dwsimopt
) is a Python library that automates DWSIM simulations for process optimization.
The simulation dlls are embedded in the programming environment so that they can be accessed and modified by the optimization algorithms.
Mathematical background
Although very efficient to describe in detail complex systems that would otherwise have to be simplified or approximated, black-box process simulators lack the symbolic formulation of the process model equations and the analytical derivatives that are useful for optimization, for example. The use of simulation may also introduce noise to the calculations due to convergence and approximations of numerical methods, which can jeopardize the calculation of accurate approximate derivatives and, therefore, the use of gradient-based optimization methods directly [1]. Also, the lack of analytical formulations of the optimization problem prevents the derivation of rigorous upper and lower bounds of the functions that are used for deterministic global optimization [2]. In that sense, the optimization models that require simulations to calculate the objective function and/or constraints are often referred to as simulation optimization problem [3]. A simplified version of this class of problems can be described as finding an that solves globally the following constrained problem
in which the objective function and constraints , being q the number of constraints, are somewhat expensive to calculate, slightly noisy, and black-box functions, i.e. there is no available mathematical expression for f or g, but for a given the values of f(x) and f(x) are calculated in a computer code simulation with some noise.
Requirements
- Python <= 3.9 (python 3.8 recommended -- using python 3.9 requires installing dwsimopt from
setup.py
) - DWSIM v7+ (open-source chemical process simulation. Download here)
- pythonnet == 2.5.2 (on Python 3.9 you'll need to download the pythonnet2.5.2 wheel and
pip install path\to\pythonnet_wheel
) - pywin32
- numpy
- scipy
- scikit-opt
It is recommendable to start from a fresh environment and let the dwsimopt
install the dependencies, see Installation section. DWSIM must be downloaded and installed manually.
Installation
Install the latest version of this repository to your machine
pip install dwsimopt
or
git clone https://github.com/lf-santos/dwsimopt.git cd dwsimopt python setup.py install
Make sure you have all the required packages and software. Navigate through the jupyter notebook examples. Use the OptimiSim
class to embed your DMSWIM
simulation into Python. Add degrees of freedom, objective function and constraints from your simulation optimization problem with the py2dwim
python-dwsim data exchange interface. Solve the problem with a suitable optimization solver (surrogate-based optimization or global optimization meta-heuristics recommended) that you can find methods in the OptimiSim
class (e.g. GA
, PSO
, DE
)
Citing us
If you use dwsimopt, please cite the following paper: L. F. Santos, C. B. B. Costa, J. A. Caballero, M. A. S. S. Ravagnani, Framework for embedding black-box simulation into mathematical programming via kriging surrogate model applied to natural gas liquefaction process optimization, Applied Energy, 310, 118537 (2022).
@article{Santos2022, title = {Framework for embedding black-box simulation into mathematical programming via kriging surrogate model applied to natural gas liquefaction process optimization}, author = {Lucas F. Santos and Caliane B.B. Costa and José A. Caballero and Mauro A.S.S. Ravagnani}, journal = {Applied Energy}, volume = {310}, pages = {118537}, year = {2022}, issn = {0306-2619}, doi = {https://doi.org/10.1016/j.apenergy.2022.118537},
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
Built Distribution
File details
Details for the file dwsimopt-0.2.0.tar.gz
.
File metadata
- Download URL: dwsimopt-0.2.0.tar.gz
- Upload date:
- Size: 4.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f87515786c1d5c4b703474ab5a24ea88f23aac7dcb56ce0d2e1cc3d8378cd6d7 |
|
MD5 | 93a33e795857682c0eeefbcdaa1ed56d |
|
BLAKE2b-256 | 631568b5db3898a8e8081fbed50980790d03d157403b02625ab8b6f984a7828b |
File details
Details for the file dwsimopt-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: dwsimopt-0.2.0-py3-none-any.whl
- Upload date:
- Size: 20.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 649c710d0afb3a4ac9aebf230d4fc272fbf74e20391e0decf0e30bd96a07a997 |
|
MD5 | e063bc3ca41b3ad77ebeda1345bbee3e |
|
BLAKE2b-256 | a49a0b8c164eab01447b9e0860e90644adfa7b0943e4fcdc69c4533b532c2fb4 |