-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtwo_compartment_model_sweep_variable_size.py
More file actions
34 lines (27 loc) · 1.45 KB
/
two_compartment_model_sweep_variable_size.py
File metadata and controls
34 lines (27 loc) · 1.45 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
"""Runs a simulation for different values of S (compartment size), phi (symmetry) and alpha_n = -alpha_n."""
import numpy
from stem_cell_model import sweeper
from stem_cell_model.parameters import SimulationParameters
from stem_cell_model.two_compartment_model import run_simulation
def main(steps_along_alpha_and_phi_axis: int = 40, steps_along_S_axis: int = 60):
# Arguments
S_values = set((10 ** numpy.linspace(0, 3, num=steps_along_S_axis, endpoint=True)).astype(numpy.int32))
phi_values = numpy.linspace(0.025, 1, num=steps_along_alpha_and_phi_axis, endpoint=True)
alpha_n_values = numpy.linspace(0.025, 1, num=steps_along_alpha_and_phi_axis, endpoint=True)
T = (16.153070175438597, 3.2357834505600382) # Based on measured values
t_sim = int(1e5) # Total simulation time
output_folder = "two_comp_sweep_data_variable_S"
# Build all possible parameters
params_list = list()
for S in S_values:
for phi in phi_values:
for alpha_n in alpha_n_values:
params = SimulationParameters.for_S_alpha_and_phi(
S=S, alpha_n=alpha_n, alpha_m=-alpha_n, phi=phi, T=T, a=1/T[0])
if params is not None:
params_list.append(params)
# Go!
sweeper.sweep(run_simulation, params_list, t_sim=t_sim, output_folder=output_folder)
if __name__ == '__main__':
# Wrapping it like this is necessary to use the multiprocessing module in sweeper.sweep
main()