{ "cells": [ { "cell_type": "markdown", "metadata": { "cell_style": "center", "slideshow": { "slide_type": "slide" } }, "source": [ "\n", "\n", "# Class 7: System dynamics models: Growth and decay\n", "\n", "---\n", "\n", "\n", "\n", "This notebook is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](http://creativecommons.org/licenses/by-sa/4.0/)." ] }, { "cell_type": "markdown", "metadata": { "cell_style": "center", "slideshow": { "slide_type": "slide" } }, "source": [ "## Load packages" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "cell_style": "center", "slideshow": { "cell_style": "split", "slide_type": "-" } }, "outputs": [], "source": [ "%matplotlib inline\n", "\n", "import matplotlib.pyplot as plt\n", "import numpy as np\n", "import pandas as pd" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "## Growth model for bacterial colony\n", "\n", "Iteratively solve the difference equation using numerical methods\n", "\n", "\\begin{equation}\n", "P(t)=P(t-\\Delta{}t)-rP(t-\\Delta{}t)\\Delta{}t\n", "\\end{equation}\n", "\n", "Assume the following constants:\n", "\n", "```python\n", "population = 100\n", "r = 0.1\n", "delta_t = 0.001\n", "time_of_simulation = 50.5\n", "```" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "### Class-led solution\n", "\n", "How do I handle this in Python?" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Define our constants:" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "slideshow": { "slide_type": "fragment" } }, "outputs": [], "source": [ "population = 100\n", "r = 0.1\n", "delta_t = 0.001\n", "time_of_simulation = 50.5" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Define a list to store our simulation history." ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "slideshow": { "slide_type": "fragment" } }, "outputs": [], "source": [ "trace = [[0, population]]" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Iteratively solve the difference equation using a `for` loop and store the `[time_step, population]` pair in `trace`:" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "slideshow": { "slide_type": "fragment" } }, "outputs": [], "source": [ "for time_step in range(1, int(time_of_simulation / delta_t) + 1):\n", " population = population + r * population * delta_t\n", " trace.append([time_step, population])" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Convert our results into a DataFrame.\n", "\n", "**How can we extract out the first column and the second column of `trace`?**\n", "\n", "Remember, these are not `numpy` arrays!" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "We use list comprehensions, for example:\n", "\n", "```\n", "[time_step[0] for time_step in trace]\n", "```\n", "\n", "This is equivalent to the following:\n", "\n", "```python\n", "column_one = []\n", "for time_step in trace:\n", " column_one.append(time_step[0])\n", "```" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "With list comprehensions, we can feed each column into `pd.DataFrame` as follows:" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "bacteria_df = pd.DataFrame({\n", " \"time_step\": [time_step[0] for time_step in trace],\n", " \"population\": [time_step[1] for time_step in trace]\n", "})" ] }, { "cell_type": "code", "execution_count": 6, "metadata": { "slideshow": { "slide_type": "slide" } }, "outputs": [ { "data": { "text/html": [ "<div>\n", "<style scoped>\n", " .dataframe tbody tr th:only-of-type {\n", " vertical-align: middle;\n", " }\n", "\n", " .dataframe tbody tr th {\n", " vertical-align: top;\n", " }\n", "\n", " .dataframe thead th {\n", " text-align: right;\n", " }\n", "</style>\n", "<table border=\"1\" class=\"dataframe\">\n", " <thead>\n", " <tr style=\"text-align: right;\">\n", " <th></th>\n", " <th>time_step</th>\n", " <th>population</th>\n", " </tr>\n", " </thead>\n", " <tbody>\n", " <tr>\n", " <th>0</th>\n", " <td>0</td>\n", " <td>100.000000</td>\n", " </tr>\n", " <tr>\n", " <th>1</th>\n", " <td>1</td>\n", " <td>100.010000</td>\n", " </tr>\n", " <tr>\n", " <th>2</th>\n", " <td>2</td>\n", " <td>100.020001</td>\n", " </tr>\n", " <tr>\n", " <th>3</th>\n", " <td>3</td>\n", " <td>100.030003</td>\n", " </tr>\n", " <tr>\n", " <th>4</th>\n", " <td>4</td>\n", " <td>100.040006</td>\n", " </tr>\n", " </tbody>\n", "</table>\n", "</div>" ], "text/plain": [ " time_step population\n", "0 0 100.000000\n", "1 1 100.010000\n", "2 2 100.020001\n", "3 3 100.030003\n", "4 4 100.040006" ] }, "execution_count": 6, "metadata": {}, "output_type": "execute_result" } ], "source": [ "bacteria_df.head()" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "`time_step` is just the iteration index for each step of the simulation. To convert back to \"real\" time, multiply `time_step` by `delta_t`. With our Pandas data frame, this is simple to do:" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "bacteria_df[\"time\"] = bacteria_df[\"time_step\"] * delta_t" ] }, { "cell_type": "markdown", "metadata": { "slideshow": { "slide_type": "slide" } }, "source": [ "Finally, we should visualize the results of our simulation. Here's how to do it in `matplotlib`:" ] }, { "cell_type": "code", "execution_count": 8, "metadata": { "slideshow": { "slide_type": "slide" } }, "outputs": [ { "data": { "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZAAAAELCAYAAAD3HtBMAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMi4zLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvIxREBQAAIABJREFUeJzt3Xt8VPWd//HXJ9chGcIQhiQkMQEVRBQvGBW81Cv2Ym+2WtvSWmu3dHd7sd26u21/bm37623dXfvTXrbbrtXam9VatbbVgpdqq6IERUFIEYHEJCRhCEMYwiSZzPf3xxziCAlkIpOZSd7Px2MeM/M9n5Pz+XpiPpzzPed7zDmHiIhIq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ERETGRAVERETGRAVERETGRAVERETG5P8DwRmqCpsuCgEAAAAASUVORK5CYII=\n", "text/plain": [ "<Figure size 432x288 with 1 Axes>" ] }, "metadata": { "needs_background": "light" }, "output_type": "display_data" } ], "source": [ "fig, ax = plt.subplots() # Define an \"axis\" object for more control over plot\n", "\n", "ax.plot(bacteria_df[\"time_step\"], bacteria_df[\"population\"]);\n", "\n", "# Don't forget to label your plot!\n", "ax.set_xlabel(\"time\")\n", "ax.set_ylabel(\"population\");" ] } ], "metadata": { "celltoolbar": "Slideshow", "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.6.5" }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }