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.x (might work on older version, but def. not on 3.10+.
  • DWSIM v7 (open-source chemical process simulation. Download here)
  • pythonnet 2.5.2 +
  • pywin32
  • scipy 1.7.x +
  • numpy 1.21.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.3.tar.gz (2.1 MB view hashes)

Uploaded Source

Built Distribution

dwsimopt-0.0.3-py3-none-any.whl (9.3 kB view hashes)

Uploaded Python 3

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