{ "cells": [ { "cell_type": "markdown", "metadata": { "collapsed": true }, "source": [ "# *(Mondal, et. al, 2019)*: Fractional-order FitzHugh-Rinzel bursting neuron model\n", "\n", "[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/brainpy/examples/blob/main/neurons/2019_Fractional_order_FHR_model.ipynb)\n", "[![Open in Kaggle](https://kaggle.com/static/images/open-in-kaggle.svg)](https://kaggle.com/kernels/welcome?src=https://github.com/brainpy/examples/blob/main/neurons/2019_Fractional_order_FHR_model.ipynb)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Implementation of the paper:\n", "\n", "- Mondal, A., Sharma, S.K., Upadhyay, R.K. et al. Firing activities of a fractional-order FitzHugh-Rinzel bursting neuron model and its coupled dynamics. Sci Rep 9, 15721 (2019). https://doi.org/10.1038/s41598-019-52061-4" ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import brainpy as bp\n", "\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [], "source": [ "def run_model(model, inputs, length):\n", " runner = bp.DSRunner(model, monitors=['V'], inputs=inputs)\n", " runner.run(length)\n", " return runner" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Parameter set 1" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "dt = 0.1\n", "Iext = 0.3125\n", "duration = 4000\n", "neuron_pars = dict(a=0.7, b=0.8, c=-0.775, d=1., delta=0.08, mu=0.0001,\n", " w_initializer=bp.init.Constant(-0.1),\n", " y_initializer=bp.init.Constant(0.1))" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "name": "stderr", "output_type": "stream", "text": [ "WARNING:jax._src.lib.xla_bridge:No GPU/TPU found, falling back to CPU. (Set TF_CPP_MIN_LOG_LEVEL=0 and rerun for more info.)\n" ] }, { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "0979ff84e97c4456bcb2d55709810a0d", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/40000 [00:00" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "alphas = [1.0, 0.98, 0.95]\n", "\n", "plt.figure(figsize=(9, 10))\n", "for i, alpha in enumerate(alphas):\n", " neuron = bp.neurons.FractionalFHR(1,\n", " alpha=alpha,\n", " num_memory=4000,\n", " **neuron_pars)\n", " runner = run_model(neuron, inputs=['input', Iext], length=duration)\n", "\n", " plt.subplot(len(alphas), 1, i+1)\n", " plt.plot(runner.mon.ts, runner.mon.V[:, 0])\n", " plt.title(r'$\\alpha$=' + str(alphas[i]))\n", " plt.ylabel('V')\n", "plt.xlabel('Time [ms]')\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Parameter set 2" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "Iext = 0.4\n", "duration = 3500\n", "neuron_pars = dict(a=0.7, b=0.8, c=-0.775, d=1., delta=0.08, mu=0.0001)" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "c05ca0a2aec5478490e98c8a2124a8e6", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/35000 [00:00" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "alphas = [1.0, 0.92, 0.85, 0.68]\n", "\n", "plt.figure(figsize=(12, 10))\n", "for i, alpha in enumerate(alphas):\n", " neuron = bp.neurons.FractionalFHR(1,\n", " alpha=alpha,\n", " num_memory=4000,\n", " **neuron_pars)\n", " runner = run_model(neuron, inputs=['input', Iext], length=duration)\n", "\n", " plt.subplot(len(alphas), 1, i+1)\n", " plt.plot(runner.mon.ts, runner.mon.V[:, 0])\n", " plt.title(r'$\\alpha$=' + str(alphas[i]))\n", " plt.ylabel('V')\n", "plt.xlabel('Time [ms]')\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Parameter set 3" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "Iext = 3\n", "duration = 500\n", "neuron_pars = dict(a=0.7, b=0.8, c=-0.775, d=1., delta=0.08, mu=0.18)" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "8e0d9711ac8649fb83a0f158fa96bc1e", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/5000 [00:00" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "alphas = [1.0, 0.99, 0.97, 0.95]\n", "\n", "plt.figure(figsize=(12, 10))\n", "for i, alpha in enumerate(alphas):\n", " neuron = bp.neurons.FractionalFHR(1,\n", " alpha=alpha,\n", " **neuron_pars)\n", " runner = run_model(neuron, inputs=['input', Iext], length=duration)\n", "\n", " plt.subplot(len(alphas), 1, i+1)\n", " plt.plot(runner.mon.ts, runner.mon.V[:, 0])\n", " plt.title(r'$\\alpha$=' + str(alphas[i]))\n", " plt.ylabel('V')\n", "plt.xlabel('Time [ms]')\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Parameter set 4" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [], "source": [ "Iext = 0.3125\n", "duration = 3500\n", "neuron_pars = dict(a=0.7, b=0.8, c=1.3, d=1., delta=0.08, mu=0.0001)" ] }, { "cell_type": "code", "execution_count": 10, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "6257ebe3dc3640fa82ee5ee008ca22d2", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/35000 [00:00" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "alphas = [1.0, 0.85, 0.80]\n", "\n", "plt.figure(figsize=(9, 10))\n", "for i, alpha in enumerate(alphas):\n", " neuron = bp.neurons.FractionalFHR(1,\n", " alpha=alpha,\n", " num_memory=3000,\n", " **neuron_pars)\n", " runner = run_model(neuron, inputs=['input', Iext], length=duration)\n", "\n", " plt.subplot(len(alphas), 1, i+1)\n", " plt.plot(runner.mon.ts, runner.mon.V[:, 0])\n", " plt.title(r'$\\alpha$=' + str(alphas[i]))\n", " plt.ylabel('V')\n", "plt.xlabel('Time [ms]')\n", "plt.show()" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Parameter set 5" ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [], "source": [ "Iext = 0.3125\n", "duration = 2500\n", "neuron_pars = dict(a=0.7, b=0.8, c=-0.908, d=1., delta=0.08, mu=0.002)" ] }, { "cell_type": "code", "execution_count": 12, "metadata": {}, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "dec728b738f941889425168c89c74730", "version_major": 2, "version_minor": 0 }, "text/plain": [ " 0%| | 0/25000 [00:00" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "alphas = [1.0, 0.98, 0.95]\n", "\n", "plt.figure(figsize=(9, 10))\n", "for i, alpha in enumerate(alphas):\n", " neuron = bp.neurons.FractionalFHR(1, alpha=alpha, **neuron_pars)\n", " runner = run_model(neuron, inputs=['input', Iext], length=duration)\n", "\n", " plt.subplot(len(alphas), 1, i+1)\n", " plt.plot(runner.mon.ts, runner.mon.V[:, 0])\n", " plt.title(r'$\\alpha$=' + str(alphas[i]))\n", " plt.ylabel('V')\n", "plt.xlabel('Time [ms]')\n", "plt.show()" ] } ], "metadata": { "kernelspec": { "display_name": "brainpy", "language": "python", "name": "brainpy" }, "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.9.12" } }, "nbformat": 4, "nbformat_minor": 1 }