Skip to content
Merged
Show file tree
Hide file tree
Changes from 172 commits
Commits
Show all changes
195 commits
Select commit Hold shift + click to select a range
1983a75
Add the astrocyte model from HBP codejam 2019 and rebase it on latest…
May 6, 2021
7984a27
Add an example showing how to create a network with astrocytes
May 12, 2021
af4d51a
Add option for the astrocyte network example
HanjiaJiang Jun 6, 2021
642ea64
Create BernoulliAstroBuilder
HanjiaJiang Feb 8, 2022
5617e21
Bring out astrocytes as NodeCollectionPTR in source code
HanjiaJiang Feb 14, 2022
4b9e169
A preliminary success of implementing three-party connections in Bern…
HanjiaJiang Feb 15, 2022
cafdb40
Start adding syn_spec parameters for sic_connection
HanjiaJiang Feb 18, 2022
b60d2a0
Complete a preliminary version of BernoulliAstroBuilder, add astrocyt…
HanjiaJiang Feb 18, 2022
d4152a2
Fix after rebasing
HanjiaJiang Feb 26, 2022
0f127d7
BernoulliAstroBuilder evenly distributes target neurons to astrocytes…
HanjiaJiang Feb 28, 2022
fe0fbe8
added example script to test MPI compatibility of astro connect.
jstapmanns Mar 18, 2022
8763c3d
Avoid cases of multiple astrocytes sharing 1 synapse; avoid cases of …
HanjiaJiang Mar 4, 2022
59ddcb7
"p_astro" in conn_spec is now the probability for "neuron connections…
HanjiaJiang Apr 1, 2022
f6d3516
implemented BernoulliAstro by adapting SymmetricBernoulli.
jstapmanns May 16, 2022
e8f1651
Add n_neighbor_astrocytes parameter to conn_spec; remove some useless…
HanjiaJiang Jun 8, 2022
787ca11
Fix after rebase
HanjiaJiang Jul 12, 2022
9ac8a82
Change parameter name from "n_neighbor_astrocytes" to "max_astro_per_…
HanjiaJiang Jul 12, 2022
12896ad
Add parameter "astro_pool_per_target_det" in conn_spec.
HanjiaJiang Jul 22, 2022
60e752f
Improve the design with the parameter "astro_pool_per_target_det".
HanjiaJiang Jul 28, 2022
e3ea476
Improve designs in BernoulliAstroBuilder. Particularly (A) astro_pool…
HanjiaJiang Sep 23, 2022
7a8ad68
Improve the rule for "shifting" starting astrocyte, regarding even nu…
HanjiaJiang Oct 1, 2022
46791cf
Put SICEvent back after rebasing
HanjiaJiang Oct 22, 2022
13b38fa
Change astro to astrocyte
HanjiaJiang Oct 28, 2022
5d0a62c
Rename some variables in BernoulliAstroBuilder
HanjiaJiang Oct 28, 2022
ddff821
Change back to real Bernoulli trial for neuron-neuron connections
HanjiaJiang Oct 29, 2022
1fe2ae7
Add user warnings
HanjiaJiang Oct 29, 2022
86e6c73
Tidy up some comments
HanjiaJiang Nov 18, 2022
acf73ec
Switch back to "indegree" version for neuron-neuron Bernoulli connect…
HanjiaJiang Nov 18, 2022
68dd6a8
Fix compiler warnings on astrocyte.h and astrocyte.cpp
HanjiaJiang Nov 18, 2022
357073a
Update 2 user examples: astrocyte_connect.py and astrocyte_network.py
HanjiaJiang Nov 19, 2022
72b9830
Start to implement Brunel networks with astrocytes
HanjiaJiang Dec 4, 2022
9959a32
Add tsodyks_synapse and astrocytes to astrocyte_brunel.py
HanjiaJiang Dec 8, 2022
df58096
Improve astrocyte_brunel.py in a modular manner
HanjiaJiang Dec 23, 2022
a89e10a
Fix mistakes in the last commit
HanjiaJiang Dec 23, 2022
a504c88
Add astrocyte plot to astrocyte_brunel.py
HanjiaJiang Dec 25, 2022
a802b42
Add function for pairwise spike count correlation to pynest/examples/…
HanjiaJiang Dec 26, 2022
678ac14
Add a plot for pairwise correlation in astrocyte_brunel.py
HanjiaJiang Dec 29, 2022
a6aee92
Fix mistakes and change the way of spike recording in astrocyte_brune…
HanjiaJiang Dec 29, 2022
58360d7
Tidy up astrocyte_brunel.py
HanjiaJiang Dec 30, 2022
e175edc
Change name "astro_pool_per_target_det" to "astro_pool_by_index"
HanjiaJiang Dec 30, 2022
8228474
Tidy up BernoulliAstroBuilder
HanjiaJiang Jan 2, 2023
8e300bb
Add global synchrony calculation in astrocyte_brunel.py
HanjiaJiang Jan 5, 2023
2d95408
For SIC recording
HanjiaJiang Jan 7, 2023
910b9a3
Add a plot of SIC input per neuron to astrocyte_brunel.py
HanjiaJiang Jan 8, 2023
4708597
Update user and inline documentation in the astrocyte source code files
Jan 30, 2023
1783228
Add get_secondary_event() in sic_connection.h for consistency after r…
Feb 4, 2023
e13c20e
Add SIC_thr_astro (Calcium threshold for producing SIC) to astrocyte …
Feb 5, 2023
672c413
Change the user interface of the "pairwise_bernoulli_astro" connectiv…
Feb 5, 2023
ab20f9d
Change synaptic weights and delays regarding astrocytes to ConnParame…
Feb 6, 2023
5ff81ae
Fix the bug of the previous commit and add the code of multiple syn_s…
Feb 6, 2023
84fa905
Add delay in sic_connection to fix the bug of SICEvent ring buffer re…
Feb 10, 2023
d154387
Set sic_connection default weight back to 1
Feb 11, 2023
8be2d92
Get rid of wfr in the astrocyte model
Feb 12, 2023
2db791b
Change astrocyte pynest examples after interface change
Feb 12, 2023
a4eb7b7
Change (update) aeif_cond_alpha_astro to allow status setting by para…
Feb 17, 2023
be1c00a
Give warning when the assigned delay for BernoulliAstroBuilder is not…
Feb 17, 2023
71d54e9
Add test_astrocyte.py for testing astrocyte dynamics
Feb 20, 2023
f31265e
Recover aeif_models_implementation.ipynb
Feb 20, 2023
0ad43cd
Make changes for SIC connection verification
Feb 21, 2023
e4b099e
Add astrocyte_model_implementation.ipynb as the astrocyte model refer…
Feb 23, 2023
6c45138
Add test_connect_pairwise_bernoulli_astro.py
Feb 23, 2023
ea58926
Improve model descriptions in astrocyte-related models
Feb 25, 2023
1c2d5d6
Improve test_connect_pairwise_bernoulli_astro.py
Feb 25, 2023
4423d69
Improve astrocyte_brunel.py, adding more descriptions
Mar 3, 2023
1d84cd4
"Added new pynest example: astrocyte_calcium.py"
jugoslavaacimovic Mar 6, 2023
2cae0bd
Update variable namings in the astrocyte model
Mar 8, 2023
5529e52
Update namings and pynest files regarding syn_spec for astrocytes
Mar 9, 2023
9c0042b
Make two updates for astrocytes
Mar 14, 2023
170dd4d
Rebase with master branch on April 25, 2023
jugoslavaacimovic Mar 13, 2023
50b9840
Discard the suffix "_astro" of astrocyte parameters
Apr 4, 2023
f079637
Remove unused variables and functions for current and gap junction in…
Apr 4, 2023
4d807a1
Move sic_values in the astrocyte model to buffer
Apr 5, 2023
2cf0508
Add ignore_and_sic model
Apr 24, 2023
14a0f3a
Simplify ignore_and_sic model
Apr 24, 2023
8bf236b
Improve documentation for ignore_and_sic model
Apr 25, 2023
b499bde
Improve documentation of astrocyte model
Apr 25, 2023
605eeba
Add a script for astrocyte parameter scan
Apr 27, 2023
3071c18
Update documentation in astrocyte files, adding units and etc.
May 2, 2023
a729b73
Improve astrocyte_brunel.py
May 6, 2023
f9ad516
Make two updates for astrocytes
May 7, 2023
6a65621
Decouple the delays of neuron-to-neuron and neuron-to-astrocyte conne…
May 7, 2023
cb65bb9
Improve astrocyte_brunel.py
May 7, 2023
751f7f2
Reorganize and improve astrocyte_brunel.py
May 8, 2023
33c541c
Improve MPI efficiency of BernoulliAstroBuilder
May 10, 2023
a8c3212
Update astrocyte_brunel.py for weak scaling experiment
May 10, 2023
a444b40
Clean some comments in BernoulliAstroBuilder
May 11, 2023
558cda4
Fix bug of astrocytic SIC output
May 15, 2023
787f15f
Provide new options for SIC algorithm in astrocytes
May 15, 2023
ade773b
Change two things in BernoulliAstroBuilder
May 22, 2023
48c63eb
Recover blocking of repeated astrocyte=>neuron connections
May 25, 2023
c72c19e
Make a few updates for astrocyte
May 28, 2023
f6a805e
Replace ignore_and_sic with astrocyte_surrogate
May 28, 2023
1f831e0
Rename "astrocyte" to "astrocyte_lr_1994", after the original study
May 28, 2023
12f77f6
Set boundaries for astrocytic calcium concentration
Jun 1, 2023
aa9e12c
Add exponentially decaying SIC to astrocyte_lr_1994
Jun 2, 2023
94c97e2
Delete output from std::cout in the last commit
Jun 2, 2023
8fada4f
Improve the calcium threshold-crossing mechanism for exponential SIC …
Jun 8, 2023
8abc356
Add alpha shape SIC to astrocyte_lr_1994
HanjiaJiang Jun 12, 2023
5c554c3
Allow "logarithmic_SIC" and "SIC_scale" for the alpha_SIC case in ast…
Jun 18, 2023
15a3034
Implement user-defined reactivation rule for SIC, with two new parame…
Jun 18, 2023
76f38e4
Set get() in the astrocyte for SIC_reactivate_th and SIC_reactivate_…
Jun 18, 2023
8e898f4
Add handle functions for CurrentEvent for astrocytes
Jun 20, 2023
e234378
Add a script astrocyte_small_network.py to demonstrate the creation o…
HanjiaJiang Jun 23, 2023
8b0c412
Improve connection plotting in astrocyte_small_network.py
HanjiaJiang Jun 25, 2023
8beb3e0
Fix bugs after rebase, July 13, 2023
Jul 13, 2023
21c1734
Update the documentation for astrocyte_lr_1994
Jul 13, 2023
a817236
Edit documentation of astrocyte_lr_1994
Jul 14, 2023
d9d14f7
Improve documentation in astrocyte_lr_1994, sic_connection, and aeif_…
Jul 15, 2023
610746d
Block STDP connection for astrocyte
HanjiaJiang Jul 19, 2023
40db54d
Improve documentation in the astrocyte files and jupyter notebook for…
HanjiaJiang Jul 20, 2023
7e3ff8e
Add a example script of a simple tripartite network consisting of 2 n…
HanjiaJiang Jul 21, 2023
d9e9b86
Update the style of astrocyte_tripartite.py
Jul 21, 2023
40574c2
Add an example script astrocyte_single.py for single astrocyte dynamics
Jul 28, 2023
2315310
Update documentation for astrocyte models
HanjiaJiang Jul 31, 2023
3ac4b64
Improve documentation for astrocyte models
HanjiaJiang Jul 31, 2023
04d39b9
Make the unit of SIC_th consistent with Ca in astrocyte_lr_1994
HanjiaJiang Aug 1, 2023
6f32856
Allow setting of delay for sic_connection
HanjiaJiang Aug 1, 2023
11e3992
Add spike input in verification files for astrocyte_lr_1994
HanjiaJiang Aug 1, 2023
0245e65
Correct the place of record_data() in astrocyte_lr_1994
HanjiaJiang Aug 1, 2023
394faee
Cancel tests for STDP connections in test_connect_pairwise_bernoulli_…
HanjiaJiang Aug 1, 2023
644a4e1
Allow setting of three delays (n2n, n2a, a2n) in the BernoulliAstroBu…
Aug 8, 2023
554ab4f
Update test files for BernoulliAstroBuilder for new ways to set delays
Aug 8, 2023
66eeb47
Update astrocyte documentation
Aug 25, 2023
05ff102
Merge branch 'master' into hj
Aug 26, 2023
547d0ee
Fix compilation problems after merging with master
Aug 26, 2023
243de5d
Clean up obsolete code and files of astrocyte modules
Aug 26, 2023
8cc5469
Update the astrocyte example scripts and recover astrocyte_surrogate
Aug 26, 2023
b7ea521
Improve documentation in astrocyte_single.py
Aug 26, 2023
e6ae438
Update the astrocyte example scripts astrocyte_single.py and astrocyt…
Aug 27, 2023
b263265
Discard the linear version of astrocytic SIC
Aug 27, 2023
29ab547
Update contents and formats in all documentation files for astrocytes
Aug 28, 2023
86b8323
Update astrocyte_model_implementation.ipynb and change parameter name…
Aug 28, 2023
2719d27
Clean up astrocyte_lr_1994 and delete some obsolete code
Aug 28, 2023
61092bd
Update parameter descriptions for astrocyte_lr_1994
Aug 28, 2023
5f49b50
Merge branch 'master' into hj
Aug 29, 2023
4dc69fe
Reorganize and improve documentation for astrocyte_lr_1994
Aug 29, 2023
70144c8
Improve the documentation in astrocyte_lr_1994
Aug 29, 2023
c398be8
Improve the documentation in astrocyte_lr_1994.cpp and test_sic_conne…
Aug 29, 2023
ee6f129
Improve test_astrocyte.py and test_sic_connection.py
Aug 29, 2023
09f7c68
Fix C++ formatting for astrocyte code with clang-format
Aug 31, 2023
1de41ca
Fix python formatting for astrocyte example scripts with black
Aug 31, 2023
0239ccc
Fix python formatting for astrocyte test files, with black
Aug 31, 2023
0d744af
Fix python formatting for astrocyte_model_implementation.ipynb, with …
Aug 31, 2023
84c806f
Change the simulation resolution of test_astrocyte.py to 0.1 ms
Aug 31, 2023
6f008c6
Improve documentation for astrocyte_lr_1994
Aug 31, 2023
1a73650
Improve documentation of astrocyte_lr_1994 and aeif_cond_alpha_astro
Aug 31, 2023
7595c54
Discard unnecessary files and code for the first pull request
Sep 1, 2023
a7032cd
Improve documentation for astrocyte_lr_1994
Sep 1, 2023
d30c55f
Delete debugging code in astrocyte example scripts and add a plot for…
Sep 1, 2023
2a8ff67
Merge branch 'master' into astrocyte_lr_1994
Sep 1, 2023
0dcdc8d
Fix C++ formatting for astrocyte_lr_1994
Sep 1, 2023
ef08f4d
Delete unused name
Sep 1, 2023
ceb28d4
Apply suggestions from code review
Sep 4, 2023
c59bd77
Apply suggestions from code review
Sep 4, 2023
8350ddc
Fix doc/htmldoc/examples/index.rst
Sep 4, 2023
15c851b
Change words a bit in astrocyte_lr_1994
Sep 11, 2023
a58a67c
Merge branch 'master' into astrocyte_lr_1994
Sep 11, 2023
14836b0
Exclude aeif_cond_alpha_astro from the test in regressiontests/ticket…
Sep 11, 2023
97b91db
Exclude astrocyte_lr_1994 and sic_connection from two respective pytests
Sep 11, 2023
2ce17c9
Apply suggestions from code review
Sep 12, 2023
aac4462
Fix the order of astrocyte parameters in nest_names.h and nest_names.cpp
Sep 12, 2023
7c9034f
Exclude sic_connection from test_SetLabelToNotLabeledSynapse() in tes…
Sep 12, 2023
a9a70d5
Skip sic_connection in one test
heplesser Sep 12, 2023
eeb765e
Change the name SIC to I_SIC for aeif_cond_alpha_astro and update doc…
Sep 13, 2023
3148a94
Improve astrocyte_model_implementation.ipynb according to review sugg…
Sep 13, 2023
0ca9ff7
Add I_SIC to nest_names.cpp
Sep 13, 2023
5e4bdb4
Change the code for calcium dynamics in astrocyte_lr_1994
Sep 13, 2023
5a50201
Change a GSL setting in astrocyte_lr_1994
Sep 13, 2023
0189025
Fix C++ and python format
Sep 13, 2023
47c3d88
Reduce the test duration of test_SynapseFunctionWithAeifModel in test…
Sep 14, 2023
7456c0e
Fix python formatting for test_sic_connection.py
Sep 14, 2023
8615635
Fix python formatting for test_sic_connection.py again
Sep 14, 2023
4c6a386
Change tolerance for test_sic_connection.py
Sep 14, 2023
fab2a57
Convert test_sic_connection and simplify
heplesser Sep 14, 2023
19c626e
Update test_sic_connection.py, using pytest instead of unittest
Sep 14, 2023
dd96355
Merge branch 'astrocyte_lr_1994' of github.com:HanjiaJiang/nest-simul…
heplesser Sep 14, 2023
6d189e8
Correct the equation for calc_ER in astrocyte_lr_1994
Sep 14, 2023
a305764
Update the description for Ca_tot in the astrocyte_lr_1994 model
Sep 14, 2023
161d9ac
Merge branch 'master' into astrocyte_lr_1994
Sep 14, 2023
3721443
Merge branch 'astrocyte_lr_1994' into hanjia_lr_1994
Sep 15, 2023
5e4a30d
Merge pull request #1 from heplesser/hanjia_lr_1994
Sep 15, 2023
35cbb92
Merge branch 'master' into astrocyte_lr_1994
Sep 15, 2023
d00e239
Add a description about Ca_tot_ in astrocyte_lr_1994.cpp
Sep 15, 2023
eb18737
Update aeif_cond_alpha_astro.cpp with a new delay mechanism in the ke…
Sep 15, 2023
6bbd58e
Improve test_astrocyte.py according to review suggestions
Sep 15, 2023
5b389aa
Fix python formatting for test_astrocyte.py
Sep 15, 2023
792cf3b
Sorted names
heplesser Sep 15, 2023
df46139
Merge pull request #2 from heplesser/hanjia_lr_1994
Sep 15, 2023
fb981d8
Delete internal variables for astrocyte_lr_1994 that is not used curr…
Sep 15, 2023
528bef4
Add abspath back to test_astrocyte.py
Sep 15, 2023
d7379f8
Limit Ca also post-integratoin and streamline SIC computation.
heplesser Sep 15, 2023
10def5e
Fixed typos and minor oversights
heplesser Sep 15, 2023
1dc8b3b
Merge pull request #3 from heplesser/hanjia_lr_1994
Sep 15, 2023
0963053
Correct a typo in the documentation of sic_connection.h
Sep 15, 2023
a71d35f
Merge remote-tracking branch 'origin/astrocyte_lr_1994' into astrocyt…
Sep 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions doc/htmldoc/examples/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ PyNEST examples
* :doc:`../auto_examples/pong/run_simulations`
* :doc:`../auto_examples/pong/generate_gif`

.. grid-item-card:: Astrocytes
:img-top: ../static/img/astrocyte_tripartite.png

* :doc:`../auto_examples/astrocyte_single`
* :doc:`../auto_examples/astrocyte_tripartite`


.. grid:: 1 1 2 3

.. grid-item-card:: Random balanced networks (Brunel)
Expand Down Expand Up @@ -316,6 +323,8 @@ PyNEST examples
../auto_examples/csa_example
../auto_examples/csa_spatial_example
../auto_examples/hpc_benchmark
../auto_examples/astrocyte_single
../auto_examples/astrocyte_tripartite

.. toctree::
:hidden:
Expand Down
326 changes: 326 additions & 0 deletions doc/htmldoc/model_details/astrocyte_model_implementation.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,326 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "17ef5228",
"metadata": {},
"source": [
"# NEST implementation of the `astrocyte_lr_1994` model\n",
"\n",
"The purpose of this notebook is to provide a reference solution for the the _astrocyte_lr_1994_ model in NEST. The model is based on Li, Y. X., & Rinzel, J. (1994), De Young, G. W., & Keizer, J. (1992), and Nadkarni, S., & Jung, P. (2003).\n",
"\n",
"This notebook demonstrates how the dynamics of _astrocyte_lr_1994_ is implemented, and generates a recording of the dynamics (test_astrocyte.dat). This recording serves as a reference for the verification of _astrocyte_lr_1994_ using test_astrocyte.py in the PyNEST tests.\n",
"\n",
"## The problem\n",
"\n",
"The equations governing the evolution of the astrocyte model are\n",
"\n",
"$$\\left\\lbrace\\begin{array}{rcl}\n",
" \\frac{d[\\mathrm{Ca^{2+}}](t)}{dt} &=& J_{\\mathrm{channel}}(t) - J_{\\mathrm{pump}}(t) + J_{\\mathrm{leak}}(t) \\\\\n",
" J_{\\mathrm{channel}}(t) &=& \\mathrm{r_{ER,cyt}} \\cdot \\mathrm{v_{IP_3R}} \\cdot m_{\\infty}(t)^3 \\cdot n_{\\infty}(t)^3\\cdot h_{\\mathrm{\\mathrm{IP_3R}}}(t)^3 \\cdot \\left([\\mathrm{Ca^{2+}}]_{\\mathrm{ER}} - [\\mathrm{Ca^{2+}}](t)\\right) \\\\\n",
" J_{\\mathrm{pump},k}(t) &=& \\frac{\\mathrm{v_{SERCA}} \\cdot [\\mathrm{Ca^{2+}}](t)^2}{K_{\\mathrm{m,SERCA}}^2+[\\mathrm{Ca^{2+}}](t)^2} \\\\\n",
" J_{\\mathrm{leak}}(t) &=& \\mathrm{r_{ER,cyt}} \\cdot \\mathrm{v_L} \\cdot \\left( [\\mathrm{Ca^{2+}}]_{\\mathrm{ER}}(t) - [\\mathrm{Ca^{2+}}](t) \\right) \\\\\n",
" m_{\\infty}(t) &=& \\frac{[\\mathrm{IP_3}](t)}{[\\mathrm{IP_3}](t) + \\mathrm{K_{d,IP_3,1}}} \\\\\n",
" n_{\\infty}(t) &=& \\frac{[\\mathrm{Ca^{2+}}](t)}{[\\mathrm{Ca^{2+}}](t) + \\mathrm{K_{d,act}}} \\\\\n",
" [\\mathrm{Ca^{2+}}]_{\\mathrm{ER}}(t) &=& \\frac{[\\mathrm{Ca^{2+}}]_{\\mathrm{tot}}-[\\mathrm{Ca^{2+}}](t)}{\\mathrm{r_{ER,cyt}}} \\\\\n",
" \\frac{dh_{\\mathrm{IP_3}}(t)}{dt} &=& \\alpha_{h_{\\mathrm{IP_3}}}(t) \\cdot (1-h_{\\mathrm{IP_3}}(t)) - \\beta_{h_{\\mathrm{IP_3}}}(t) \\cdot h_{\\mathrm{IP_3}} (t) \\\\\n",
" \\alpha_{h_{\\mathrm{IP_3}}}(t) &=& \\mathrm{k_{IP_3R}} \\cdot \\mathrm{K_{d,inh}} \\cdot \\frac{[\\mathrm{IP_3}](t) + \\mathrm{K_{d,IP_3,1}}}{[\\mathrm{IP_3}](t)+\\mathrm{K_{d,IP_3,2}}} \\\\\n",
" \\beta_{h_{\\mathrm{IP_3}}}(t) &=& \\mathrm{k_{IP_3R}} \\cdot [\\mathrm{Ca^{2+}}](t) \\\\\n",
" \\frac{d[\\mathrm{IP_3}](t)}{dt} &=& \\frac{[\\mathrm{IP_3}]^{*} - [\\mathrm{IP_3}](t)}{\\tau_\\mathrm{IP_3}} + \\Delta_\\mathrm{IP3} \\cdot J_\\mathrm{syn}(t)\n",
"\\end{array}\\right.$$\n",
"\n",
"where $[\\mathrm{IP_3}]$, $[\\mathrm{Ca^{2+}}]$, and $h_{\\mathrm{IP_3}}$ are the state variables of interest."
]
},
{
"cell_type": "markdown",
"id": "622a93cb",
"metadata": {},
"source": [
"## Technical details and requirements\n",
"\n",
"### Implementation of the functions\n",
"\n",
"* The reference solution is implemented through [scipy](http://www.scipy.org/).\n",
"\n",
"### Requirements\n",
"\n",
"To run this notebook, you need:\n",
"\n",
"* [numpy](http://www.numpy.org/) and [scipy](http://www.scipy.org/)\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "76d05384",
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"from scipy.integrate import odeint"
]
},
{
"cell_type": "markdown",
"id": "17cecb4d",
"metadata": {},
"source": [
"## Reference solution\n",
"### Right hand side function"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "967b18fb",
"metadata": {},
"outputs": [],
"source": [
"def rhs(y, _, p):\n",
" \"\"\"\n",
" Implementation of astrocyte dynamics.\n",
"\n",
" Parameters\n",
" ----------\n",
" y : list\n",
" Vector containing the state variables [IP3, Ca, h_IP3R]\n",
" _ : unused var\n",
" p : Params instance\n",
" Object containing the astrocyte parameters.\n",
"\n",
" Returns\n",
" -------\n",
" dCa : double\n",
" Derivative of Ca\n",
" dIP3 : double\n",
" Derivative of IP3\n",
" dh_IP3R : double\n",
" Derivative of h_IP3R\n",
" \"\"\"\n",
" IP3 = y[0]\n",
" Ca = y[1]\n",
" h_IP3R = y[2]\n",
"\n",
" Ca = max(0, min(Ca, p.Ca_tot * (1 + p.ratio_ER_cyt)))\n",
" alpha = p.k_IP3R * p.Kd_inh * (IP3 + p.Kd_IP3_1) / (IP3 + p.Kd_IP3_2)\n",
" beta = p.k_IP3R * Ca\n",
" Ca_ER = p.Ca_tot + (p.Ca_tot - Ca) / p.ratio_ER_cyt\n",
" m_inf = IP3 / (IP3 + p.Kd_IP3_1)\n",
" n_inf = Ca / (Ca + p.Kd_act)\n",
" J_ch = p.ratio_ER_cyt * p.rate_IP3R * ((m_inf * n_inf * h_IP3R) ** 3) * (Ca_ER - Ca)\n",
" J_pump = p.rate_SERCA * (Ca**2) / (p.Km_SERCA**2 + Ca**2)\n",
" J_leak = p.ratio_ER_cyt * p.rate_L * (Ca_ER - Ca)\n",
"\n",
" dCa = J_ch - J_pump + J_leak\n",
" dIP3 = (p.IP3_0 - IP3) / p.tau_IP3\n",
" dh_IP3R = alpha * (1 - h_IP3R) - beta * h_IP3R\n",
"\n",
" return dIP3, dCa, dh_IP3R"
]
},
{
"cell_type": "markdown",
"id": "6f9246f9",
"metadata": {},
"source": [
"### Complete model"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "6276334c",
"metadata": {},
"outputs": [],
"source": [
"def scipy_astrocyte(p, f, simtime, dt, spk_ts, spk_ws):\n",
" \"\"\"\n",
" Complete astrocyte model using scipy `odeint` solver.\n",
"\n",
" Parameters\n",
" ----------\n",
" p : Params instance\n",
" Object containing the astrocyte parameters.\n",
" f : function\n",
" Right-hand side function\n",
" simtime : double\n",
" Duration of the simulation (will run between\n",
" 0 and tmax)\n",
" dt : double\n",
" Time increment.\n",
" spk_ts, spk_ws : list\n",
" Times and weights of spike input to the astrocyte\n",
"\n",
" Returns\n",
" -------\n",
" t : list\n",
" Times at which the astrocyte state was evaluated.\n",
" y : list\n",
" State values associated to the times in `t`\n",
" fos : list\n",
" List of dictionaries containing additional output\n",
" information from `odeint`\n",
" \"\"\"\n",
" t = np.arange(0, simtime, dt) # time axis\n",
" n = len(t)\n",
" y = np.zeros((n, 3)) # state variables: IP3, Ca, h_IP3R\n",
" # for the state variables, assign the same initial values as in test_astrocyte.py\n",
" y[0, 0] = 1.0\n",
" y[0, 1] = 1.0\n",
" y[0, 2] = 1.0\n",
" fos = [] # full output dict from odeint()\n",
" delta_ip3 = 5.0 # parameter determining the increase in IP3 induced by synaptic input\n",
"\n",
" # update time-step by time-step\n",
" for k in range(1, n):\n",
" # solve ODE from t_k-1 to t_k\n",
" d, fo = odeint(f, y[k - 1, :], t[k - 1 : k + 1], (p,), full_output=True)\n",
" y[k, :] = d[1, :]\n",
"\n",
" # apply synaptic inputs (spikes)\n",
" if t[k] in spk_ts:\n",
" y[k, 0] += delta_ip3 * spk_ws[spk_ts.index(t[k])]\n",
"\n",
" fos.append(fo)\n",
"\n",
" return t, y, fos"
]
},
{
"cell_type": "markdown",
"id": "246ef086",
"metadata": {},
"source": [
"### Parameters"
]
},
{
"cell_type": "code",
"execution_count": 4,
"id": "3fb81ba9",
"metadata": {},
"outputs": [],
"source": [
"astro_param = {\n",
" \"Ca_tot\": 2.0,\n",
" \"IP3_0\": 0.16,\n",
" \"Kd_act\": 0.08234,\n",
" \"Kd_inh\": 1.049,\n",
" \"Kd_IP3_1\": 0.13,\n",
" \"Kd_IP3_2\": 0.9434,\n",
" \"Km_SERCA\": 0.1,\n",
" \"ratio_ER_cyt\": 0.185,\n",
" \"delta_IP3\": 5.0,\n",
" \"k_IP3R\": 0.0002,\n",
" \"rate_L\": 0.00011,\n",
" \"tau_IP3\": 7142.0,\n",
" \"rate_IP3R\": 0.006,\n",
" \"rate_SERCA\": 0.0009,\n",
"}\n",
"\n",
"\n",
"class Params:\n",
" \"\"\"\n",
" Class giving access to the astrocyte parameters.\n",
" \"\"\"\n",
"\n",
" def __init__(self):\n",
" self.params = astro_param\n",
" self.Ca_tot = astro_param[\"Ca_tot\"]\n",
" self.IP3_0 = astro_param[\"IP3_0\"]\n",
" self.Kd_act = astro_param[\"Kd_act\"]\n",
" self.Kd_inh = astro_param[\"Kd_inh\"]\n",
" self.Kd_IP3_1 = astro_param[\"Kd_IP3_1\"]\n",
" self.Kd_IP3_2 = astro_param[\"Kd_IP3_2\"]\n",
" self.Km_SERCA = astro_param[\"Km_SERCA\"]\n",
" self.ratio_ER_cyt = astro_param[\"ratio_ER_cyt\"]\n",
" self.delta_IP3 = astro_param[\"delta_IP3\"]\n",
" self.k_IP3R = astro_param[\"k_IP3R\"]\n",
" self.rate_L = astro_param[\"rate_L\"]\n",
" self.tau_IP3 = astro_param[\"tau_IP3\"]\n",
" self.rate_IP3R = astro_param[\"rate_IP3R\"]\n",
" self.rate_SERCA = astro_param[\"rate_SERCA\"]\n",
"\n",
"\n",
"p = Params()"
]
},
{
"cell_type": "markdown",
"id": "854edc71",
"metadata": {},
"source": [
"### Simulate the implementation"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "c83f56f0",
"metadata": {},
"outputs": [],
"source": [
"# Parameters for the simulation\n",
"simtime = 100.0\n",
"resolution = 0.1\n",
"spike_times = [10.0]\n",
"spike_weights = [1.0]\n",
"\n",
"# Simulate and get the recording\n",
"t, y, fos = scipy_astrocyte(p, rhs, simtime, resolution, spike_times, spike_weights)\n",
"data = np.concatenate((np.array([t]).T, y), axis=1)\n",
"\n",
"# Save the recording (excluding the initial values)\n",
"np.savetxt(\n",
" \"test_astrocyte.dat\",\n",
" data[1:, :],\n",
" header=\"\"\"\\ntest_astrocyte.dat\\n\n",
"This file is part of NEST.\\n\n",
"This .dat file contains the recordings of the state variables of an\n",
"astrocyte, simulated using the ODEINT solver of SciPy, with the\n",
"implementation detailed in\n",
"``doc/htmldoc/model_details/astrocyte_model_implementation.ipynb``.\n",
"This data is used as reference for the tests in ``test_astrocyte.py``.\\n\n",
" Times IP3 Ca h_IP3R \"\"\",\n",
")"
]
},
{
"cell_type": "markdown",
"id": "df8ff655",
"metadata": {},
"source": [
"-----------------------------\n",
"### License\n",
"\n",
"This file is part of NEST. Copyright (C) 2004 The NEST Initiative\n",
"\n",
"NEST is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.\n",
"\n",
"NEST is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.10"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Binary file added doc/htmldoc/static/img/astrocyte_tripartite.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion models/aeif_cond_alpha.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ and

\tau_w \frac{dw}{dt} = a(V-E_L) - w

For implementation details see the
For the reference implementation of this model, see
`aeif_models_implementation <../model_details/aeif_models_implementation.ipynb>`_ notebook.

See also [1]_.
Expand Down
Loading