Skip to content

Commit 4071896

Browse files
committed
Added final notebooks requested by reviwers
1 parent 6a891b5 commit 4071896

7 files changed

+814
-3
lines changed

docs/example_models/tutorial_notebooks/.ipynb_checkpoints/10_Reaction_Rates-checkpoint.ipynb

+424
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cells": [],
3+
"metadata": {},
4+
"nbformat": 4,
5+
"nbformat_minor": 5
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"cells": [],
3+
"metadata": {},
4+
"nbformat": 4,
5+
"nbformat_minor": 5
6+
}

docs/example_models/tutorial_notebooks/10_Reaction_Rates.ipynb

+12-2
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,21 @@
398398
"S = Simulation(A_Count | A_Con | P)\n",
399399
"print(S.compile())"
400400
]
401+
},
402+
{
403+
"cell_type": "markdown",
404+
"id": "9e2f8527-25ef-42f3-b0da-7add0cc2e225",
405+
"metadata": {},
406+
"source": [
407+
"## Strings for Rates\n",
408+
"\n",
409+
"MobsPy allows rates to be supplied as string types. If a string is supplied as a rate, it will be taken as it is without any modifications. Therefore, string versions of numbers will not have mass-action kinetics applied to them and expressions will not be checked for correctness. "
410+
]
401411
}
402412
],
403413
"metadata": {
404414
"kernelspec": {
405-
"display_name": "venv",
415+
"display_name": "Python 3 (ipykernel)",
406416
"language": "python",
407417
"name": "python3"
408418
},
@@ -416,7 +426,7 @@
416426
"name": "python",
417427
"nbconvert_exporter": "python",
418428
"pygments_lexer": "ipython3",
419-
"version": "3.12.7"
429+
"version": "3.13.1"
420430
}
421431
},
422432
"nbformat": 4,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "86fb738a-7e02-4130-a660-1bfa90110cb3",
6+
"metadata": {},
7+
"source": [
8+
"## Reversible Reactions \n",
9+
"\n",
10+
"MobsPy has two available syntaxes for reversible reactions. Firstly, if a meta-reaction is defined with two rates instead of one, two meta-reactions will be defined. The direct sense with the first rate and the backwards sense with the second rate. \n",
11+
"\n",
12+
"Here is an example:"
13+
]
14+
},
15+
{
16+
"cell_type": "code",
17+
"execution_count": 1,
18+
"id": "408db175-d6e8-4fe1-9b47-32b2634fe85b",
19+
"metadata": {},
20+
"outputs": [
21+
{
22+
"name": "stdout",
23+
"output_type": "stream",
24+
"text": [
25+
"\n",
26+
"Species\n",
27+
"A,0\n",
28+
"\n",
29+
"Mappings\n",
30+
"A :\n",
31+
"A\n",
32+
"\n",
33+
"Parameters\n",
34+
"volume,1\n",
35+
"\n",
36+
"Reactions\n",
37+
"reaction_0,{'re': [(1, 'A')], 'pr': [], 'kin': '((2*(100-A))*A)'}\n",
38+
"reaction_1,{'re': [], 'pr': [(1, 'A')], 'kin': '1 * volume'}\n",
39+
"\n"
40+
]
41+
},
42+
{
43+
"name": "stderr",
44+
"output_type": "stream",
45+
"text": [
46+
"Compiling model\n"
47+
]
48+
}
49+
],
50+
"source": [
51+
"from mobspy import *\n",
52+
"\n",
53+
"A = BaseSpecies()\n",
54+
"\n",
55+
"A >> Zero [lambda r: 2*(100 - r)*r, 1]\n",
56+
"\n",
57+
"S = Simulation(A)\n",
58+
"print(S.compile())"
59+
]
60+
},
61+
{
62+
"cell_type": "markdown",
63+
"id": "55c92ce6-985a-463c-a4e7-18b62c8b5de6",
64+
"metadata": {},
65+
"source": [
66+
"The other reversible reaction notation uses the Rev operator and an example follows bellow "
67+
]
68+
},
69+
{
70+
"cell_type": "code",
71+
"execution_count": 2,
72+
"id": "a2f2bf5d-64c9-49e2-af7b-47849e25fd6e",
73+
"metadata": {},
74+
"outputs": [
75+
{
76+
"name": "stdout",
77+
"output_type": "stream",
78+
"text": [
79+
"\n",
80+
"Species\n",
81+
"A,0\n",
82+
"\n",
83+
"Mappings\n",
84+
"A :\n",
85+
"A\n",
86+
"\n",
87+
"Parameters\n",
88+
"volume,1\n",
89+
"\n",
90+
"Reactions\n",
91+
"reaction_0,{'re': [(1, 'A')], 'pr': [], 'kin': '((2*(100-A))*A)'}\n",
92+
"reaction_1,{'re': [], 'pr': [(1, 'A')], 'kin': '1 * volume'}\n",
93+
"\n"
94+
]
95+
},
96+
{
97+
"name": "stderr",
98+
"output_type": "stream",
99+
"text": [
100+
"Compiling model\n"
101+
]
102+
}
103+
],
104+
"source": [
105+
"from mobspy import *\n",
106+
"\n",
107+
"A = BaseSpecies()\n",
108+
"\n",
109+
"Rev[A >> Zero][lambda r: 2*(100 - r)*r, 1]\n",
110+
"\n",
111+
"S = Simulation(A)\n",
112+
"print(S.compile())"
113+
]
114+
},
115+
{
116+
"cell_type": "code",
117+
"execution_count": null,
118+
"id": "4d097916-bf4c-4d26-8d2c-464ca7bb12ce",
119+
"metadata": {},
120+
"outputs": [],
121+
"source": []
122+
}
123+
],
124+
"metadata": {
125+
"kernelspec": {
126+
"display_name": "Python 3 (ipykernel)",
127+
"language": "python",
128+
"name": "python3"
129+
},
130+
"language_info": {
131+
"codemirror_mode": {
132+
"name": "ipython",
133+
"version": 3
134+
},
135+
"file_extension": ".py",
136+
"mimetype": "text/x-python",
137+
"name": "python",
138+
"nbconvert_exporter": "python",
139+
"pygments_lexer": "ipython3",
140+
"version": "3.13.1"
141+
}
142+
},
143+
"nbformat": 4,
144+
"nbformat_minor": 5
145+
}

docs/example_models/tutorial_notebooks/19_Plot_Configuration.ipynb

+221
Large diffs are not rendered by default.

for_local_use.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,3 @@
44
if __name__ == '__main__':
55

66
pass
7-

0 commit comments

Comments
 (0)