mxlmodels 1.0.0__py3-none-any.whl

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.
mxlmodels/pop_dyn.py ADDED
@@ -0,0 +1,69 @@
1
+ """Two-species population dynamics: E. coli and C. glutamicum with fixed affinities."""
2
+
3
+ from mxlpy import Model
4
+
5
+
6
+ def _d_edt(
7
+ mu_e: float,
8
+ a_e: float,
9
+ e_coli: float,
10
+ ) -> float:
11
+ """Net growth rate of E. coli: affinity * population * growth rate."""
12
+ return a_e * e_coli * mu_e
13
+
14
+
15
+ def _d_cdt(
16
+ mu_c: float,
17
+ a_c: float,
18
+ c_gluta: float,
19
+ theta: float,
20
+ ) -> float:
21
+ """Net growth rate of C. glutamicum minus density-dependent death."""
22
+ return a_c * c_gluta * mu_c - c_gluta**2.0 * theta
23
+
24
+
25
+ def create_model() -> Model:
26
+ """Build the two-species population dynamics model (E. coli / C. glutamicum)."""
27
+ return (
28
+ Model()
29
+ .add_variable(
30
+ "e_coli",
31
+ initial_value=5.0,
32
+ )
33
+ .add_variable(
34
+ "c_gluta",
35
+ initial_value=5.0,
36
+ )
37
+ .add_parameter(
38
+ "mu_e",
39
+ value=0.4,
40
+ )
41
+ .add_parameter(
42
+ "mu_c",
43
+ value=0.3,
44
+ )
45
+ .add_parameter(
46
+ "a_e",
47
+ value=6.0,
48
+ )
49
+ .add_parameter(
50
+ "a_c",
51
+ value=4.0,
52
+ )
53
+ .add_parameter(
54
+ "theta",
55
+ value=0.001,
56
+ )
57
+ .add_reaction(
58
+ "dEdt",
59
+ fn=_d_edt,
60
+ args=["mu_e", "a_e", "e_coli"],
61
+ stoichiometry={"e_coli": 1.0},
62
+ )
63
+ .add_reaction(
64
+ "dCdt",
65
+ fn=_d_cdt,
66
+ args=["mu_c", "a_c", "c_gluta", "theta"],
67
+ stoichiometry={"c_gluta": 1.0},
68
+ )
69
+ )
mxlmodels/py.typed ADDED
File without changes