Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dissociation of membrane sp into two volume sp fails #292

Open
wxchew opened this issue Aug 28, 2018 · 6 comments
Open

Dissociation of membrane sp into two volume sp fails #292

wxchew opened this issue Aug 28, 2018 · 6 comments
Assignees
Milestone

Comments

@wxchew
Copy link

wxchew commented Aug 28, 2018

%matplotlib inline
from ecell4 import *
L=2
rv=0.01
D=1
h=0.5*L
h0=0
h1=h

with species_attributes():
A | B | {'radius':str(rv),"D": str(D), "location": "M"}
C | {'radius':str(rv),'D': str(D)}
with reaction_rules():
C > A+B | 10 #rule1
C > B | 10 #rule2

m = get_model()
w = spatiocyte.SpatiocyteWorld(Real3(L,h,L),rv)
w.bind_to(m)
upper = Real3(0,h1-2*rv,0)
lower = Real3(0,h0,0)
unit0 = Real3(0,0,L)
unit1 = Real3(L,0,0)
w.add_structure(Species("M"),PlanarSurface(upper,unit0,unit1))
w.add_structure(Species("W"),PlanarSurface(lower,unit0,unit1))
w.add_molecules(Species("C"),100)
sim = spatiocyte.SpatiocyteSimulator(w)
dt=50
duration=0.3
obs1 = FixedIntervalNumberObserver(duration/dt, ['C'])
sim.run(duration, obs1)
viz.plot_number_observer(obs1)

@wxchew
Copy link
Author

wxchew commented Aug 28, 2018

rule2 in reaction rules() works, but rule1 fail.

@wxchew
Copy link
Author

wxchew commented Aug 28, 2018

is this expected behavior?

@wxchew
Copy link
Author

wxchew commented Aug 28, 2018

fail means fail to dissociate

@kaizu
Copy link
Member

kaizu commented Aug 28, 2018

This looks due to the locations. C + M > A + B should work. However, an unit of the rate constant is different.

with reaction_rules():
    C + M > B | 10.0  # correct
    C > B | 10.0  # wrong

@kaizu
Copy link
Member

kaizu commented Aug 28, 2018

The original problem mentioned here is

with species_attributes():
    A | B | {'radius':str(rv),"D": str(D)}
    C | {'radius':str(rv),'D': str(D), "location": "M"}

with reaction_rules():
    C > A+B | 10 #rule1

This doesn't work because the first order reaction with two products both on the different structure is not supported yet. See the following.

https://github.com/ecell/ecell4/blob/master/ecell4/spatiocyte/SpatiocyteReactions.cpp#L112-L116

One way to do this now is to place an intermediate state.

with reaction_rules():
    C > AB | 10 > A + B | 1e+20  # AB is at the same location with A or B

@kaizu
Copy link
Member

kaizu commented Aug 28, 2018

Or

with species_attributes():
    A | B | {'radius':rv,"D": D}
    C | X | {'radius':rv,'D': D, "location": "M"}

with reaction_rules():
    C > X + A | 10
    X > B | 1e+20

@kaizu kaizu added this to the nice to have milestone Aug 28, 2018
@kaizu kaizu changed the title dissociation of membrane sp into two volume sp fail Dissociation of membrane sp into two volume sp fails Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants