{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import pandas as pd\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": 2, "metadata": {}, "outputs": [], "source": [ "t = 0;dt = 0.005; s4 = 0;\n", "chi=2; ci=chi; s5=0.7; factive=0.2; s7=0.01; s6=1-factive-s7-s4;\n", "tnow =[]\n", "ixnow = []\n", "#S1=[]\n", "\n", "for i in range(1,150000+1):\n", " t = t + dt\n", " ni = 0\n", " if t>30 and t<80:\n", " ni = 100\n", " ci = 2\n", " if t>130 and t<180:\n", " ni = 75\n", " ci = 2\n", " if t>230 and t<280:\n", " ni = 50\n", " ci = 2\n", " if t>330 and t<380:\n", " ni = 30\n", " ci = 2\n", " if t>430 and t<480:\n", " ni = 15\n", " ci = 2\n", " if t>530 and t<580:\n", " ni = 10\n", " ci = 2\n", " if t>630 and t<680:\n", " ni = 5\n", " ci = 2\n", " if t>730 and t<780:\n", " ni = 0\n", " ci = 2\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 \n", " #kinact=1\n", " #kinact=0.2\n", " \n", " s5=s5+ (s6*ci*kcon1-s5*kcoff1+factive*f3n*kinact-s5*0.3) *dt\n", " factive=factive+(s7*ci*kcon2-factive*kcoff2+s5*0.15-factive*f3n*kinact)*dt\n", " s7=s7+(factive*kcoff2+s6*0.1-s7*ci*kcon2-s7*f3n*kinact*25)*dt\n", " s6=1-s5-factive-s7\n", " \n", " #S1.append(s1)\n", " \n", " incx=factive*f3n\n", " tnow.append(t)\n", " ixnow.append(incx)\n" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [], "source": [ "# Data frame for the data extract\n", "df = pd.DataFrame()\n", "df['time'] = tnow\n", "df['current'] = ixnow" ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "(150000, 2)" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "df.shape" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
| \n", " | time | \n", "current | \n", "
|---|---|---|
| 0 | \n", "0.005 | \n", "0.0 | \n", "
| 1 | \n", "0.010 | \n", "0.0 | \n", "
| 2 | \n", "0.015 | \n", "0.0 | \n", "
| 3 | \n", "0.020 | \n", "0.0 | \n", "
| 4 | \n", "0.025 | \n", "0.0 | \n", "