pypolymer 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pypolymer-0.2.0/LICENSE +21 -0
- pypolymer-0.2.0/MANIFEST.in +4 -0
- pypolymer-0.2.0/PKG-INFO +135 -0
- pypolymer-0.2.0/README.md +104 -0
- pypolymer-0.2.0/pyproject.toml +8 -0
- pypolymer-0.2.0/setup.cfg +4 -0
- pypolymer-0.2.0/setup.py +84 -0
- pypolymer-0.2.0/src/pypolymer/__init__.py +58 -0
- pypolymer-0.2.0/src/pypolymer/__main__.py +6 -0
- pypolymer-0.2.0/src/pypolymer/reactor.py +2041 -0
- pypolymer-0.2.0/src/pypolymer.egg-info/PKG-INFO +135 -0
- pypolymer-0.2.0/src/pypolymer.egg-info/SOURCES.txt +15 -0
- pypolymer-0.2.0/src/pypolymer.egg-info/dependency_links.txt +1 -0
- pypolymer-0.2.0/src/pypolymer.egg-info/entry_points.txt +3 -0
- pypolymer-0.2.0/src/pypolymer.egg-info/requires.txt +10 -0
- pypolymer-0.2.0/src/pypolymer.egg-info/top_level.txt +1 -0
- pypolymer-0.2.0/tests/test_reactor.py +102 -0
pypolymer-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 sebygaa
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
pypolymer-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: pypolymer
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: LDPE polymerization reactor simulation (moments + chain-length distribution) and reinforcement-learning operating-condition optimisation.
|
|
5
|
+
Home-page: https://github.com/sebygaa/polymer-reactor
|
|
6
|
+
Author: sebygaa
|
|
7
|
+
Author-email: sebyga@gmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/sebygaa/polymer-reactor
|
|
10
|
+
Project-URL: Repository, https://github.com/sebygaa/polymer-reactor
|
|
11
|
+
Project-URL: Issues, https://github.com/sebygaa/polymer-reactor/issues
|
|
12
|
+
Keywords: polymerization,reactor,LDPE,chemical-engineering,method-of-moments,chain-length-distribution,reinforcement-learning
|
|
13
|
+
Platform: UNKNOWN
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Topic :: Scientific/Engineering
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Chemistry
|
|
24
|
+
Requires-Python: >=3.9
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
Provides-Extra: plot
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
License-File: LICENSE
|
|
29
|
+
|
|
30
|
+
# pypolymer
|
|
31
|
+
|
|
32
|
+
Simulation and reinforcement-learning optimisation of free-radical
|
|
33
|
+
polymerization reactors (LDPE-type chemistry), in pure NumPy + SciPy.
|
|
34
|
+
|
|
35
|
+
`pypolymer` provides one reactor class, `PolyRxn`, that simulates **Batch**,
|
|
36
|
+
**CSTR**, and tubular **PFR** reactors by the **method of moments**, plus a
|
|
37
|
+
**chain-length-distribution (CLD)** batch solver that integrates every chain
|
|
38
|
+
length explicitly to recover the full molecular-weight distribution. A set of
|
|
39
|
+
REINFORCE-based helpers optimise reactor operating conditions.
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
pip install pypolymer
|
|
45
|
+
# with plotting extras (matplotlib):
|
|
46
|
+
pip install "pypolymer[plot]"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
From a local checkout:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pip install -e ".[dev]"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## Reaction model
|
|
56
|
+
|
|
57
|
+
Free-radical polymerization with initiator decay, propagation, chain transfer
|
|
58
|
+
to monomer / polymer / agent (CTA), and termination by combination and
|
|
59
|
+
disproportionation:
|
|
60
|
+
|
|
61
|
+
| Step | Reaction |
|
|
62
|
+
|------|----------|
|
|
63
|
+
| Initiation | `I → 2 R·`, `R· + M → P₁` |
|
|
64
|
+
| Propagation | `Pₙ + M → Pₙ₊₁` |
|
|
65
|
+
| Transfer to monomer | `Pₙ + M → Dₙ + P₁` |
|
|
66
|
+
| Transfer to polymer | `Pₙ + Dₘ → Dₙ + Pₘ` |
|
|
67
|
+
| Transfer to agent (CTA) | `Pₙ + S → Dₙ + P₁` |
|
|
68
|
+
| Termination (combination) | `Pₙ + Pₘ → Dₙ₊ₘ` |
|
|
69
|
+
| Termination (disproportionation) | `Pₙ + Pₘ → Dₙ + Dₘ` |
|
|
70
|
+
|
|
71
|
+
## Quick start
|
|
72
|
+
|
|
73
|
+
### Method-of-moments batch
|
|
74
|
+
|
|
75
|
+
```python
|
|
76
|
+
from pypolymer import PolyRxn
|
|
77
|
+
|
|
78
|
+
rx = PolyRxn(kd=0.8, kp=15.0, ktc=0.02, ktd=0.02, ktrm=15e-3,
|
|
79
|
+
ktrp=10e-3, kca=5e-3, f=0.8, dH_p=-1.0e5, Mw_mono=28.05)
|
|
80
|
+
rx.set_batch_params(Tc_const=473.15, rho=1.0e4, Cp_ass=1.5, U_heat=400.0, D=0.05)
|
|
81
|
+
|
|
82
|
+
out = rx.run_batch(mono_0=8000.0, ini_0=50.0, CTA_0=20.0,
|
|
83
|
+
T_0=473.15, t_end=5.0, dt=0.01)
|
|
84
|
+
print(out["Mn_final"], out["Mw_final"], out["PDI_final"])
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Chain-length-distribution (CLD) batch
|
|
88
|
+
|
|
89
|
+
`run_batch_cld` resolves every active (`Pₙ`) and dead (`Dₙ`) chain length up to
|
|
90
|
+
`N_max`, so the molecular-weight distribution and its **exact** moments come out
|
|
91
|
+
directly — no Hulburt–Katz closure. It is isothermal and needs no
|
|
92
|
+
`set_batch_params`.
|
|
93
|
+
|
|
94
|
+
```python
|
|
95
|
+
from pypolymer import PolyRxn
|
|
96
|
+
|
|
97
|
+
rx = PolyRxn(kd=10.0, kp=2.0, ktc=1e-3, ktd=1e-3, ktrm=8e-3,
|
|
98
|
+
ktrp=1e-3, kca=0.0, f=1.0, dH_p=-1.0e5, Mw_mono=28.05)
|
|
99
|
+
|
|
100
|
+
out = rx.run_batch_cld(mono_0=180.0, ini_0=5e-2,
|
|
101
|
+
t_end=20.0, dt=0.1, N_max=1400)
|
|
102
|
+
|
|
103
|
+
print(out["Mn_final"], out["Mw_final"], out["PDI_final"]) # ≈ 6100, 12500, 2.05
|
|
104
|
+
mwd = out["MWD_final"] # full chain-length distribution P + D
|
|
105
|
+
nvec = out["chain_length"] # 1 .. N_max
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Choosing `N_max`.** Faster propagation produces longer chains; pick `N_max`
|
|
109
|
+
large enough that the distribution has decayed to ~0 at the boundary (check
|
|
110
|
+
`out["MWD_final"][-1]` is small relative to the peak). Cost grows with `N_max`
|
|
111
|
+
(an `N_max × N_max` outer product per RHS evaluation).
|
|
112
|
+
|
|
113
|
+
### Operating-condition optimisation (RL)
|
|
114
|
+
|
|
115
|
+
```python
|
|
116
|
+
from pypolymer import run_batch_rl, run_cstr_rl, run_pfr_rl
|
|
117
|
+
|
|
118
|
+
run_batch_rl(n_eps=120) # Batch
|
|
119
|
+
run_cstr_rl(n_eps=120) # CSTR
|
|
120
|
+
run_pfr_rl(n_eps=150, plot=True) # LDPE PFR (heavier)
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
Or from the command line:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
python -m pypolymer # Batch + CSTR optimisation
|
|
127
|
+
python -m pypolymer pfr # LDPE PFR optimisation
|
|
128
|
+
python -m pypolymer all # all three
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
|
|
133
|
+
MIT — see [LICENSE](LICENSE).
|
|
134
|
+
|
|
135
|
+
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# pypolymer
|
|
2
|
+
|
|
3
|
+
Simulation and reinforcement-learning optimisation of free-radical
|
|
4
|
+
polymerization reactors (LDPE-type chemistry), in pure NumPy + SciPy.
|
|
5
|
+
|
|
6
|
+
`pypolymer` provides one reactor class, `PolyRxn`, that simulates **Batch**,
|
|
7
|
+
**CSTR**, and tubular **PFR** reactors by the **method of moments**, plus a
|
|
8
|
+
**chain-length-distribution (CLD)** batch solver that integrates every chain
|
|
9
|
+
length explicitly to recover the full molecular-weight distribution. A set of
|
|
10
|
+
REINFORCE-based helpers optimise reactor operating conditions.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pip install pypolymer
|
|
16
|
+
# with plotting extras (matplotlib):
|
|
17
|
+
pip install "pypolymer[plot]"
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
From a local checkout:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
pip install -e ".[dev]"
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Reaction model
|
|
27
|
+
|
|
28
|
+
Free-radical polymerization with initiator decay, propagation, chain transfer
|
|
29
|
+
to monomer / polymer / agent (CTA), and termination by combination and
|
|
30
|
+
disproportionation:
|
|
31
|
+
|
|
32
|
+
| Step | Reaction |
|
|
33
|
+
|------|----------|
|
|
34
|
+
| Initiation | `I → 2 R·`, `R· + M → P₁` |
|
|
35
|
+
| Propagation | `Pₙ + M → Pₙ₊₁` |
|
|
36
|
+
| Transfer to monomer | `Pₙ + M → Dₙ + P₁` |
|
|
37
|
+
| Transfer to polymer | `Pₙ + Dₘ → Dₙ + Pₘ` |
|
|
38
|
+
| Transfer to agent (CTA) | `Pₙ + S → Dₙ + P₁` |
|
|
39
|
+
| Termination (combination) | `Pₙ + Pₘ → Dₙ₊ₘ` |
|
|
40
|
+
| Termination (disproportionation) | `Pₙ + Pₘ → Dₙ + Dₘ` |
|
|
41
|
+
|
|
42
|
+
## Quick start
|
|
43
|
+
|
|
44
|
+
### Method-of-moments batch
|
|
45
|
+
|
|
46
|
+
```python
|
|
47
|
+
from pypolymer import PolyRxn
|
|
48
|
+
|
|
49
|
+
rx = PolyRxn(kd=0.8, kp=15.0, ktc=0.02, ktd=0.02, ktrm=15e-3,
|
|
50
|
+
ktrp=10e-3, kca=5e-3, f=0.8, dH_p=-1.0e5, Mw_mono=28.05)
|
|
51
|
+
rx.set_batch_params(Tc_const=473.15, rho=1.0e4, Cp_ass=1.5, U_heat=400.0, D=0.05)
|
|
52
|
+
|
|
53
|
+
out = rx.run_batch(mono_0=8000.0, ini_0=50.0, CTA_0=20.0,
|
|
54
|
+
T_0=473.15, t_end=5.0, dt=0.01)
|
|
55
|
+
print(out["Mn_final"], out["Mw_final"], out["PDI_final"])
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### Chain-length-distribution (CLD) batch
|
|
59
|
+
|
|
60
|
+
`run_batch_cld` resolves every active (`Pₙ`) and dead (`Dₙ`) chain length up to
|
|
61
|
+
`N_max`, so the molecular-weight distribution and its **exact** moments come out
|
|
62
|
+
directly — no Hulburt–Katz closure. It is isothermal and needs no
|
|
63
|
+
`set_batch_params`.
|
|
64
|
+
|
|
65
|
+
```python
|
|
66
|
+
from pypolymer import PolyRxn
|
|
67
|
+
|
|
68
|
+
rx = PolyRxn(kd=10.0, kp=2.0, ktc=1e-3, ktd=1e-3, ktrm=8e-3,
|
|
69
|
+
ktrp=1e-3, kca=0.0, f=1.0, dH_p=-1.0e5, Mw_mono=28.05)
|
|
70
|
+
|
|
71
|
+
out = rx.run_batch_cld(mono_0=180.0, ini_0=5e-2,
|
|
72
|
+
t_end=20.0, dt=0.1, N_max=1400)
|
|
73
|
+
|
|
74
|
+
print(out["Mn_final"], out["Mw_final"], out["PDI_final"]) # ≈ 6100, 12500, 2.05
|
|
75
|
+
mwd = out["MWD_final"] # full chain-length distribution P + D
|
|
76
|
+
nvec = out["chain_length"] # 1 .. N_max
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Choosing `N_max`.** Faster propagation produces longer chains; pick `N_max`
|
|
80
|
+
large enough that the distribution has decayed to ~0 at the boundary (check
|
|
81
|
+
`out["MWD_final"][-1]` is small relative to the peak). Cost grows with `N_max`
|
|
82
|
+
(an `N_max × N_max` outer product per RHS evaluation).
|
|
83
|
+
|
|
84
|
+
### Operating-condition optimisation (RL)
|
|
85
|
+
|
|
86
|
+
```python
|
|
87
|
+
from pypolymer import run_batch_rl, run_cstr_rl, run_pfr_rl
|
|
88
|
+
|
|
89
|
+
run_batch_rl(n_eps=120) # Batch
|
|
90
|
+
run_cstr_rl(n_eps=120) # CSTR
|
|
91
|
+
run_pfr_rl(n_eps=150, plot=True) # LDPE PFR (heavier)
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Or from the command line:
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
python -m pypolymer # Batch + CSTR optimisation
|
|
98
|
+
python -m pypolymer pfr # LDPE PFR optimisation
|
|
99
|
+
python -m pypolymer all # all three
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
# Package metadata lives in setup.py. This file only declares the build
|
|
2
|
+
# backend (PEP 517) and tool configuration.
|
|
3
|
+
[build-system]
|
|
4
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
5
|
+
build-backend = "setuptools.build_meta"
|
|
6
|
+
|
|
7
|
+
[tool.pytest.ini_options]
|
|
8
|
+
testpaths = ["tests"]
|
pypolymer-0.2.0/setup.py
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"""Setup script for the pypolymer package.
|
|
2
|
+
|
|
3
|
+
Metadata lives here; pyproject.toml keeps only the build-system declaration and
|
|
4
|
+
tool configuration. The version is read from src/pypolymer/reactor.py so that
|
|
5
|
+
__version__ remains the single source of truth.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
import pathlib
|
|
9
|
+
import re
|
|
10
|
+
|
|
11
|
+
from setuptools import find_packages, setup
|
|
12
|
+
|
|
13
|
+
HERE = pathlib.Path(__file__).parent
|
|
14
|
+
|
|
15
|
+
# Long description shown on the PyPI project page.
|
|
16
|
+
long_description = (HERE / "README.md").read_text(encoding="utf-8")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _read_version():
|
|
20
|
+
"""Parse __version__ from reactor.py without importing (no numpy needed)."""
|
|
21
|
+
src = (HERE / "src" / "pypolymer" / "reactor.py").read_text(encoding="utf-8")
|
|
22
|
+
match = re.search(r'^__version__\s*=\s*["\']([^"\']+)["\']', src, re.M)
|
|
23
|
+
if not match:
|
|
24
|
+
raise RuntimeError("Unable to find __version__ in reactor.py")
|
|
25
|
+
return match.group(1)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
setup(
|
|
29
|
+
name="pypolymer",
|
|
30
|
+
version=_read_version(),
|
|
31
|
+
description=(
|
|
32
|
+
"LDPE polymerization reactor simulation (moments + chain-length "
|
|
33
|
+
"distribution) and reinforcement-learning operating-condition "
|
|
34
|
+
"optimisation."
|
|
35
|
+
),
|
|
36
|
+
long_description=long_description,
|
|
37
|
+
long_description_content_type="text/markdown",
|
|
38
|
+
author="sebygaa",
|
|
39
|
+
author_email="sebyga@gmail.com",
|
|
40
|
+
license="MIT",
|
|
41
|
+
url="https://github.com/sebygaa/polymer-reactor",
|
|
42
|
+
project_urls={
|
|
43
|
+
"Homepage": "https://github.com/sebygaa/polymer-reactor",
|
|
44
|
+
"Repository": "https://github.com/sebygaa/polymer-reactor",
|
|
45
|
+
"Issues": "https://github.com/sebygaa/polymer-reactor/issues",
|
|
46
|
+
},
|
|
47
|
+
keywords=[
|
|
48
|
+
"polymerization",
|
|
49
|
+
"reactor",
|
|
50
|
+
"LDPE",
|
|
51
|
+
"chemical-engineering",
|
|
52
|
+
"method-of-moments",
|
|
53
|
+
"chain-length-distribution",
|
|
54
|
+
"reinforcement-learning",
|
|
55
|
+
],
|
|
56
|
+
classifiers=[
|
|
57
|
+
"Development Status :: 4 - Beta",
|
|
58
|
+
"Intended Audience :: Science/Research",
|
|
59
|
+
"License :: OSI Approved :: MIT License",
|
|
60
|
+
"Programming Language :: Python :: 3",
|
|
61
|
+
"Programming Language :: Python :: 3.9",
|
|
62
|
+
"Programming Language :: Python :: 3.10",
|
|
63
|
+
"Programming Language :: Python :: 3.11",
|
|
64
|
+
"Programming Language :: Python :: 3.12",
|
|
65
|
+
"Topic :: Scientific/Engineering",
|
|
66
|
+
"Topic :: Scientific/Engineering :: Chemistry",
|
|
67
|
+
],
|
|
68
|
+
package_dir={"": "src"},
|
|
69
|
+
packages=find_packages(where="src"),
|
|
70
|
+
python_requires=">=3.9",
|
|
71
|
+
install_requires=[
|
|
72
|
+
"numpy>=1.21",
|
|
73
|
+
"scipy>=1.7",
|
|
74
|
+
],
|
|
75
|
+
extras_require={
|
|
76
|
+
"plot": ["matplotlib>=3.4"],
|
|
77
|
+
"dev": ["pytest>=7.0", "build>=1.0", "matplotlib>=3.4"],
|
|
78
|
+
},
|
|
79
|
+
entry_points={
|
|
80
|
+
"console_scripts": [
|
|
81
|
+
"pypolymer = pypolymer.reactor:main",
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
)
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"""pypolymer — LDPE polymerization reactor simulation & RL optimisation.
|
|
2
|
+
|
|
3
|
+
Public API
|
|
4
|
+
----------
|
|
5
|
+
Simulation
|
|
6
|
+
PolyRxn Batch / CSTR / PFR (method of moments) + a
|
|
7
|
+
chain-length-distribution (CLD) batch solver
|
|
8
|
+
(PolyRxn.run_batch_cld).
|
|
9
|
+
|
|
10
|
+
Reinforcement learning
|
|
11
|
+
run_pfr_rl LDPE PFR operating-condition optimisation.
|
|
12
|
+
run_batch_rl Batch operating-condition optimisation.
|
|
13
|
+
run_cstr_rl CSTR operating-condition optimisation.
|
|
14
|
+
GaussianMLP Gaussian-policy MLP used by the RL drivers.
|
|
15
|
+
compute_reward PFR multi-objective reward.
|
|
16
|
+
BATCH_TARGETS Batch reward target windows.
|
|
17
|
+
CSTR_TARGETS CSTR reward target windows.
|
|
18
|
+
run_pfr Fast standalone LDPE PFR simulator.
|
|
19
|
+
main Command-line entry point.
|
|
20
|
+
|
|
21
|
+
Examples
|
|
22
|
+
--------
|
|
23
|
+
>>> from pypolymer import PolyRxn
|
|
24
|
+
>>> rx = PolyRxn(kd=10.0, kp=2.0, ktc=1e-3, ktd=1e-3, ktrm=8e-3,
|
|
25
|
+
... ktrp=1e-3, kca=0.0, f=1.0, dH_p=-1.0e5, Mw_mono=28.05)
|
|
26
|
+
>>> out = rx.run_batch_cld(mono_0=180.0, ini_0=5e-2, t_end=20.0,
|
|
27
|
+
... dt=0.1, N_max=1400)
|
|
28
|
+
>>> round(out["PDI_final"], 2)
|
|
29
|
+
2.05
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
from .reactor import (
|
|
33
|
+
BATCH_TARGETS,
|
|
34
|
+
CSTR_TARGETS,
|
|
35
|
+
GaussianMLP,
|
|
36
|
+
PolyRxn,
|
|
37
|
+
__version__,
|
|
38
|
+
compute_reward,
|
|
39
|
+
main,
|
|
40
|
+
run_batch_rl,
|
|
41
|
+
run_cstr_rl,
|
|
42
|
+
run_pfr,
|
|
43
|
+
run_pfr_rl,
|
|
44
|
+
)
|
|
45
|
+
|
|
46
|
+
__all__ = [
|
|
47
|
+
"BATCH_TARGETS",
|
|
48
|
+
"CSTR_TARGETS",
|
|
49
|
+
"GaussianMLP",
|
|
50
|
+
"PolyRxn",
|
|
51
|
+
"__version__",
|
|
52
|
+
"compute_reward",
|
|
53
|
+
"main",
|
|
54
|
+
"run_batch_rl",
|
|
55
|
+
"run_cstr_rl",
|
|
56
|
+
"run_pfr",
|
|
57
|
+
"run_pfr_rl",
|
|
58
|
+
]
|