<jupyter_start><jupyter_text>Residence time distributions from CSTR and Van de VusseCompare RTDs using series CSTR and Vusse approach using functions available in the rtd.py module of PyroPy.<jupyter_code>import numpy as np
import matplotlib.pyplot as py
%matplotlib inline
import chemics as cm
    
# Compare Series CSTR and Vusse RTD
# -----------------------------------------------------------------------------

n = 8                       # number of stages
tau = 2.8                   # residence time, s
t = np.linspace(0, 10, 200) # time vector, s

rt_scstr = cm.scstr(n, tau, t)          # RTD based on series CSTR
rt_circ = cm.vusse(n, 2.8, t)           # RTD based on Vusse 1962, with circulation
rt_nocirc = cm.vusse(n, 2.8, t, r=1e-6) # RTD based on Vusse 1962, no circulation

# Plot
# -----------------------------------------------------------------------------

py.ion()
py.close('all')

py.figure(1)
py.plot(t, rt_scstr, 'b-', lw=2, label='series CSTR')
py.plot(t, abs(rt_circ.real), 'g-', lw=2, label='Vusse, q/r=1')
py.plot(t, abs(rt_nocirc.real), 'r--', lw=2, label='Vusse, r=0')
py.legend(loc='best', numpoints=1)
py.ylabel('RTD')
py.xlabel('Time (s)')
py.grid()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.248559670781893, 'fraction_numerical': 0.024691358024691357, 'mean_word_length': 2.117948717948718, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '522978', 'license': 'MIT', 'n_tokens_mistral': 449, 'n_tokens_neox': 424, 'n_words': 121, 'path': 'rtd_cstr_vusse.ipynb', 'repo_name': 'chemics/chemics-examples', 'size': '1215'}