Skip to content

Commit

Permalink
Merge branch 'main' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
victoraalves committed Mar 18, 2024
2 parents 8178612 + b1f619b commit ffe9257
Show file tree
Hide file tree
Showing 63 changed files with 1,451 additions and 751 deletions.
57 changes: 54 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,69 @@
# opyrability - Process Operability Analysis in Python.
# Opyrability - Process Operability Analysis in Python.

![PyPI - Downloads](https://img.shields.io/pypi/dm/opyrability)


![PyPI - Version](https://img.shields.io/pypi/v/opyrability)
![Conda Version](https://img.shields.io/conda/v/codes-group/opyrability)


![GitHub forks](https://img.shields.io/github/forks/codes-group/opyrability)
![GitHub Repo stars](https://img.shields.io/github/stars/codes-group/opyrability)


![GitHub top language](https://img.shields.io/github/languages/top/codes-group/opyrability)

![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/codes-group/opyrability/.github%2Fworkflows%2Fpython-publish.yml)
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/codes-group/opyrability/.github%2Fworkflows%2Fpublish_conda.yml)


![Website](https://img.shields.io/website?url=https%3A%2F%2Fcodes-group.github.io%2Fopyrability%2F)
![GitHub License](https://img.shields.io/github/license/codes-group/opyrability)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.05966/status.svg)](https://doi.org/10.21105/joss.05966)


Welcome to opyrability, a Python-based package for performing [Process Operability](https://www.sciencedirect.com/science/article/pii/S1474667017338028) analysis.

opyrability is developed by the Control, Optimization and Design for Energy and Sustainability (CODES) Group at West Virginia University under Dr. [Fernando V. Lima](https://fernandolima.faculty.wvu.edu/)'s supervision.
opyrability is developed by the [Control, Optimization and Design for Energy and Sustainability (CODES) Group](https://fernandolima.faculty.wvu.edu/) at West Virginia University.

![](/docs/opyrability_overview.png)

Authors:
[Victor Alves](https://github.com/victoraalves) and [San Dinh](https://github.com/sanqdinh)
- [Victor Alves](https://github.com/victoraalves)
- [San Dinh](https://github.com/sanqdinh)
- [Jonh Kitchin](https://github.com/jkitchin)
- Vitor Gazzaneo
- Juan C. Carrasco
- [Fernando V. Lima](https://github.com/fvlima-codes)

## Documentation and Process Operability Principles

Full documentation and discussion regarding process operability principles are available in [opyrability's online portal.](https://codes-group.github.io/opyrability/)

## Citing Us

To cite us, please use the following BibTeX entry below:

```
@article{Alves2024,
doi = {10.21105/joss.05966},
url = {https://doi.org/10.21105/joss.05966},
year = {2024},
publisher = {The Open Journal},
volume = {9},
number = {94},
pages = {5966},
author = {Victor Alves and San Dinh and John R. Kitchin and Vitor Gazzaneo and Juan C. Carrasco and Fernando V. Lima},
title = {Opyrability: A Python package for process operability analysis}, journal = {Journal of Open Source Software}
}
```

A paper describing opyrability's main functionalities is available in the Journal of Open Source Software (JOSS):

[![DOI](https://joss.theoj.org/papers/10.21105/joss.05966/status.svg)](https://doi.org/10.21105/joss.05966)



## Installation

The Anaconda distribution is needed to have some of opyrability's dependencies.
Expand Down
4 changes: 2 additions & 2 deletions conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = "1.4.3" %}
{% set version = "1.4.7" %}

package:
name: opyrability
Expand Down Expand Up @@ -27,7 +27,7 @@ requirements:
- scipy
- cvxopt
- tqdm
- matplotlib
- matplotlib <3.8.0
- polytope >=0.2.4,<0.3.0
- jaxlib >=0.4.13,<0.5.0
- jax >=0.4.13,<0.5.0
Expand Down
Binary file modified docs/_build/.doctrees/api.doctree
Binary file not shown.
Binary file modified docs/_build/.doctrees/bibliography.doctree
Binary file not shown.
Binary file modified docs/_build/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/_build/.doctrees/examples_gallery/membrane_reactor.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/_build/.doctrees/installation.doctree
Binary file not shown.
Binary file modified docs/_build/.doctrees/intro.doctree
Binary file not shown.
Binary file modified docs/_build/.doctrees/inverse_map_shower.doctree
Binary file not shown.
2 changes: 1 addition & 1 deletion docs/_build/html/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 00c670da5a092a5c3323b8cbe6da3f36
config: 11bcd87491be1937c52ddd12119e33c5
tags: 645f666f9bcd5a90fca523b33c5a78b7
5 changes: 3 additions & 2 deletions docs/_build/html/_autosummary/opyrability.html
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,14 @@
<ul class="nav bd-sidenav bd-sidenav__home-link">
<li class="toctree-l1">
<a class="reference internal" href="../intro.html">
Opyrability Documentation - v1.4.3
Opyrability Documentation -
</a>
</li>
</ul>
<ul class="current nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>


<li class="toctree-l1"><a class="reference internal" href="../operability_overview.html">Process Operability Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="../algorithms.html">Process Operability Algorithms</a></li>
<li class="toctree-l1 current active has-children"><a class="reference internal" href="../api.html">API Documentation</a><input checked="" class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-1"><i class="fa-solid fa-chevron-down"></i></label><ul class="current">
Expand Down Expand Up @@ -482,7 +483,7 @@ <h1>opyrability</h1>

<p class="copyright">

© Copyright 2023.
© Copyright 2022-2024.
<br/>

</p>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions docs/_build/html/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,14 @@
<ul class="nav bd-sidenav bd-sidenav__home-link">
<li class="toctree-l1">
<a class="reference internal" href="../intro.html">
Opyrability Documentation - v1.4.3
Opyrability Documentation
</a>
</li>
</ul>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>


<li class="toctree-l1"><a class="reference internal" href="../operability_overview.html">Process Operability Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="../algorithms.html">Process Operability Algorithms</a></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../api.html">API Documentation</a><input class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-1"><i class="fa-solid fa-chevron-down"></i></label><ul>
Expand Down Expand Up @@ -355,7 +356,7 @@ <h1>All modules for which code is available</h1>

<p class="copyright">

© Copyright 2023.
© Copyright 2022-2024.
<br/>

</p>
Expand Down
14 changes: 11 additions & 3 deletions docs/_build/html/_modules/opyrability.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,13 +149,14 @@
<ul class="nav bd-sidenav bd-sidenav__home-link">
<li class="toctree-l1">
<a class="reference internal" href="../intro.html">
Opyrability Documentation - v1.4.3
Opyrability Documentation -
</a>
</li>
</ul>
<ul class="nav bd-sidenav">
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>


<li class="toctree-l1"><a class="reference internal" href="../operability_overview.html">Process Operability Overview</a></li>
<li class="toctree-l1"><a class="reference internal" href="../algorithms.html">Process Operability Algorithms</a></li>
<li class="toctree-l1 has-children"><a class="reference internal" href="../api.html">API Documentation</a><input class="toctree-checkbox" id="toctree-checkbox-1" name="toctree-checkbox-1" type="checkbox"/><label class="toctree-toggle" for="toctree-checkbox-1"><i class="fa-solid fa-chevron-down"></i></label><ul>
Expand Down Expand Up @@ -319,7 +320,7 @@ <h1>Source code for opyrability</h1><div class="highlight"><pre>
<span class="kn">from</span> <span class="nn">itertools</span> <span class="kn">import</span> <span class="n">permutations</span> <span class="k">as</span> <span class="n">perms</span>
<span class="kn">import</span> <span class="nn">string</span>
<span class="kn">from</span> <span class="nn">typing</span> <span class="kn">import</span> <span class="n">Callable</span><span class="p">,</span><span class="n">Union</span>
<span class="kn">from</span> <span class="nn">tqdm.auto</span> <span class="kn">import</span> <span class="n">tqdm</span>
<span class="kn">from</span> <span class="nn">tqdm.notebook</span> <span class="kn">import</span> <span class="n">tqdm</span>

<span class="c1"># Linear Algebra</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
Expand Down Expand Up @@ -1030,6 +1031,8 @@ <h1>Source code for opyrability</h1><div class="highlight"><pre>
<span class="sd"> https://doi.org/10.1016/j.compchemeng.2016.12.010</span>

<span class="sd"> &#39;&#39;&#39;</span>


<span class="kn">from</span> <span class="nn">scipy.optimize</span> <span class="kn">import</span> <span class="n">NonlinearConstraint</span>
<span class="c1"># Use JAX.numpy if differentiable programming is available.</span>
<span class="k">if</span> <span class="n">ad</span> <span class="ow">is</span> <span class="kc">False</span><span class="p">:</span>
Expand Down Expand Up @@ -1061,6 +1064,11 @@ <h1>Source code for opyrability</h1><div class="highlight"><pre>
<span class="kn">import</span> <span class="nn">jax.numpy</span> <span class="k">as</span> <span class="nn">np</span>
<span class="kn">from</span> <span class="nn">jax</span> <span class="kn">import</span> <span class="n">jacrev</span><span class="p">,</span> <span class="n">grad</span>

<span class="c1"># Make sure that the arrays contain floats (Reviewer #2 bug @ JOSS)</span>
<span class="n">u0</span> <span class="o">=</span> <span class="n">u0</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float64</span><span class="p">)</span>
<span class="n">lb</span> <span class="o">=</span> <span class="n">lb</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float64</span><span class="p">)</span>
<span class="n">ub</span> <span class="o">=</span> <span class="n">ub</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float64</span><span class="p">)</span>
<span class="n">DOS_bounds</span> <span class="o">=</span> <span class="n">DOS_bounds</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float64</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">p1</span><span class="p">(</span><span class="n">u</span><span class="p">:</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">,</span>
<span class="n">model</span><span class="p">:</span> <span class="n">Callable</span><span class="p">[</span><span class="o">...</span><span class="p">,</span> <span class="n">Union</span><span class="p">[</span><span class="nb">float</span><span class="p">,</span> <span class="n">np</span><span class="o">.</span><span class="n">ndarray</span><span class="p">]],</span>
Expand Down Expand Up @@ -2559,7 +2567,7 @@ <h1>Source code for opyrability</h1><div class="highlight"><pre>

<p class="copyright">

© Copyright 2023.
© Copyright 2022-2024.
<br/>

</p>
Expand Down
382 changes: 178 additions & 204 deletions docs/_build/html/_sources/api.ipynb

Large diffs are not rendered by default.

13 changes: 11 additions & 2 deletions docs/_build/html/_sources/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ y_1 = 0\rightarrow y_2 = 90
Defining the AIS bounds, as well as the discretization resolution:
```{code-cell}
AIS_bounds = np.array([[0, 10], [0, 10]])
resolution = [5, 5]
resolution = [25, 25]
```

Obtain discretized AIS/AOS.

```{code-cell}
AIS, AOS = AIS2AOS_map(shower_problem, AIS_bounds, resolution, plot = True)
print(AOS)
```

### Inverse mapping (AOS/DOS to AIS/DIS)
Expand Down Expand Up @@ -299,8 +299,17 @@ Generating paired simplicial polytopes for the AIS/AOS generated for the
shower problem example.

```{code-cell}
from opyrability import AIS2AOS_map
from opyrability import points2simplices
# Obtain an input-output mapping using AIS2AOS_map
AIS_bounds = np.array([[0, 10], [0, 10]])
resolution = [5, 5]
# The shower_problem function is the same one from the AIS2AOS_map example.
AIS, AOS = AIS2AOS_map(shower_problem, AIS_bounds, resolution, plot = False)
# Obtain simplices.
AIS_poly, AOS_poly = points2simplices(AIS,AOS)
print('AIS Simplices \n', AIS_poly)
Expand Down
11 changes: 11 additions & 0 deletions docs/_build/html/_sources/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,17 @@ The single command below will install opyrability and all requirements/dependenc
conda install -c codes-group -c conda-forge opyrability
```

## Using in a Google Colab environment:

You can set up opyrability in your Google Colab session as follows:
```console
!pip install -q condacolab
import condacolab
condacolab.install()
!conda install -c codes-group -c conda-forge opyrability
```


## Dependencies

Opyrability is allowed to exist thanks to the following libraries that are dependencies:
Expand Down
41 changes: 26 additions & 15 deletions docs/_build/html/_sources/intro.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
# Opyrability Documentation - v1.4.3
# Opyrability Documentation ![PyPI - Version](https://img.shields.io/pypi/v/opyrability) ![Conda Version](https://img.shields.io/conda/vn/codes-group/opyrability)



![PyPI - Downloads](https://img.shields.io/pypi/dm/opyrability) ![GitHub License](https://img.shields.io/github/license/codes-group/opyrability) [![DOI](https://joss.theoj.org/papers/10.21105/joss.05966/status.svg)](https://doi.org/10.21105/joss.05966)

![GitHub forks](https://img.shields.io/github/forks/codes-group/opyrability)
![GitHub Repo stars](https://img.shields.io/github/stars/codes-group/opyrability)






**Opyrability** - A **Py**thon-based package for process **o**pe**rability** analysis - is an open-source project for advanced process operability analyses. The opyrability codebase includes the main operability algorithms, supplementary analysis and visualization methods to allow for the assessment of simultaneous design and control objectives early in the conceptual phase.

Expand All @@ -16,25 +28,24 @@ and find examples on how to use the package!

# Citing us

This initiative has the objective of supporting process systems applications and promoting the dissemination, discussion and improvement of operability approaches and algorithms. Information about the developed approaches can be found at reference {cite}`gazzaneo20`. Please cite this reference if you use opyrability for your own research.
This initiative has the objective of supporting process systems applications and promoting the dissemination, discussion and improvement of operability approaches and algorithms. Information about the developed approaches can be found at reference {cite}`Alves2024`. Please cite this reference if you use opyrability for your own research.

[![DOI](https://joss.theoj.org/papers/10.21105/joss.05966/status.svg)](https://doi.org/10.21105/joss.05966)

```{eval-rst}
.. code-block:: none
@article{gazzaneo20,
author = {Gazzaneo, Vitor and Carrasco, Juan C. and Vinson, David R. and Lima, Fernando V.},
title = {Process Operability Algorithms: Past, Present, and Future Developments},
journal = {Industrial \& Engineering Chemistry Research},
volume = {59},
number = {6},
pages = {2457-2470},
year = {2020},
doi = {10.1021/acs.iecr.9b05181},
URL = {https://doi.org/10.1021/acs.iecr.9b05181},
eprint = {https://doi.org/10.1021/acs.iecr.9b05181}
@article{Alves2024,
doi = {10.21105/joss.05966},
url = {https://doi.org/10.21105/joss.05966},
year = {2024},
publisher = {The Open Journal},
volume = {9},
number = {94},
pages = {5966},
author = {Victor Alves and San Dinh and John R. Kitchin and Vitor Gazzaneo and Juan C. Carrasco and Fernando V. Lima},
title = {Opyrability: A Python package for process operability analysis}, journal = {Journal of Open Source Software}
}
```
18 changes: 9 additions & 9 deletions docs/_build/html/_sources/process_model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"cells": [
{
"cell_type": "markdown",
"id": "0c574d21",
"id": "f8a0fef3",
"metadata": {},
"source": [
"## The Process Model (M) - Programming Aspects \n",
Expand Down Expand Up @@ -35,7 +35,7 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "3f67c125",
"id": "e92da346",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -54,7 +54,7 @@
},
{
"cell_type": "markdown",
"id": "790e7897",
"id": "761b11a8",
"metadata": {},
"source": [
"### Process Model Defined as a Set of Algebraic Equations\n",
Expand All @@ -67,7 +67,7 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "eccd0ece",
"id": "17614507",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -84,7 +84,7 @@
},
{
"cell_type": "markdown",
"id": "ea7a59c9",
"id": "ac2059c3",
"metadata": {},
"source": [
"### Process Model Defined as a Set of Ordinary Differential (ODE) Equations:\n",
Expand All @@ -106,7 +106,7 @@
{
"cell_type": "code",
"execution_count": 3,
"id": "b1a4e520",
"id": "9bde8dac",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -225,7 +225,7 @@
},
{
"cell_type": "markdown",
"id": "dde6990a",
"id": "bad18fa4",
"metadata": {},
"source": [
"This system needs to be numerically integrated. Afterward, the AOS variables\n",
Expand All @@ -237,7 +237,7 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "5d6580ae",
"id": "c839698e",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -266,7 +266,7 @@
},
{
"cell_type": "markdown",
"id": "b8c61d30",
"id": "60f875a1",
"metadata": {},
"source": [
"In the function `dma_mr_design` above, the function input `u` is a two-dimensional vector\n",
Expand Down
Loading

0 comments on commit ffe9257

Please sign in to comment.