{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "#AUTHOR: Lisa Blum Moyse\n", "# lisa.blum-moyse@inria.fr\n", "#\n", "# REFERENCE: Blum Moyse & Berry. Modelling the modulation of cortical Up-Down state switching by astrocytes\n", "#\n", "# LICENSE: CC0 1.0 Universal" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import math as math\n", "import cmath\n", "import scipy.integrate as integrate\n", "from scipy.misc import derivative\n", "import scipy.special as sc\n", "import scipy as sci\n", "import mpmath as mp" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [], "source": [ "def M(a,b,z):\n", " return mp.hyp1f1(a, b, z)\n", "\n", "def U(y,latau):\n", " return np.exp(y**2)/sc.gamma((1+latau)/2)*M((1-latau)/2,0.5,-y**2) + 2*y*np.exp(y**2)/sc.gamma(latau/2)*M(1-latau/2,1.5,-y**2)\n", "\n", "def partial_derivative(func, var=0, point=[]):\n", " args = point[:]\n", " def wraps(x):\n", " args[var] = x\n", " return func(*args)\n", " return derivative(wraps, point[var], dx = 1e-6)\n", "\n", "def der(U,ytr,latau):\n", " return partial_derivative(U, 0, [ytr,latau]) \n", "\n", "def R(latau,yr,yt,r0,sig,tau):\n", " return r0/(sig*(1+latau))*(der(U,yt,latau)-der(U,yr,latau))/(U(yt,latau)-U(yr,latau))\n", "\n", "def S(la,D,taur,taud):\n", " return np.exp(-la*D)/((1+la*taur)*(1+la*taud))\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 83, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "X= [0.05965212-6.6258458e-19j] lambda= [0.01+1.e-20j]\n" ] }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWwAAAEJCAYA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M0g+h51Zf48ulGchsAr4ZEQ80nB82u8NrYfrduPeNF5zefp6OQ3fj7r08/oOsDEi/mrSucYpMT9MvnuUtTztPpuO7y+yLA32ezbUhXvTSbvvSZH3pTd6/dSzqI2kd8EjJE+Ir06PXQ5c3pDm08BNk973JpInyb8GNtTf282yAFek1/o1yUO+d7d77zSU53pgF3B/uq3r4b0RycTvjwEP0NAboBv3Js13LnAH8Gj686j0+PHAmvT1OSR/Wq9vuE9L03N/k5Z1PUlQmD8N5Wn52bR6f7fKku7PJql0HDHp/YXdG5KAPwq8BjwD3NqiLE2/J0Xel15tHppuZlYR/dIkYmbW9xywzcwqwgHbzKwiHLDNzCrCAdvMuiYd3bhdUiHd+ZRM2lafSKqobp2V4V4iZtY1kt4DvEwyP8y/KiC/lyPi0PwlqybXsM2sayIZKt84DQSSflvST9M5UP5R0qk9Kl7lOGCb2XQbAa6MiHcAXwCuncJ7Z0laJ2mtpA91pXQl1i9ziZhZBaSTZ70b+J/p7AwAM9NzHwH+a5O3bYmID6SvF0Yy4dWbgH+Q9EBEPNbtcpeFA7aZTacB4PmI+NeTT0Qyodaq/d7x+jT1Ca8el3QnyTS3B03AdpOImU2bSGaqfELSx2DfknCLOryNNO0cSfXa+DzgbOChrhW2hBywzaxrJP0A+CVwiqRRSZcClwCXSqpPXJV15aC3AOvS9/0MuCYiDqqA7W59ZmYV4Rq2mVlFOGCbmVWEA7aZWUU4YJuZVYQDtplZRThgm5lVhAO2mVlF/H/+Q87/lQjSMwAAAABJRU5ErkJggg==\n", "text/plain": [ "<Figure size 432x288 with 2 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "# without astrocytes\n", "Ne = 4000; Ni = 1000\n", "Vth = 20 ; taub = 1; taue=20; taui=10; Jee = 280/Ne*taue; Jei=70/Ni*taue; Jie=500/Ne*taui; Jii=100/Ni*taui; Vli=6.5; Vle=7.6; Vr=14;\n", "delaye = 0.5; delayi = 0.25; taude = 23; taure = 8 ;taudi = 1; tauri = 1 \n", "\n", "beta = 1\n", "Ka = 600\n", "\n", "sig = 4.427 ; sige = sig; sigi = sig; \n", "\n", "#ri0 = 0.00029499999999978415; re0 = 0.0002879999999997962 #stable down\n", "ri0 = 0.0012129999999998197; re0 = 0.0008939999999997962 #unstable\n", "#ri0 = 0.0017624999999998384; re0 = 0.0011219999999997961 #stable up\n", "\n", "Lre0=[re0]; Lri0=[ri0]\n", "Lla = []\n", "for re0 in Lre0:\n", " for ri0 in Lri0:\n", " \n", " Ie0 = Vle + taub*(Ne*Jee*re0-Ni*Jei*ri0)-Ka*beta*re0\n", " yte = (Vth-Ie0)/sige; yre = (Vr-Ie0)/sige\n", " Ii0 = Vli + taub*(Ne*Jie*re0-Ni*Jii*ri0)\n", " yti = (Vth-Ii0)/sigi; yri = (Vr-Ii0)/sigi\n", " \n", " LRe = np.concatenate([np.arange(-0.6,-1e-13,1e-2),np.arange(1e-13,0.6,1e-2)])\n", " LIm = np.concatenate([np.arange(-1e-5,-1e-20,1e-6),np.arange(1e-20,1e-5,1e-6)])\n", " \n", " X = np.zeros((len(LRe),len(LIm)),dtype='complex')\n", " Mla = np.zeros((len(LRe),len(LIm)),dtype='complex')\n", " for i in range(len(LRe)):\n", " for j in range(len(LIm)):\n", " la = complex(LRe[i],LIm[j])\n", " Mla[i,j] = la\n", " X[i,j] = taub*Ne*Jee*R(la*taue,yre,yte,re0,sige,taue)*S(la,delaye,taure,taude)*(1+taub*Ni*Jii*R(la*taui,yri,yti,ri0,sigi,taui)*S(la,delayi,tauri,taudi)) - taub*Ni*Jii*R(la*taui,yri,yti,ri0,sigi,taui)*S(la,delayi,tauri,taudi) - taub*Ni*Jei*R(la*taue,yre,yte,re0,sige,taue)*S(la,delayi,tauri,taudi)*Ne*Jie*R(la*taui,yri,yti,ri0,sigi,taui)*S(la,delaye,taure,taude) -1 \n", " eps = 1\n", " id = np.where(np.abs(X.real)+np.abs(X.imag)==np.min(np.abs(X.real)+np.abs(X.imag)))#np.where(np.abs(X.real)+np.abs(X.imag)<eps)\n", " print('X=',X[id],'lambda=',Mla[id])\n", " Lla.append(Mla[id].real)\n", " plt.figure()\n", " plt.imshow(np.abs(X.real)+np.abs(X.imag),aspect='auto',extent=[(Mla.imag)[0,-1],(Mla.imag)[0,0],(Mla.real)[-1,0],(Mla.real)[0,0]])\n", " plt.clim(0,1)\n", " plt.colorbar()\n", " plt.scatter(LIm[id[1]],LRe[id[0]],color='r')\n", "\n", " " ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": 84, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "X= [-0.03078483-1.25337383e-19j] lambda= [0.1+1.e-20j]\n" ] }, { "data": { "text/plain": [ "<matplotlib.collections.PathCollection at 0x7f5afd731a90>" ] }, "execution_count": 84, "metadata": {}, "output_type": "execute_result" }, { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAWgAAAEJCAYAAAC5Tb0qAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAYsUlEQVR4nO3dfbBdVXnH8e/vXhJilFd5CwFqqClIrYhmEF9aRUgNqRra0RlQKdbYDDOi4ks7WGbU1ukMba1T7aDMFSJYGWhVlAwT5a0w1iKYgLwkRAmihUsiIYAgQsy95zz9Y++rh5tz79nn7nXOXTn5fZg9OfvlrP3cfQ/PXWfttdZWRGBmZvkZmu0AzMysPSdoM7NMOUGbmWXKCdrMLFNO0GZmmXKCNjPLVK0ELelASTdI2lz+e0CbY+ZJ+qGkuyVtlPT3dc5pZpY7SaslbZO0oWVbx3w5Wd0a9PnATRGxGLipXJ/sN8CbI+J44JXAMkkn1TyvmVnOLgOWTdpWJV8+T90EvQK4vHx9OXD65AOi8Ey5OqdcPDrGzAZWRHwPeGLS5o75crK9asZxaERsLQPa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lh3qbmWVqUJo4zMwGjhO0mVmmnKDNzDLlBG1mliknaDPrmXL04DZJSbrXSTpK0vUqJq26rxzVObCcoM2sly6jmFohla8C/xIRL6MYmJP9YJM6nKDNrGeiGHreOq0Ckn5f0nfLOUT+R9KxVcqSdBywV0TcUJb9TEQ8mz7qfDhBm1m/jQAfjIhXAx8HvljxfX8A/FLS1ZJ+JOlfJA33LMoMDMpcHGa2Gygnm3od8PVytgOAvct9fwH8Q5u3PRIRb6HIV39MMZPgQ8B/UowOvrS3Uc8eJ2gz66ch4JcR8crJO6KYgOrqXd7xO6PAjyLiQQBJ36Z4qMPAJmg3cZhZ30Qxk+PPJL0TfvuIs+M7vG3COuAASQeX628G7utBmNlwgjaznpF0JfAD4BhJo5JWAu8GVkqamOip0pNxIqJB0WZ9k6R7KSbW+nJvIs+DJ0syM8uUa9BmZplygjYzy5QTtJlZppygzcwy5QRtZpYpJ2gzs0w5QZuZZer/AdsIdcojURD5AAAAAElFTkSuQmCC\n", "text/plain": [ "<Figure size 432x288 with 2 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "# with astrocytes\n", "Ne = 4000; Ni = 1000; Na = 2000; Ca = 0.1\n", "Vth = 20 ; taub = 1; tauba = 1; taue=20; taui=10; tau_astro = 160; Jee = 280/Ne*taue; Jei=70/Ni*taue; Jie=500/Ne*taui; Jii=100/Ni*taui; \n", "Cae = 0.5; Cai = 0.5\n", "Jia = 0.4*11/Na*10*20*taui; Jaa = 2/Na*tau_astro; Jea = 1*11/Na*10*20*taue; \n", "Jai = 3*0.2/22*100/Ni/1.5*(1/Cai)/10*tau_astro; Jae = 0.2/8*400/Ne/1.5*(1/Cae)/10*tau_astro\n", " \n", "Vli=6.5; Vle=7.6; Vr=14; Vla = 7; Vra = 9; Vtha = 13\n", "\n", "siga = 3; delaye = 0.5; delayi = 0.25; delaya = 1e3\n", "taude = 23; taure = 8; taudi = 1; tauri = 1; taura = 8; tauda = 2\n", "beta = 1\n", "Ka = 600\n", "\n", "sig = 3; sige = sig; sigi = sig;\n", "re0 = 0.00121; ri0 = 0.000546225; ra0 = 0.00027 #unstable\n", "LRe = np.concatenate([np.arange(-3e-1,-1e-13,5e-3),np.arange(1e-13,3e-1,5e-3)])\n", "\n", "# re0 = 0.00294; ri0 = 0.0064484; ra0 = 0.00041 #stable up\n", "# LRe = np.concatenate([np.arange(-2e-2,-1e-13,5e-4),np.arange(1e-13,2e-2,5e-4)])\n", "\n", "\n", "Ie0 = Vle + taub*(Ne*Jee*re0-Ni*Jei*ri0) -Ka*beta*re0 + tauba*Ca*Na*Jea*ra0\n", "yte = (Vth-Ie0)/sige; yre = (Vr-Ie0)/sige\n", "Ii0 = Vli + taub*(Ne*Jie*re0-Ni*Jii*ri0) + tauba*Ca*Na*Jia*ra0\n", "yti = (Vth-Ii0)/sigi; yri = (Vr-Ii0)/sigi\n", "Ia0 = Vla + taub*(Cae*Ne*Jae*re0-Cai*Ni*Jai*ri0) + tauba*Na*Jaa*ra0\n", "yta = (Vtha-Ia0)/siga; yra = (Vra-Ia0)/siga\n", "\n", "LIm = np.concatenate([np.arange(-1e-6,-1e-20,1e-7),np.arange(1e-20,1e-6,1e-7)])\n", "\n", "X = np.zeros((len(LRe),len(LIm)),dtype='complex')\n", "Mla = np.zeros((len(LRe),len(LIm)),dtype='complex')\n", "for i in range(len(LRe)):\n", " for j in range(len(LIm)):\n", " la = complex(LRe[i],LIm[j])\n", " Mla[i,j] = la\n", " Fee = taub*Ne*Jee*R(la*taue,yre,yte,re0,sige,taue)*S(la,delaye,taure,taude)\n", " Fii = taub*Ni*Jii*R(la*taui,yri,yti,ri0,sigi,taui)*S(la,delayi,tauri,taudi)\n", " Faa = tauba*Ca*Jaa*R(la*tau_astro,yra,yta,ra0,siga,tau_astro)*S(la,delaya,taura,tauda)\n", " Fie = taub*Ne*Jie*R(la*taui,yri,yti,ri0,sigi,taui)*S(la,delaye,taure,taude)\n", " Fei = taub*Ni*Jei*R(la*taue,yre,yte,re0,sige,taue)*S(la,delayi,tauri,taudi)\n", " Fea = tauba*Ca*Jea*R(la*taue,yre,yte,re0,sige,taue)*S(la,delaya,taura,tauda)\n", " Fia = tauba*Ca*Jia*R(la*taui,yri,yti,ri0,sigi,taui)*S(la,delaya,taura,tauda)\n", " Fae = taub*Ne*Jae*R(la*tau_astro,yra,yta,ra0,siga,tau_astro)*S(la,delaye,taure,taude)\n", " Fai = taub*Ni*Jai*R(la*tau_astro,yra,yta,ra0,siga,tau_astro)*S(la,delayi,tauri,taudi)\n", " \n", " X[i,j] = (Fee-1)*(Fii-1)*(Faa-1)+ Fei*Fia*Fae + Fea*Fie*Fai - (Fee-1)*Fia*Fai - Fei*Fie*(Faa-1) - Fea*(Fii-1)*Fae\n", " \n", "eps = 1\n", "id = np.where(np.abs(X.real)+np.abs(X.imag)==np.min(np.abs(X.real)+np.abs(X.imag)))\n", "print('X=',X[id],'lambda=',Mla[id])\n", "plt.figure()\n", "plt.imshow(np.abs(X.real)+np.abs(X.imag),aspect='auto',extent=[(Mla.imag)[0,-1],(Mla.imag)[0,0],(Mla.real)[-1,0],(Mla.real)[0,0]])\n", "plt.clim(0,10)\n", "plt.colorbar()\n", "plt.scatter(LIm[id[1]],LRe[id[0]],color='r')\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "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.8.3" } }, "nbformat": 4, "nbformat_minor": 4 }