farisachugthai / rtdpy

Residence Time Distribution modeling in Python.

Home Page:https://merck.github.com/rtdpy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

rtdpy

Residence Time Distribution modeling in Python.

https://merck.github.com/rtdpy

DOI

A simple example

Create a family of tanks in series (N-CSTRs) and analyze them

import matplotlib.pyplot as plt
import rtdpy
for n in [1, 2, 5, 10, 100]:
    a = rtdpy.Ncstr(tau=1, n=n, dt=.001, time_end=5)
    plt.plot(a.time, a.exitage, label="n={}".format(n))
plt.legend()
plt.xlabel('Time')
plt.ylabel('Exit Age Function')
plt.title('Impulse Responses')

N-Cstr RTDs

Installation

pip install rtdpy

Issues/Requests/Contributions

See CONTRIBUTING.md

Testing

Tests are written using pytest. numpy and scipy must also be installed in the environment if using pytest directly. tox can also be used to test against Python versions 3.5, 3.6, and 3.7. See pytest documentation for how to use and interpret pytest results.

It is recommended to use a virtual environment for developing/testing.

git clone https://github.com/Merck/rtdpy.git  # or use your forked repo
cd rtdpy
python3 -m venv .venv
source .venv/bin/activate
pip install -e .  # will also install numpy and scipy dependencies
pip install pytest tox

# run all tests
pytest

# run tests and style check for Python versions 3.5, 3.6, and 3.7, if available.
tox

Author: Matthew Flamm

Email: matthew.flamm@merck.com

About

Residence Time Distribution modeling in Python.

https://merck.github.com/rtdpy

License:MIT License


Languages

Language:Python 96.4%Language:TeX 2.6%Language:Makefile 1.0%