-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_rate_function.py
More file actions
62 lines (42 loc) · 1.6 KB
/
test_rate_function.py
File metadata and controls
62 lines (42 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
"""Test in order to check the exponent in Mobspy"""
# from test_exponent_model import Model, InitialQuantities
from mobspy import u, BaseSpecies, Simulation
def test_rate_function_right_multiplication():
def get_model():
default_rate = 3e-11 / u.min
def antibio_uptake_senders(a):
rate = default_rate * a
return rate
A = BaseSpecies()
A(1000 * u.counts / u.mL)
A >> 2 * A[antibio_uptake_senders]
return Simulation(A)
S = get_model()
S.run(duration=1222 * u.min, unit_x=u.min, unit_y=u.counts / u.mL, plot_data=False)
def test_rate_function_inside_multiplication():
def get_model():
def antibio_uptake_senders(a):
rate = (3e-11 / u.min) * a
return rate
A = BaseSpecies()
A(1000 * u.counts / u.mL)
A >> 2 * A[antibio_uptake_senders]
return Simulation(A)
S = get_model()
S.run(duration=1222 * u.min, unit_x=u.min, unit_y=u.counts / u.mL, plot_data=False)
def test_rate_function_left_multiplication():
def get_model():
default_rate = 3e-11 / u.min
def antibio_uptake_senders(a):
rate = a * default_rate
return rate
A = BaseSpecies()
A(1000 * u.counts / u.mL)
A >> 2 * A[antibio_uptake_senders]
return Simulation(A)
S = get_model()
S.run(duration=1222 * u.min, unit_x=u.min, unit_y=u.counts / u.mL, plot_data=False)
if __name__ == "__main__":
test_rate_function_right_multiplication()
test_rate_function_inside_multiplication()
test_rate_function_left_multiplication()