Search found 41 matches

by adamjhn
Thu Oct 03, 2019 3:21 pm
Forum: Reaction-diffusion in NEURON
Topic: NEURON 7.7.1 RxD issue
Replies: 2
Views: 1337

Re: NEURON 7.7.1 RxD issue

Thanks for getting in touch, this is a bug where the reaction tries to find rate strings for all regions the species are defined on rather than the just the region specified in the constructor. A fix has just been pushed to the github; https://github.com/neuronsimulator/nrn Alternatively, a possible...
by adamjhn
Tue Aug 27, 2019 11:48 am
Forum: Reaction-diffusion in NEURON
Topic: Using setpointer() and RXD concentrations
Replies: 1
Views: 974

Re: Using setpointer() and RXD concentrations

The rxd Species, State and Parameter can be accessed in density mechanisms by their name. For example in the extracellular diffusion example ; The species has name='k', charge=1 which is accessed in steady_k.mod with USEION k WRITE ik CHARGE 1 Note the names have to match and the charge must equal t...
by adamjhn
Wed Aug 21, 2019 4:43 pm
Forum: Reaction-diffusion in NEURON
Topic: Using include_flux() properly
Replies: 1
Views: 2620

Re: Using include_flux() properly

Thanks for bringing this oversight to our attention; support for node.include_flux was accidentally broken with the release of NEURON 7.7. (It works in 7.6.x). This will be remedied in 7.7.3. In the meantime it is possible to achieve the outcome of include flux using a Parameter and a Rate. For exam...
by adamjhn
Thu Aug 15, 2019 5:25 pm
Forum: Reaction-diffusion in NEURON
Topic: Parameter and MultiCompartmentReaction Error
Replies: 1
Views: 783

Re: Parameter and MultiCompartmentReaction Error

Thanks for letting us know about this bug, it will be fixed in the next release. As you have identified, one workaround is to use a float instead of a Parameter. Alternatively, like the calcium wave example , you could define the Parameter on the membrane instead of the cytosol; g_ip3r = rxd.Paramet...
by adamjhn
Wed Aug 14, 2019 11:26 am
Forum: Reaction-diffusion in NEURON
Topic: Modelling a channel with multiple markov states
Replies: 7
Views: 1769

Re: Modelling a channel with multiple markov states

I think the problem is O is a rxd.State. To access the values of a state (or species) you can use the nodes. E.g. If you have defined nodes on a section called ‘dend’ then; O.nodes(dend(0.5)).value Will give you the value of O at the current time in the simulation, in the middle of ‘dend’. To record...
by adamjhn
Wed Aug 14, 2019 10:25 am
Forum: Reaction-diffusion in NEURON
Topic: decay reactions
Replies: 1
Views: 719

Re: decay reactions

Thanks for bringing this bug to our attention, it will be fixed in the next release. In the meantime a reaction with no products can be implemented with rxd.Rate. For example;

Code: Select all

reaction_decay = rxd.Rate(Ca, -1e-8*Ca)
by adamjhn
Thu Aug 01, 2019 5:17 pm
Forum: Reaction-diffusion in NEURON
Topic: Altering Total Concentration During a Simulation
Replies: 2
Views: 1030

Re: Altering Total Concentration During a Simulation

You can change the concentrations via the rxd nodes. If you use variable step you must call h.CVode().re_init() after changing the values. For example; from neuron import h, rxd from neuron.units import μM, mV, ms from matplotlib import pyplot h.load_file('stdrun.hoc') # define a very simple rxd mod...
by adamjhn
Mon Jul 08, 2019 10:35 am
Forum: Reaction-diffusion in NEURON
Topic: basic questions on RxD
Replies: 7
Views: 4073

Re: basic questions on RxD

The parameters used in the tutorial are python floats, NEURON does not assign them any particular units. This makes the example somewhat opaque and is part of the reason why in NEURON 7.7 the units modules was introduced. In this specific example you can infer that kserca must have units μM as ca[cy...
by adamjhn
Mon Jul 08, 2019 12:44 am
Forum: Reaction-diffusion in NEURON
Topic: Modelling a channel with multiple markov states
Replies: 7
Views: 1769

Re: Modelling a channel with multiple markov states

I think the problem is with the Python namespace. When you create your first rate "C1 = rxd.Rate(C1, ... " it overwrites the C1 state you defined earlier, so when you come to use it in "O = rxd.Rate(O, ((ko*C1 ...", the C1 here now refers to a Rate not a State. The solution is to use a different var...
by adamjhn
Sat Jul 06, 2019 2:21 pm
Forum: Reaction-diffusion in NEURON
Topic: basic questions on RxD
Replies: 7
Views: 4073

Re: basic questions on RxD

Sorry, of course you still need to define it on both the cyt and the er;

Code: Select all

from neuron.units import nM, uM
ca = rxd.Species([cyt, er], name='ca', charge=2, initial=lambda nd: 100 * nM if nd.region == cyt else 70 * uM)
by adamjhn
Sat Jul 06, 2019 10:38 am
Forum: Reaction-diffusion in NEURON
Topic: basic questions on RxD
Replies: 7
Views: 4073

Re: basic questions on RxD

The initial keyword can take a function with a rxd node as an argument. This allows initial concentrations to depended on the location and region. Some examples are here; https://neuron.yale.edu/neuron/docs/initialization-strategies In your case, I think you want to define calcium like this; from ne...
by adamjhn
Mon Mar 18, 2019 11:24 am
Forum: Reaction-diffusion in NEURON
Topic: Reactions only when concentration above a certain limit?
Replies: 1
Views: 2323

Re: Reactions only when concentration above a certain limit?

The formulas for rxd.Rate, etc need to be continuous, but you can approximate a threshold function using a sigmoidal shaped curve. For example, you can use rxdmath.tanh to remove calcium at a constant rate when it exceeds a threshold with a narrow transition period: from neuron import h, rxd from ne...
by adamjhn
Mon Feb 18, 2019 4:30 pm
Forum: Reaction-diffusion in NEURON
Topic: diffusion intracellular->extracellular->intracellular
Replies: 7
Views: 2276

Re: diffusion intracellular->extracellular->intracellular

1) The following function will return the location of a segment e.g. 'cell1(0.5)', adapted from rxd.species._xyz; def xyz(seg): """Return the (x, y, z) coordinate of the center of the segment.""" sec = seg.sec n3d = sec.n3d() x3d = [sec.x3d(i) for i in range(n3d)] y3d = [sec.y3d(i) for i in range(n3...
by adamjhn
Sun Feb 10, 2019 1:24 pm
Forum: Reaction-diffusion in NEURON
Topic: diffusion intracellular->extracellular->intracellular
Replies: 7
Views: 2276

Re: diffusion intracellular->extracellular->intracellular

Thanks for reporting this bug, a fix has been pushed to the development branch. Currently the easiest way to do this is with mod files describing pump mechanism. The production, diffusion and accumulation are then handled by rxd. For example; from neuron import h, crxd as rxd from matplotlib import ...
by adamjhn
Mon Feb 04, 2019 3:05 pm
Forum: Reaction-diffusion in NEURON
Topic: Unexpected 3D behaviour
Replies: 2
Views: 1449

Re: Unexpected 3D behaviour

This is due to a bug in reactions in 3D rxd. Thank you for identifying it. We have a fix for it, you can clone https://github.com/neuronsimulator/nrn/tree/7.6 and build from source. Alternatively replace your <neuron python library dir>/neuron/rxd/species.py with https://raw.githubusercontent.com/ne...