-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 09378cf
Showing
38 changed files
with
7,157 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Sphinx build info version 1 | ||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. | ||
config: a1af5b3afa43b9c5f27297f5d5ad0205 | ||
tags: 645f666f9bcd5a90fca523b33c5a78b7 |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<!DOCTYPE html> | ||
|
||
<html lang="en" data-content_root="../"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Overview: module code — mndynamics 0.1.dev1+g8e5db4d documentation</title> | ||
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=82a976d7" /> | ||
<link rel="stylesheet" type="text/css" href="../_static/nature.css?v=601dbdee" /> | ||
<link rel="stylesheet" type="text/css" href="../_static/graphviz.css?v=eafc0fe6" /> | ||
<script src="../_static/documentation_options.js?v=5007a425"></script> | ||
<script src="../_static/doctools.js?v=888ff710"></script> | ||
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script> | ||
<link rel="index" title="Index" href="../genindex.html" /> | ||
<link rel="search" title="Search" href="../search.html" /> | ||
</head><body> | ||
<div class="related" role="navigation" aria-label="related navigation"> | ||
<h3>Navigation</h3> | ||
<ul> | ||
<li class="right" style="margin-right: 10px"> | ||
<a href="../genindex.html" title="General Index" | ||
accesskey="I">index</a></li> | ||
<li class="right" > | ||
<a href="../py-modindex.html" title="Python Module Index" | ||
>modules</a> |</li> | ||
<li class="nav-item nav-item-0"><a href="../index.html">mndynamics 0.1.dev1+g8e5db4d documentation</a> »</li> | ||
<li class="nav-item nav-item-this"><a href="">Overview: module code</a></li> | ||
</ul> | ||
</div> | ||
|
||
<div class="document"> | ||
<div class="documentwrapper"> | ||
<div class="bodywrapper"> | ||
<div class="body" role="main"> | ||
|
||
<h1>All modules for which code is available</h1> | ||
<ul><li><a href="mndynamics/models/py/Erisir_Base.html">mndynamics.models.py.Erisir_Base</a></li> | ||
<li><a href="mndynamics/models/py/HH_Base.html">mndynamics.models.py.HH_Base</a></li> | ||
<li><a href="mndynamics/models/py/Inapik_Base.html">mndynamics.models.py.Inapik_Base</a></li> | ||
<li><a href="mndynamics/models/py/LIF_Base.html">mndynamics.models.py.LIF_Base</a></li> | ||
<li><a href="mndynamics/models/py/RTM_Base.html">mndynamics.models.py.RTM_Base</a></li> | ||
<li><a href="mndynamics/models/py/ch03.html">mndynamics.models.py.ch03</a></li> | ||
<li><a href="mndynamics/models/py/ch04.html">mndynamics.models.py.ch04</a></li> | ||
<li><a href="mndynamics/models/py/ch05.html">mndynamics.models.py.ch05</a></li> | ||
</ul> | ||
|
||
<div class="clearer"></div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation"> | ||
<div class="sphinxsidebarwrapper"> | ||
<div id="searchbox" style="display: none" role="search"> | ||
<h3 id="searchlabel">Quick search</h3> | ||
<div class="searchformwrapper"> | ||
<form class="search" action="../search.html" method="get"> | ||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> | ||
<input type="submit" value="Go" /> | ||
</form> | ||
</div> | ||
</div> | ||
<script>document.getElementById('searchbox').style.display = "block"</script> | ||
</div> | ||
</div> | ||
<div class="clearer"></div> | ||
</div> | ||
<div class="related" role="navigation" aria-label="related navigation"> | ||
<h3>Navigation</h3> | ||
<ul> | ||
<li class="right" style="margin-right: 10px"> | ||
<a href="../genindex.html" title="General Index" | ||
>index</a></li> | ||
<li class="right" > | ||
<a href="../py-modindex.html" title="Python Module Index" | ||
>modules</a> |</li> | ||
<li class="nav-item nav-item-0"><a href="../index.html">mndynamics 0.1.dev1+g8e5db4d documentation</a> »</li> | ||
<li class="nav-item nav-item-this"><a href="">Overview: module code</a></li> | ||
</ul> | ||
</div> | ||
<div class="footer" role="contentinfo"> | ||
© Copyright 2023, Abolfazl Ziaeemehr. | ||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6. | ||
</div> | ||
</body> | ||
</html> |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
<!DOCTYPE html> | ||
|
||
<html lang="en" data-content_root="../../../../"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>mndynamics.models.py.ch04 — mndynamics 0.1.dev1+g8e5db4d documentation</title> | ||
<link rel="stylesheet" type="text/css" href="../../../../_static/pygments.css?v=82a976d7" /> | ||
<link rel="stylesheet" type="text/css" href="../../../../_static/nature.css?v=601dbdee" /> | ||
<link rel="stylesheet" type="text/css" href="../../../../_static/graphviz.css?v=eafc0fe6" /> | ||
<script src="../../../../_static/documentation_options.js?v=5007a425"></script> | ||
<script src="../../../../_static/doctools.js?v=888ff710"></script> | ||
<script src="../../../../_static/sphinx_highlight.js?v=dc90522c"></script> | ||
<link rel="index" title="Index" href="../../../../genindex.html" /> | ||
<link rel="search" title="Search" href="../../../../search.html" /> | ||
</head><body> | ||
<div class="related" role="navigation" aria-label="related navigation"> | ||
<h3>Navigation</h3> | ||
<ul> | ||
<li class="right" style="margin-right: 10px"> | ||
<a href="../../../../genindex.html" title="General Index" | ||
accesskey="I">index</a></li> | ||
<li class="right" > | ||
<a href="../../../../py-modindex.html" title="Python Module Index" | ||
>modules</a> |</li> | ||
<li class="nav-item nav-item-0"><a href="../../../../index.html">mndynamics 0.1.dev1+g8e5db4d documentation</a> »</li> | ||
<li class="nav-item nav-item-1"><a href="../../../index.html" accesskey="U">Module code</a> »</li> | ||
<li class="nav-item nav-item-this"><a href="">mndynamics.models.py.ch04</a></li> | ||
</ul> | ||
</div> | ||
|
||
<div class="document"> | ||
<div class="documentwrapper"> | ||
<div class="bodywrapper"> | ||
<div class="body" role="main"> | ||
|
||
<h1>Source code for mndynamics.models.py.ch04</h1><div class="highlight"><pre> | ||
<span></span><span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span> | ||
<span class="kn">from</span> <span class="nn">numpy</span> <span class="kn">import</span> <span class="n">exp</span> | ||
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span> | ||
<span class="kn">from</span> <span class="nn">scipy.integrate</span> <span class="kn">import</span> <span class="n">odeint</span> | ||
<span class="kn">from</span> <span class="nn">mndynamics.models.py.HH_Base</span> <span class="kn">import</span> <span class="n">HH</span> <span class="k">as</span> <span class="n">_HH</span> | ||
|
||
|
||
<div class="viewcode-block" id="HH_SOLUTION"> | ||
<a class="viewcode-back" href="../../../../modules.html#mndynamics.models.py.ch04.HH_SOLUTION">[docs]</a> | ||
<span class="k">class</span> <span class="nc">HH_SOLUTION</span><span class="p">(</span><span class="n">_HH</span><span class="p">):</span> | ||
|
||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">par</span><span class="o">=</span><span class="p">{}):</span> | ||
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">par</span><span class="p">)</span></div> | ||
|
||
|
||
|
||
<div class="viewcode-block" id="HH_REFRACTORINESS"> | ||
<a class="viewcode-back" href="../../../../modules.html#mndynamics.models.py.ch04.HH_REFRACTORINESS">[docs]</a> | ||
<span class="k">class</span> <span class="nc">HH_REFRACTORINESS</span><span class="p">(</span><span class="n">_HH</span><span class="p">):</span> | ||
<span class="w"> </span><span class="sd">'''</span> | ||
<span class="sd"> Refractoriness of the HH model.</span> | ||
<span class="sd"> </span> | ||
<span class="sd"> '''</span> | ||
|
||
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">par</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span> | ||
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">par</span><span class="p">)</span> | ||
|
||
<div class="viewcode-block" id="HH_REFRACTORINESS.f_sys"> | ||
<a class="viewcode-back" href="../../../../modules.html#mndynamics.models.py.ch04.HH_REFRACTORINESS.f_sys">[docs]</a> | ||
<span class="k">def</span> <span class="nf">f_sys</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">x0</span><span class="p">,</span> <span class="n">t</span><span class="p">,</span> <span class="n">i_ext</span><span class="p">,</span> <span class="n">PULSE_ONSET</span><span class="p">):</span> | ||
<span class="w"> </span><span class="sd">'''</span> | ||
<span class="sd"> define HH Model</span> | ||
<span class="sd"> '''</span> | ||
<span class="n">v</span><span class="p">,</span> <span class="n">m</span><span class="p">,</span> <span class="n">h</span><span class="p">,</span> <span class="n">n</span> <span class="o">=</span> <span class="n">x0</span> | ||
|
||
<span class="k">if</span> <span class="p">(</span><span class="n">t</span> <span class="o">></span> <span class="n">PULSE_ONSET</span><span class="p">)</span> <span class="o">&</span> <span class="p">(</span><span class="n">t</span> <span class="o"><</span> <span class="n">PULSE_ONSET</span> <span class="o">+</span> <span class="mi">1</span><span class="p">):</span> | ||
<span class="n">i_ext</span> <span class="o">=</span> <span class="mf">40.0</span> | ||
|
||
<span class="n">dv</span> <span class="o">=</span> <span class="p">(</span><span class="n">i_ext</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">g_na</span> <span class="o">*</span> <span class="n">m</span><span class="o">**</span><span class="mi">3</span> <span class="o">*</span> <span class="n">h</span> <span class="o">*</span> <span class="p">(</span><span class="n">v</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">v_na</span><span class="p">)</span> <span class="o">-</span> | ||
<span class="bp">self</span><span class="o">.</span><span class="n">g_k</span> <span class="o">*</span> <span class="n">n</span><span class="o">**</span><span class="mi">4</span> <span class="o">*</span> <span class="p">(</span><span class="n">v</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">v_k</span><span class="p">)</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">g_l</span> <span class="o">*</span> <span class="p">(</span><span class="n">v</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">v_l</span><span class="p">))</span> <span class="o">/</span> <span class="bp">self</span><span class="o">.</span><span class="n">c</span> | ||
<span class="n">dm</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">alpha_m</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">-</span> <span class="n">m</span><span class="p">)</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">beta_m</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="o">*</span> <span class="n">m</span> | ||
<span class="n">dh</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">alpha_h</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">-</span> <span class="n">h</span><span class="p">)</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">beta_h</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="o">*</span> <span class="n">h</span> | ||
<span class="n">dn</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">alpha_n</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="o">*</span> <span class="p">(</span><span class="mf">1.0</span> <span class="o">-</span> <span class="n">n</span><span class="p">)</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">beta_n</span><span class="p">(</span><span class="n">v</span><span class="p">)</span> <span class="o">*</span> <span class="n">n</span> | ||
<span class="k">return</span> <span class="p">[</span><span class="n">dv</span><span class="p">,</span> <span class="n">dm</span><span class="p">,</span> <span class="n">dh</span><span class="p">,</span> <span class="n">dn</span><span class="p">]</span></div> | ||
|
||
|
||
<div class="viewcode-block" id="HH_REFRACTORINESS.simulate"> | ||
<a class="viewcode-back" href="../../../../modules.html#mndynamics.models.py.ch04.HH_REFRACTORINESS.simulate">[docs]</a> | ||
<span class="k">def</span> <span class="nf">simulate</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">tspan</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span> <span class="o">*</span><span class="n">args</span><span class="p">):</span> | ||
<span class="w"> </span><span class="sd">'''</span> | ||
<span class="sd"> Simulate the HH model.</span> | ||
|
||
<span class="sd"> Parameters</span> | ||
<span class="sd"> ----------</span> | ||
<span class="sd"> tspan : array_like, optional</span> | ||
<span class="sd"> Time points (ms) at which to solve for membrane potential and gating variables.</span> | ||
<span class="sd"> Default is np.arange(0, 50, 0.01).</span> | ||
<span class="sd"> args : tuple, optional</span> | ||
<span class="sd"> Additional arguments to pass to the ODE solver.</span> | ||
|
||
<span class="sd"> Returns</span> | ||
<span class="sd"> -------</span> | ||
<span class="sd"> dict</span> | ||
<span class="sd"> Dictionary with keys "t", "v", "m", "h", "n" and values being the corresponding</span> | ||
<span class="sd"> time points and membrane potential and gating variables.</span> | ||
<span class="sd"> </span> | ||
<span class="sd"> '''</span> | ||
|
||
<span class="n">x0</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">set_initial_state</span><span class="p">()</span> | ||
|
||
<span class="n">tspan</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">tspan</span> <span class="k">if</span> <span class="n">tspan</span> <span class="ow">is</span> <span class="kc">None</span> <span class="k">else</span> <span class="n">tspan</span> | ||
<span class="n">sol</span> <span class="o">=</span> <span class="n">odeint</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">f_sys</span><span class="p">,</span> <span class="n">x0</span><span class="p">,</span> <span class="n">tspan</span><span class="p">,</span> <span class="n">args</span><span class="o">=</span><span class="n">args</span><span class="p">)</span> | ||
|
||
<span class="k">return</span> <span class="p">{</span><span class="s2">"t"</span><span class="p">:</span> <span class="n">tspan</span><span class="p">,</span> | ||
<span class="s2">"v"</span><span class="p">:</span> <span class="n">sol</span><span class="p">[:,</span> <span class="mi">0</span><span class="p">],</span> | ||
<span class="s2">"m"</span><span class="p">:</span> <span class="n">sol</span><span class="p">[:,</span> <span class="mi">1</span><span class="p">],</span> | ||
<span class="s2">"h"</span><span class="p">:</span> <span class="n">sol</span><span class="p">[:,</span> <span class="mi">2</span><span class="p">],</span> | ||
<span class="s2">"n"</span><span class="p">:</span> <span class="n">sol</span><span class="p">[:,</span> <span class="mi">3</span><span class="p">]</span> | ||
<span class="p">}</span></div> | ||
</div> | ||
|
||
</pre></div> | ||
|
||
<div class="clearer"></div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="sphinxsidebar" role="navigation" aria-label="main navigation"> | ||
<div class="sphinxsidebarwrapper"> | ||
<div id="searchbox" style="display: none" role="search"> | ||
<h3 id="searchlabel">Quick search</h3> | ||
<div class="searchformwrapper"> | ||
<form class="search" action="../../../../search.html" method="get"> | ||
<input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/> | ||
<input type="submit" value="Go" /> | ||
</form> | ||
</div> | ||
</div> | ||
<script>document.getElementById('searchbox').style.display = "block"</script> | ||
</div> | ||
</div> | ||
<div class="clearer"></div> | ||
</div> | ||
<div class="related" role="navigation" aria-label="related navigation"> | ||
<h3>Navigation</h3> | ||
<ul> | ||
<li class="right" style="margin-right: 10px"> | ||
<a href="../../../../genindex.html" title="General Index" | ||
>index</a></li> | ||
<li class="right" > | ||
<a href="../../../../py-modindex.html" title="Python Module Index" | ||
>modules</a> |</li> | ||
<li class="nav-item nav-item-0"><a href="../../../../index.html">mndynamics 0.1.dev1+g8e5db4d documentation</a> »</li> | ||
<li class="nav-item nav-item-1"><a href="../../../index.html" >Module code</a> »</li> | ||
<li class="nav-item nav-item-this"><a href="">mndynamics.models.py.ch04</a></li> | ||
</ul> | ||
</div> | ||
<div class="footer" role="contentinfo"> | ||
© Copyright 2023, Abolfazl Ziaeemehr. | ||
Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 7.2.6. | ||
</div> | ||
</body> | ||
</html> |
Oops, something went wrong.