-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransmembrane_gaussian_varying_membrane_conduct.py
78 lines (55 loc) · 3.84 KB
/
transmembrane_gaussian_varying_membrane_conduct.py
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
from transmembrane_lib import *
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import minimize,basinhopping
import dill
from pytexit import py2tex
import pickle
import os
FWHM = 0.5e-7
t0 = 0
tstop = FWHM*8
dt = 0.005e-8
t = np.linspace(t0, tstop, int(tstop/dt))
def normalized_gaussian_pulse(t,fwhm):
sigma = fwhm/2.355
return np.exp(-((t**2.0)/(2.0*(sigma**2.0))))
input = np.zeros_like(t)
ideal_values = normalized_gaussian_pulse(t-tstop/2.0,FWHM)
host_cell = Cell(np.float128(0.3), np.float128(80), np.float128(0.3), np.float128(80), np.float128(1e-7), np.float128(5), np.float128(20e-6), np.float128(5e-9), t)
virus = Cell(np.float128(0.3), np.float128(80), np.float128(0.005), np.float128(30), np.float128(1e-8), np.float128(60), np.float128(50e-9), np.float128(14e-9),t)
host_cell_permeabilized = Cell(np.float128(0.3), np.float128(80), np.float128(0.3), np.float128(80), np.float128(1e-7 + 0.2), np.float128(5), np.float128(20e-6), np.float128(5e-9), t)
virus_permeabilized = Cell(np.float128(0.3), np.float128(80), np.float128(0.005), np.float128(30), np.float128(1e-8 + 0.2), np.float128(60), np.float128(50e-9), np.float128(14e-9),t)
plt.style.use('grayscale')
# plt.plot(t/1e-9, ideal_values, linestyle="solid", label="Input values")
host_output = convolve_output(ideal_values, host_cell, dt) * 0.1e6
virus_output = convolve_output(ideal_values, virus, dt) * 1e7
host_ep_output = convolve_output(ideal_values, host_cell_permeabilized, dt) * 1e7
virus_ep_output = convolve_output(ideal_values, virus_permeabilized, dt) * 1e7
plt.plot(t/1e-9, host_output, linestyle="solid", label="Intact host cell scaled 1/100 ($\sigma_{membrane} = 10^-7$)")
plt.plot(t/1e-9, virus_output, linestyle="solid", label="Intact virus ($\sigma_{membrane} = 10^-8$)")
plt.plot(t/1e-9, host_ep_output, linestyle="dashdot", label="Host cell w/ pores ($\sigma_{membrane} = 10^-7 + 0.2$)")
plt.plot(t/1e-9, virus_ep_output, linestyle="dotted", label="Virus w/ pores ($\sigma_{membrane} = 10^-8 + 0.2$)")
plt.xlabel("Time (nanoseconds)\nY axis: 1 V/m input waveform, membrane $\Delta$V scaled by $10^7$")
plt.legend()
plt.savefig("plots/pre_coefficient_switchover.svg")
plt.clf()
host_cell = Cell(np.float128(0.3), np.float128(80), np.float128(0.3), np.float128(80), np.float128(1e-7), np.float128(5), np.float128(20e-6), np.float128(5e-9), t)
virus = Cell(np.float128(0.3), np.float128(80), np.float128(0.005), np.float128(30), np.float128(1e-8), np.float128(60), np.float128(50e-9), np.float128(5e-9),t)
host_cell_permeabilized = Cell(np.float128(0.3), np.float128(80), np.float128(0.3), np.float128(80), np.float128(1e-7 + 0.2), np.float128(5), np.float128(20e-6), np.float128(5e-9), t)
virus_permeabilized = Cell(np.float128(0.3), np.float128(80), np.float128(0.005), np.float128(30), np.float128(1e-8 + 0.2), np.float128(60), np.float128(50e-9), np.float128(5e-9),t)
plt.style.use('grayscale')
# plt.plot(t/1e-9, ideal_values, linestyle="solid", label="Input values")
host_output = convolve_output(ideal_values, host_cell, dt) * 0.1e6
virus_output = convolve_output(ideal_values, virus, dt) * 1e7
host_ep_output = convolve_output(ideal_values, host_cell_permeabilized, dt) * 1e7
virus_ep_output = convolve_output(ideal_values, virus_permeabilized, dt) * 1e7
plt.plot(t/1e-9, host_output, linestyle="solid", label="Intact host cell scaled 1/100 ($\sigma_{membrane} = 10^-7$)")
plt.plot(t/1e-9, virus_output, linestyle="solid", label="Intact virus ($\sigma_{membrane} = 10^-8$)")
plt.plot(t/1e-9, host_ep_output, linestyle="dashdot", label="Host cell w/ pores ($\sigma_{membrane} = 10^-7 + 0.2$)")
plt.plot(t/1e-9, virus_ep_output, linestyle="dotted", label="Virus w/ pores ($\sigma_{membrane} = 10^-8 + 0.2$)")
plt.xlabel("Time (nanoseconds)\nY axis: 1 V/m input waveform, membrane $\Delta$V scaled by $10^7$")
plt.legend()
plt.savefig("plots/post_coefficient_switchover.svg")
plt.show()
#