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

The change in capacitance takes effect only at the branch(0), when len(parents) >1. #429

Closed
Tunenip opened this issue Sep 21, 2024 · 2 comments · Fixed by #426
Closed

The change in capacitance takes effect only at the branch(0), when len(parents) >1. #429

Tunenip opened this issue Sep 21, 2024 · 2 comments · Fixed by #426

Comments

@Tunenip
Copy link

Tunenip commented Sep 21, 2024

The following codes will show the same result when giving a step current to branch(0):
A:
branch = jx.Branch(comp, nseg=1)
cell = jx.Cell(branch, parents=[-1,0])
cell.branch(1).set('capacitance',1)
B:
branch = jx.Branch(comp, nseg=1)
cell = jx.Cell(branch, parents=[-1,0])
cell.branch(1).set('capacitance',200)

@Tunenip
Copy link
Author

Tunenip commented Sep 21, 2024

Even though the cell.show() shows the different values.

@michaeldeistler
Copy link
Contributor

Thanks for reporting this! I just released a new version of jaxley that fixes this issue. Please run
pip install jaxley --upgrade.

The following should work then:

import matplotlib.pyplot as plt

import jaxley as jx
from jaxley.channels import Leak

comp = jx.Compartment()
current = jx.step_current(1, 1, 0.1, 0.025, 5.0)

branch = jx.Branch(comp, nseg=1)
cell = jx.Cell(branch, parents=[-1,0])
cell.branch(1).set("capacitance", 1)
cell.branch(0).stimulate(current)
cell.branch(1).record()
v1 = jx.integrate(cell)

branch = jx.Branch(comp, nseg=1)
cell = jx.Cell(branch, parents=[-1,0])
cell.branch(1).set("capacitance", 200)
cell.branch(0).stimulate(current)
cell.branch(1).record()
v2 = jx.integrate(cell)

fig, ax = plt.subplots(1, 1, figsize=(4, 2))
_ = ax.plot(v1.T)
_ = ax.plot(v2.T)

Thanks again for letting us know, and feel free to reopen the issue if anything is still unclear or behaves in an unexpected way!

All the best
Michael

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants