-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dilawar Singh
committed
Nov 15, 2021
1 parent
488481b
commit f0d54c8
Showing
8 changed files
with
108 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,12 +13,12 @@ | |
__author__ = "Dilawar Singh" | ||
__email__ = "[email protected]" | ||
|
||
import smoldyn | ||
import smoldyn | ||
|
||
# Model parameters | ||
K_FWD = 0.001 # substrate-enzyme association reaction rate | ||
K_BACK = 1 # complex dissociation reaction rate | ||
K_PROD = 1 # complex reaction rate to product | ||
K_FWD = 0.001 # substrate-enzyme association reaction rate | ||
K_BACK = 1 # complex dissociation reaction rate | ||
K_PROD = 1 # complex reaction rate to product | ||
|
||
# Simulation starts with declaring a Simulation object with the system boundaries. | ||
s = smoldyn.Simulation(low=[-1, -1], high=[1, 1]) | ||
|
@@ -36,30 +36,35 @@ | |
# as well. Here, `all` molecules reflect at both surface faces. | ||
sph1 = smoldyn.Sphere(center=(0, 0), radius=1, slices=50) | ||
membrane = s.addSurface("membrane", panels=[sph1]) | ||
membrane.setAction('both', [S, E, P, ES], "reflect") | ||
membrane.setStyle('both', color="black", thickness=1) | ||
membrane.setAction("both", [S, E, P, ES], "reflect") | ||
membrane.setStyle("both", color="black", thickness=1) | ||
|
||
# Define a compartment, which is region inside the 'membrane' surface. | ||
inside = s.addCompartment(name="inside", surface=membrane, point=[0, 0]) | ||
|
||
# Chemical reactions. Here, E + S <-> ES -> P | ||
r1 = s.addBidirectionalReaction( | ||
"r1", subs=[(E,"front"), (S,"bsoln")], prds=[(ES,"front")], kf=K_FWD, kb=K_BACK) | ||
"r1", subs=[(E, "front"), (S, "bsoln")], prds=[(ES, "front")], kf=K_FWD, kb=K_BACK | ||
) | ||
r1.reverse.productPlacement("pgemmax", 0.2) | ||
|
||
r2 = s.addReaction( | ||
"r2", subs=[(ES, "front")], prds=[(E, "front"), (P, "bsoln")], rate=K_PROD) | ||
"r2", subs=[(ES, "front")], prds=[(E, "front"), (P, "bsoln")], rate=K_PROD | ||
) | ||
|
||
# Place molecules for initial condition | ||
inside.addMolecules(S, 500) | ||
membrane.addMolecules((E, "front"), 100) | ||
|
||
# Output and other run-time commands | ||
s.setOutputFile('templateout.txt', True) | ||
s.setOutputFile("templateout.txt", True) | ||
s.addCommand("molcountheader templateout.txt", "B") | ||
s.addCommand("molcount templateout.txt", "N", step=10) | ||
|
||
s.setGraphics( | ||
"opengl_good", bg_color="white", frame_thickness=1, | ||
text_display=["time", S, (E, "front"), (ES, "front"), P] ) | ||
"opengl_good", | ||
bg_color="white", | ||
frame_thickness=1, | ||
text_display=["time", S, (E, "front"), (ES, "front"), P], | ||
) | ||
s = s.run(stop=10, dt=0.01) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.