{"id":34065880,"url":"https://github.com/lf-santos/dwsimopt","last_synced_at":"2025-12-14T06:03:32.396Z","repository":{"id":44923548,"uuid":"398564974","full_name":"lf-santos/dwsimopt","owner":"lf-santos","description":"The 'dwsimopt' is a Python library that automates DWSIM simulations for process optimization.","archived":false,"fork":false,"pushed_at":"2023-01-09T11:40:08.000Z","size":27427,"stargazers_count":22,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-09-30T15:12:27.987Z","etag":null,"topics":["automation","chemical-engineering","chemical-process","dwsim","modeling","optimization","optimization-algorithms","optimization-framework","optimization-process","process-design","process-simulation","process-simulator","python","simulation"],"latest_commit_sha":null,"homepage":"https://lf-santos.github.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lf-santos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-08-21T13:28:56.000Z","updated_at":"2025-03-15T08:09:03.000Z","dependencies_parsed_at":"2023-02-08T10:16:44.494Z","dependency_job_id":null,"html_url":"https://github.com/lf-santos/dwsimopt","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/lf-santos/dwsimopt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lf-santos%2Fdwsimopt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lf-santos%2Fdwsimopt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lf-santos%2Fdwsimopt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lf-santos%2Fdwsimopt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lf-santos","download_url":"https://codeload.github.com/lf-santos/dwsimopt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lf-santos%2Fdwsimopt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27719082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-14T02:00:11.348Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","chemical-engineering","chemical-process","dwsim","modeling","optimization","optimization-algorithms","optimization-framework","optimization-process","process-design","process-simulation","process-simulator","python","simulation"],"created_at":"2025-12-14T06:03:28.748Z","updated_at":"2025-12-14T06:03:32.390Z","avatar_url":"https://github.com/lf-santos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dwsimopt: DWSIM simulation optimization with Python!\n\n[![PyPI](https://img.shields.io/pypi/v/dwsimopt)](https://pypi.org/project/dwsimopt/)\n\u003ca href='https://pydwsimopt.readthedocs.io/en/latest/?badge=latest' target=\"blank\"\u003e\n    \u003cimg src='https://readthedocs.org/projects/pydwsimopt/badge/?version=latest' alt='Documentation Status' /\u003e\n\u003c/a\u003e\n[![License](https://img.shields.io/pypi/l/dwsimopt.svg)](https://github.com/lf-santos/dwsimopt/LICENSE)\n\nThe DWSIM Optimization (`dwsimopt`) is a Python library that automates DWSIM simulations for process optimization.\nThe simulation dlls are embedded in the programming environment so that they can be accessed and modified by the optimization algorithms.\n\n## Mathematical background\n\nAlthough 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 \u003ca href=\"https://doi.org/10.1002/aic.11579\"\u003e[1]\u003c/a\u003e. 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 \u003ca href=\"https://doi.org/10.1007/s11590-016-1028-2\"\u003e[2]\u003c/a\u003e. 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 \u003ca href=\"https://doi.org/10.1007/s10479-015-2019-x\"\u003e[3]\u003c/a\u003e. A simplified version of this class of problems can be described as finding an ![equation](https://latex.codecogs.com/svg.latex?%5Cinline%20%7B%5Ccolor%7BMagenta%7D%20%5Ctextbf%7Bx%7D%5E*%5Cin%20%5Cmathbb%7BR%7D%5En%7D) that solves globally the following constrained problem\n\n![equation](https://latex.codecogs.com/svg.latex?%7B%5Ccolor%7BMagenta%7D%20%5Cbegin%7Balign*%7D%20%5Cmin_%7B%5Ctextbf%7Bx%7D%5Cin%20%5Cmathcal%7BD%7D%7D%26%20%5C%20%5C%20f%28%5Ctextbf%7Bx%7D%29%5C%5C%20s.t.%26%20%5C%20%5C%20%5Ctextbf%7Bg%7D%28%5Ctextbf%7Bx%7D%29%5Cle%200%2C%20%5Cend%7Balign%7D%7D)\n\nin which the objective function ![equation](https://latex.codecogs.com/svg.latex?%5Cinline%20%7B%5Ccolor%7BMagenta%7D%20f%3A%5Cmathbb%7BR%7D%5En%5Cmapsto%20%5Cmathbb%7BR%7D%7D) and constraints ![equation](https://latex.codecogs.com/svg.latex?%5Cinline%20%7B%5Ccolor%7BMagenta%7D%20%5Ctextbf%7Bg%7D%3A%5Cmathbb%7BR%7D%5En%5Cmapsto%20%5Cmathbb%7BR%7D%5Eq%7D), 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](https://latex.codecogs.com/svg.latex?%5Cinline%20%7B%5Ccolor%7BMagenta%7D%20%5Ctextbf%7Bx%7D%5Cin%5Cmathcal%7BD%7D%5Csubseteq%5Cmathbb%7BR%7D%5En%7D) the values of *f*(**x**) and **f**(**x**) are calculated in a computer code simulation with some noise.\n\n## Requirements\n- Python \u003c= 3.9 (python 3.8 recommended -- using python 3.9 requires installing dwsimopt from ``setup.py``)\n- DWSIM v7+ (open-source chemical process simulation. \u003ca href=\"https://dwsim.org/index.php/download/\"\u003eDownload here\u003c/a\u003e)\n- pythonnet == 2.5.2 (on Python 3.9 you'll need to \u003ca href=\"https://www.lfd.uci.edu/~gohlke/pythonlibs/#pythonnet\"\u003edownload the pythonnet2.5.2 wheel\u003c/a\u003e and ``pip install path\\to\\pythonnet_wheel``)\n- pywin32\n- numpy\n- scipy\n- scikit-opt\n\nIt is recommendable to start from a fresh environment and let the `dwsimopt` install the dependencies, see \u003ca href=#installation\u003eInstallation\u003c/a\u003e section. DWSIM must be downloaded and installed manually.\n\n## Installation\n\nInstall the latest version of this repository to your machine\n\n\u003cpre\u003epip install dwsimopt\u003c/pre\u003e\nor\n\u003cpre\u003egit clone https://github.com/lf-santos/dwsimopt.git\ncd dwsimopt\npython setup.py install\n\u003c/pre\u003e\n\nMake 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`)\n\n\n## Citing us\n\nIf you use dwsimopt, please cite the following paper: \u003ca href=\"https://doi.org/10.1016/j.apenergy.2022.118537\" title=\"simulation optimization paper\"\u003eL. 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).\u003c/a\u003e\n\n\u003cpre\u003e\n@article{Santos2022,\ntitle = {Framework for embedding black-box simulation into mathematical programming via kriging surrogate model applied to natural gas liquefaction process optimization},\nauthor = {Lucas F. Santos and Caliane B.B. Costa and José A. Caballero and Mauro A.S.S. Ravagnani},\njournal = {Applied Energy},\nvolume = {310},\npages = {118537},\nyear = {2022},\nissn = {0306-2619},\ndoi = {https://doi.org/10.1016/j.apenergy.2022.118537},\n\u003c/pre\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flf-santos%2Fdwsimopt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flf-santos%2Fdwsimopt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flf-santos%2Fdwsimopt/lists"}