FeOs-CAMPD
Computer-aided molecular and process design based on the FeOs framework.
The package provides infrastructure to perform a computer-aided molecular and process design. It consists of
- NLP/MIQCP solver bindings (Artelys Knitro)
- Implementation of a custom outer-approximation algorithms to solve the resulting MINLP
- Molecular representations (group counts (CoMT-CAMD) and molecule superstructures)
- Property models (PC-SAFT and (heterosegmented) gc-PC-SAFT)
and the surrounding framework that is used to run the optimization problems for arbitrary process models. The framework is implemented in Rust and can be accessed directly or through the Python interface.
Currently, solving CAMPD problems is only possible with an installation of Artelys Knitro 12. A switch to open-source implementations is heavily favored, but currently not immediately planned due to time constraints. Please contact the maintainers if you are interested in contributing.
Installation
Rust
Just add the dependency to your Cargo.toml
= "0.2"
Python
If you have a Rust compiler installed, you can builf the package directly from source using:
pip install git+https://github.com/feos-org/feos-campd
Usage
The following sections demonstrates the usage of the framework in Python. The API in Rust and Python is kept as consistent as possible within the boundaries of the languages. Therefore, the basic steps are identical for a design implemented in Rust, for the API details, check out the documentation.
Molecular representation
# define the molecular representation using a molecule superstructure
=
# or a combination of superstructures
=
# or provide a list of molecules to choose from
=
=
# or provide an input file with group and structure definitions for CoMT-CAMD
=
Property model
# The available property models are compatible with the parameter files in FeOs
=
=
=
Process model
#To implement a process model in Python, define a class with the following methods:
# For each process variable: the lower bound, the upper bound, and the initial value
return
# The number of equality constraints (h(x) = 0)
return ...
# The number of inequality constraints (g(x) >= 0)
return ...
# For given equation of state and process variables x, return the target, and the values of
# equality and inequality constraints
# eos - the equation of state object as used in FeOs, e.g.,
=
# x - the list of process degrees of freedom, e.g.,
, , ... =
# The function is called with regular Python data types (floats), so the implementation
# of the process model can be as flexible as desired and involve external function calls
...
return , ,
Optimization problem
# combine molecular representation, property model, and process model in an optimization problem
# for a pure component
=
# or a binary mixture
=
# use either of these algorithms
# (The boolean indicates whether the algorithm should update the lower bound of the outer approximation
# True can lead to local optima in non-convex problems)
=
=
=
# to determine a ranking of the optimal molecules
Molecular representations and property models can be combined according to:
| PC-SAFT | gc-PC-SAFT | |
|---|---|---|
| CoMTCAMD | yes | no |
| SuperMolecule | yes | yes |
Cite us
If you find FeOs-torch useful for your own research, consider citing our publication from which this library resulted.
@article{rehner2023molecule_superstructures,
author = {Rehner, Philipp and Schilling, Johannes and Bardow, André},
title = {Molecule superstructures for computer-aided molecular and process design}
journal = {Molecular Systems Design & Engineering},
volume = {8},
issue = {4},
number = {12},
pages = {488-499},
year = {2023}
}