-
Notifications
You must be signed in to change notification settings - Fork 61
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
Flaws in the diffusion process #2145
Comments
Hi @jlubo, thanks for reporting. I sadly cannot run the example on current master for two reasons:
Could try this with current master, potentially the area calculation is off. That might be also causing issue 2. For the negative values, as far as I understand the issue, this can only happen if a mechanism directly accesses As for the conservation issues: I cannot extract the injected values from the plots. In the second, the deviations seem |
I've compiled an updated version of the example that is run with the newer master version 235b291. In the discretized (3 CVs per dendrite) case above, the normalization was not correct - my bad! The dendrite volume and area in that case had to be divided by the number of CVs. I've now run the simulation again, for three different discretizations (the soma always only has 1 CV):
The injected/removed amount of particles now - with the correct normalization - matches the expectation in all cases (as shown in the plots below). I've now added scales to the plots to indicate these changes in the amount of particles. Please note that the sum (black dashed line) is not supposed to match the red line, it's just by incident in the same plot. I would expect the sum to look like this: Here are the new results: 1 CV per dendrite ( 3 CVs per dendrite ( 1000 CVs per dendrite ( The issues mentioned above still seem unresolved. Regarding the constant number of particles (point 1), the sum in the plot still does not match the expectation. I was wondering if this would be different for finer discretization (for which I haven't computed the sum yet), but from looking at the third figure it doesn't seem to be the case. Regarding point 2, the discretization still has an (undesired) impact on the equilibrium concentration. Regarding the negative concentrations (point 3), I guess we might leave this here because it may be left to the user to ensure that not too high an amount of particles is removed. It's also good to note that negative (relative) concentrations may be desirable in some cases, as mentioned by @thorstenhater. I'm wondering what we can conclude for points 1 & 2 from the results now. High resolution (1000 CVs per dendrite) apparently doesn't solve the issues. I guess something might be wrong with the diffusion across CVs. Especially, I'm wondering why the sum does not match the expectation, and why in the 1000 CVs case the protein concentration converges more slowly. |
I've just updated the code in the previous post following our offline discussion today (the issue remains, though):
|
Here is a little update on the "diffusion confusion", following joint efforts by @thorstenhater, @Shirin1993, and me to nail down the issue. To emphasize the main issue again: the total amount of particles is in some cases not conserved. Meanwhile, we have found that at the connection between segments, erroneous adding or removal of particles can occur. This does not seem to happen between segments of the same radius (case a), and neither for diffusion across the CVs of a single segment, but between segments of different radius (case b). The results below demonstrate the apparent behavior (here is the example code to generate them, tested with the brand new release v0.9.0). For both the case with two segments (i.e., one branch) and three segments (i.e., three branches), there is no issue if the radii are equal (a). But if the radii are different, issues occur (b) In the plots, a) Same radius
b) Different radius
I hope that this documents the whole issue for the moment. As a next step, I want to create a PR with a unit test for the diffusion process. And hopefully soon, we can get the whole thing fixed. Further notes
|
Hi @jlubo a few questions
Which one? Also, some kind of legend in the plots/explanations would be appreciated.
From your plots in the 'different radius' section I'd suspect After thinking about what I found before the holidays, my current hypothesis is that we need to scale |
Hi @thorstenhater! 1.Regarding the code where the segments are set, I meant this:
Maybe that would be another issue, though. 2.For the legend, I've added a description in the previous post above the plots. 3.It's right, the concentration becomes negative in the case with 3 segments. 4.
I agree, that sounds like a possible solution. Especially, smoothing the transition between different radii (see red line in the sketch below) could be useful, as we've discussed offline. |
Re 1: What does 'doesn't work mean'? Gives an error? p = tree.append(p, (0,0,0,1), (0,0,1,1), 1)
p = tree.append(p, (0,0,1,1), (0,0,2,1), 1) is the same as p = tree.append(p, (0,0,0,1), (0,0,1,1), 1)
p = tree.append(p, (0,0,1000,1), (0,0,1001,1), 1) |
That's what I thought, too. But the second setting (the commented one) does not yield the correct results even with equal radii of the segments. |
About the coordinates issue:
Whereas
So, I wouldn't be too surprised about different results. |
Absolutely right, thanks for redoing the simple math 🙈 Using
yields just the expected result. |
…pointing to the fact that the diffusion across segments of different radius is still erroneous; see arbor-sim#2145)
I have just created PR #2209, which basically adds the tests that are shown in the most recent plots here in this issue. |
…pointing to the fact that the diffusion across segments of different radius is still erroneous; see arbor-sim#2145)
…pointing to the fact that the diffusion across segments of different radius is still erroneous; see arbor-sim#2145)
There seem to be several flaws in the diffusion process (cf. the requirements here):
These points can be demonstrated with the attached example (tested with master version d1139b7).
Point 1 is shown in the figures below by the dashed line termed "sum", which is the sum over the concentrations of all compartments weighted by their volume. The sum should exhibit a discontinuous increase upon each particle injection (or decrease upon each removal) and otherwise stay constant. Its final value should be 1500, because of twice an injection of 1000 particles and once a removal of 500 particles. The outcome does not match this assumption.
Point 2 can be seen from comparing the two figures below. For the first figure, the two dendrites each consisted of 3 compartments (CVs). For the second figure, no such fine discretization was used and each dendrite as well as the soma consisted of one compartment only. The final values of the concentrations do not match, which is opposed to the expectation.
Point 3 should become obvious from the top right plot in both figures.
The text was updated successfully, but these errors were encountered: