{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import seaborn as sns\n", "from scipy import linalg\n", "from scipy.integrate import odeint\n", "sns.set()\n", "%matplotlib inline" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [], "source": [ "t = 0;dt = 0.0006; s4 = 0;\n", "chi=0; ci=chi; \n", "F1=0.7; F2=0.2; F3=0.01; F4=1-F1-F2-F3;\n", "tnow =[]\n", "ixnow = []\n", "mt = [75,175,275,375,475,575,675,775]\n", "data = []\n", "\n", "f1=[]\n", "f2=[]\n", "f3=[]\n", "f4=[]\n", "\n", "\n", "for i in range(1,150000+1):\n", " t = t + dt\n", " ni = 0\n", " if t>4 and t<8:\n", " ni = 100\n", " ci = 0.1\n", " if t>12 and t<17:\n", " ni = 100\n", " ci = 0.5\n", " if t>22 and t<28:\n", " ni = 100\n", " ci = 5\n", " if t>33 and t<39:\n", " ni = 100\n", " ci = 10\n", " if t>46 and t<53:\n", " ni = 100\n", " ci =20\n", " if t>63 and t<70:\n", " ni = 100\n", " ci = 30\n", " if t>76 and t<83:\n", " ni = 100\n", " ci = 60\n", " #if t>730 and t<780:\n", " #ni = 100\n", " #ci = 0.001\n", " #if t>280 and t<310:\n", " #ni = 100\n", " #ci = 0\n", " #if t>310 and t<340:\n", " #ni = 0\n", " #ci = 0\n", " #if t>340 and t<370:\n", " #ni = 100\n", " #ci = 0\n", " #if t>370 and t<400:\n", " #ni = 0\n", " #ci = 0\n", " #if t>400 and t<430:\n", " #ni = 100\n", " #ci = chi\n", " #if t>430 and t<460:\n", " #ni = 0\n", " #ci = 0\n", " \n", " \n", " f3n=ni**2.5/(ni**2.5+17**2.5)\n", " kcon1=0.1\n", " kcoff1=0.05\n", " kcon2=20 \n", " kcoff2=0.3\n", " kinact=0.2 \n", " #kinact=1\n", " #kinact=0.0 \n", " #kinact=1\n", " #kinact=0.2\n", " \n", " F1=F1+ (F4*ci*kcon1-F1*kcoff1+F2*f3n*kinact-F1*0.3) *dt\n", " F2=F2+(F3*ci*kcon2-F2*kcoff2+F1*0.15-F2*f3n*kinact)*dt\n", " F3=F3+(F2*kcoff2+F4*0.1-F3*ci*kcon2-F3*f3n*kinact*25)*dt\n", " F4=1-F1-F2-F3\n", " \n", " f1.append(F1)\n", " f2.append(F2)\n", " f3.append(F3)\n", " f4.append(F4)\n", " \n", " incx=F2*f3n\n", " \n", " \n", " \n", " tnow.append(t)\n", " ixnow.append(incx)\n", " \n", " data.append({'time':t,\"current\":incx,\"f1\":F1, 'f2':F2, 'f3':F3,'f4':F4})\n" ] }, { "cell_type": "code", "execution_count": 9, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | current | \n", "f1 | \n", "f2 | \n", "f3 | \n", "f4 | \n", "time | \n", "
|---|---|---|---|---|---|---|
| 0 | \n", "0.0 | \n", "0.699853 | \n", "0.200027 | \n", "0.010041 | \n", "0.090079 | \n", "0.0006 | \n", "
| 1 | \n", "0.0 | \n", "0.699706 | \n", "0.200054 | \n", "0.010083 | \n", "0.090157 | \n", "0.0012 | \n", "
| 2 | \n", "0.0 | \n", "0.699559 | \n", "0.200081 | \n", "0.010124 | \n", "0.090236 | \n", "0.0018 | \n", "
| 3 | \n", "0.0 | \n", "0.699412 | \n", "0.200108 | \n", "0.010166 | \n", "0.090314 | \n", "0.0024 | \n", "
| 4 | \n", "0.0 | \n", "0.699265 | \n", "0.200135 | \n", "0.010207 | \n", "0.090393 | \n", "0.0030 | \n", "