Skip to main content

DWSIM automation with python for chemical process simulation optimization

Project description

pyDWSIMopt: DWSIM simulation optimization with Python!

The Python DWSIM Optimization (pyDWSIMopt) is a library that automates DWSIM simulations for process optimization. The simulations dlls are embedded in the programming environment so that it can be accessd and modified by the optimization algorithms.

Mathematical background

Although very efficient to describe in details 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 to find an equation that solves globally the following constrained problem

equation

in which the objective function equation and constraints equation, 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 equation the value of f(x) and f(x) are calculated in a computer code simulation with some noise.

Requirements

  • Python <= 3.9 (might work on older version, but def. not on 3.10+)
  • 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\wheel)
  • pywin32
  • numpy 1.21.x +
  • scipy 1.7.x +
  • matplotlib 3.5.x +

Or, start from a fresh environment and let the pyDWSIMopt install the dependencies. Except DWSIM that 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/pyDWSIMopt.git
cd pyDWSIMopt
python setup.py install

Make sure you have all the required packages and software. Navegate throught the jupyter notebook examples. Use the Simulation class to embed your DMSWIM simulation into Python. Modify the fobj.py to calculate the objective function and constraints of your simulation optimization problem.

Citing us

If you use pyDWSIMopt, plese cite the following paper: L. F. Santos, C. B. B. Costa, J. A. Caballero, M. A. Ravagnani, Kriging-assisted constrained optimization of single-mixed refrigerant natural gas liquefaction process, Chemical Engineering Science (2021). 116699doi:https://doi.org/10.1016/j.ces.2021.116699.

@article{santos2021kriging,
  title={Kriging-assisted constrained optimization of single-mixed refrigerant natural gas liquefaction process},
  author={Santos, Lucas F and Costa, Caliane BB and Caballero, Jos{\'e} A and Ravagnani, Mauro ASS},
  journal={Chemical Engineering Science},
  volume={241},
  pages={116699},
  year={2021},
  publisher={Elsevier}
}

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

dwsimopt-0.0.4.tar.gz (2.6 MB view details)

Uploaded Source

Built Distribution

dwsimopt-0.0.4-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

Details for the file dwsimopt-0.0.4.tar.gz.

File metadata

  • Download URL: dwsimopt-0.0.4.tar.gz
  • Upload date:
  • Size: 2.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for dwsimopt-0.0.4.tar.gz
Algorithm Hash digest
SHA256 ba3e4467d407cf71c06fd9c57a530ff0276c053f5a2c0996a355ea97fc325913
MD5 28f81d8669c245e38773c4b61772a638
BLAKE2b-256 3ea82c19e738b573c0c47e31c9e107c9c8e786988443551296b73398b121a1f3

See more details on using hashes here.

File details

Details for the file dwsimopt-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: dwsimopt-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 9.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.9.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.10

File hashes

Hashes for dwsimopt-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 57b7edf36a225fb1c48a86b4af41113c4d0294300cf797a3672670be28194034
MD5 9843f34d23f8f72fb9434b66ec0c228e
BLAKE2b-256 0df8c9513e54c00a228e9aa6cc3ce26d8c8bda7b30066015efae9520c647728d

See more details on using hashes here.

Supported by

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