Team:iBowu-China/Model equilibrium.py

Sticky Animated Navigation Bar

equilibrium.py

import numpy as np

import matplotlib.pyplot as plt

from mpl_toolkits.mplot3d import Axes3D

def model(N, A):

mr = 0.161 * 0.784 * N / 2.657

pr = 0.36 * mr / 2.658

mb = (1.13E-16 + 5.269 * 0.784 * N * (0.696 * A * pr)**2 / (1 + (0.696 * A * pr)**2)) / 0.231

pb = 2.297 * mb / 0.181

return pb

x_new = np.arange(0, 35, 1)

y_new = np.arange(0, 50, 0.01)

x_new, y_new = np.meshgrid(x_new, y_new)

z_new = np.zeros_like(x_new)

for i in range(x_new.shape[1]):

for j in range(y_new.shape[0]):

z_new[j, i] = model(x_new[0, i], y_new[j, 0])

fig = plt.figure()

ax = fig.add_subplot(111, projection='3d')

ax.plot_surface(x_new, y_new, z_new, cmap='rainbow', label = "simulated distribution")

ax.set_xlabel("DNA($ng/uL)$")

ax.set_ylabel("AHL($nM$)")

ax.set_zlabel("GFP($ng/ul$)")

ax.grid(False)

plt.show()