218 lines
217 KiB
Plaintext
218 lines
217 KiB
Plaintext
|
{
|
||
|
"cells": [
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 13,
|
||
|
"id": "fecaca5d",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"%matplotlib inline\n",
|
||
|
"\n",
|
||
|
"import numpy as np\n",
|
||
|
"import matplotlib.pyplot as plt\n",
|
||
|
"\n",
|
||
|
"def plot_style(figsize=(12, 6), labelsize=20, titlesize=24, ticklabelsize=14, **kwargs):\n",
|
||
|
" basic_style = {\n",
|
||
|
" 'figure.figsize': figsize,\n",
|
||
|
" 'axes.labelsize': labelsize,\n",
|
||
|
" 'axes.titlesize': titlesize,\n",
|
||
|
" 'xtick.labelsize': ticklabelsize,\n",
|
||
|
" 'ytick.labelsize': ticklabelsize,\n",
|
||
|
" }\n",
|
||
|
" basic_style.update(kwargs)\n",
|
||
|
" return plt.rc_context(rc=basic_style)\n"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 20,
|
||
|
"id": "21292898",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"def logistic_map(x, r):\n",
|
||
|
" return r * x * (1 - x)\n",
|
||
|
"\n",
|
||
|
"def iterate_map(x0, r, n):\n",
|
||
|
" xs = [x0]\n",
|
||
|
" for _ in range(n):\n",
|
||
|
" x_np1 = logistic_map(xs[-1], r)\n",
|
||
|
" xs.append(x_np1)\n",
|
||
|
" return xs"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 43,
|
||
|
"id": "c2de665f",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": [
|
||
|
"x = np.linspace(0, 1, 100)\n",
|
||
|
"r = 1.5\n",
|
||
|
"f_x = logistic_map(x, r)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 44,
|
||
|
"id": "e4f218ce",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfEAAAHxCAYAAAB9MoV9AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAABgrUlEQVR4nO3deZxN9R/H8dedfYyZMQyy7ztjC8lOKFTaLRWVpYVKaaGEEGn9lVZEJUVpUcpulC0j+y4GYzeMmTHMes/vj9NMZJvhzpx77ryfj8c8Muec+72fe0ze8z3ne75fh2EYBiIiImI7XlYXICIiIldHIS4iImJTCnERERGbUoiLiIjYlEJcRETEphTiIiIiNqUQFxERsSmFuIiIiE0pxEVERGxKIS4iImJTCnERyVNOp5OtW7cydepUHn/8cRo1aoS/vz8OhwOHw0FkZKTL3qt8+fJZ7V7uq3z58i57T5G85GN1ASKSv3z55Zf07t3b6jJEPIJCXETy1LlrLvn6+lK7dm3S09PZtGlTrr3n7bffzujRoy+538/PL9feWyQ3KcRFJE/VrFmT//3vfzRu3Jh69eoREBDAiBEjcjXECxUqRO3atXOtfRGrKMRFJE81btyYxo0bW12GiEfQwDYRNzZixIiswVcA8fHxjBo1ivr161OoUCEcDgdTp061tkgRsYx64iI2sWvXLjp06MDevXutLkVE3IRCXMQm7r77bg4ePMjAgQO57bbbCAsLY9euXZQrV87q0tze77//TkREBLt378YwDIoXL07jxo3p3r07t99+e9aVDhG7UYiL2MTmzZuZO3cu7du3z9rWsGHDHLfTu3dvPv/882uqpVWrVi59nju3RUdHn/f93r172bt3LzNnzqRZs2bMmDGDUqVKWVSdyNVTiIvYRO/evc8LcLkyPz8/brvtNjp06EDt2rUJDQ3l1KlTrFy5ko8++oiYmBiWL19O+/btWblyJaGhoVaXLJIjCnERm+jZs6dL2hkzZgyDBw++pjaCgoJcUktuW716NY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q3EJzdgmIiKe7cwZcya29983VyMLCrK6IpdRT1xERDzX8uXmJC6rV4O3t0cFOCjERUTEUy1bBjffDDVqmAPZPJBCXEREPM8ff5gB3qgR/PKLx/XAMynERUTEs6Snw8MPQ5MmHh3goIFtIiLiSQwDfHzMR8hKlDAHtHkw9cRFRMQzLFkCnTrB6dNQqZLHBzgoxEVExBMsXgydO5vzoXt7W11NnlGIi4iIvS1aZAZ4y5bw448QGGh1RXlGIS4iIva1bx906QKtW+e7AAcNbBMRETsrVw6mToXbb4eAAKuryXPqiYuIiP3MmwcTJ5p/vu++fBngoBAXERG7mTvX7Hn//LP5SFk+phAXERH7+O03M8A7dIBvvwWHw+qKLKUQFxERe1iyBLp2NadT/e478Pe3uiLLKcRFRMQeIiLgqafMHrifn9XVuAWFuIiIuLd582D/fihSBMaPV4CfQyEuIiLua/ZsuPVWeOstqytxSwpxERFxTz/+CHffbQ5ke/NNq6txSwpxERFxPz/8APfcYw5kmz4dfH2trsgtKcRFRMT9OBzQrZsC/AoU4iIi4j7WrTMncOnaFb780lwbXC5JIS4iIu7h22+hUSOYNs3qSmxDIS4iItabORO6dzcvoXfvbnU1tqEQFxERa82YAT16mF+ff65L6DmgEBcREesYBsyaBT17wpQp4O1tdUW2ol93RETEGqdOQaFC8NVX4OWlAL8K6omLiEjemzYNKlSAnTvNR8gU4FdFIS4iInnryy/hwQfhzjuhcmWrq7E1hbiIiOSdzz+HXr3gkUdg4kTzMrpcNZ09ERHJGwkJ8Nx
|
||
|
"text/plain": [
|
||
|
"<Figure size 500x500 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"with plot_style(figsize=(5, 5), titlesize=20):\n",
|
||
|
" plt.plot(x, f_x)\n",
|
||
|
" plt.plot([0, 1], [0, 1], 'r--', lw=1)\n",
|
||
|
" plt.xlim(0, 1)\n",
|
||
|
" plt.ylim(0, 1)\n",
|
||
|
" plt.xlabel('x')\n",
|
||
|
" plt.ylabel('f(x)')\n",
|
||
|
" plt.title(f'r = {r}')"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 84,
|
||
|
"id": "3b666ffc",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAeEAAAHxCAYAAABanASVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAABSJElEQVR4nO3deVxU5f4H8M8Zhhm2mWHTBEXcQBQ3clcWcSO1xbzmRanUXLLF7jW79XMLSEure+1er7cVQ8s0rWyzUnMZFdPcckURFRTJbRQGRAQGzu8PYmKcAQcYODPweb9e8wKe5znP+c5Efji7IIqiCCIiImpwMqkLICIiaqoYwkRERBJhCBMREUmEIUxERCQRhjAREZFEGMJEREQSYQgTERFJhCFMREQkEYYwERGRRBjCREREEmEIE1GDKisrQ2pqKlauXIlnn30WvXv3hlKphCAIEAQBWq3WZutq06aNcd7qXm3atLHZOolqQi51AUTUtHz66aeYNGmS1GUQ2QWGMBE1qMrPjHF2dkaXLl1gMBhw/PjxelvnI488gkWLFlXZr1Ao6m3dRNVhCBNRg+rcuTP+85//oE+fPujRowdcXFyQkJBQryHs6emJLl261Nv8RLXFECaiBtWnTx/06dNH6jKI7AJPzCKyYwkJCcaThwBAr9dj4cKFCAsLg6enJwRBwMqVK6UtkohqjVvCRA4iPT0dw4cPR2ZmptSlEJGNMISJHMTYsWORnZ2NmTNn4uGHH4aXlxfS09MRGBgodWl2b9euXejWrRvOnTsHURRx3333oU+fPhg/fjweeeQR454GoobGECZyECdOnMCmTZswbNgwY1vPnj1rPM+kSZOwatWqOtUSFRVl0+t561tGRobJz5mZmcjMzMT69esxcOBArFu3Di1bt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kYGBgodunSRVQoFCIAsVOnTuLVq1et+zCsZG0ecEuYiMhBeHl5Yfbs2QCAxMREY/u2bdvw9NNPw93dHRs3bqx2a7E2JkyYAABYu3atxf6K9r/85S9QKBTG9hkzZuDYsWPIyclBamoqDh06hGvXruGbb76Bq6srnnnmGeTn59u0Vkuefvpp7Nq1C0OGDEF6ejoyMzNx/PhxXLlyBWPGjMGpU6fw3HPP1XsdFtk0+ps4bgkTUX3Ly8szbk1qtVrx+PHjokajEZ2cnMSNGzfWyzozMzNFQRBEd3d3saCgwKw/JCREBCBu27bN6jnnz58vArC4NWzLLeGjR48al8vLyzNbpqCgQAwICBAFQRAzMzOtrv9euCVMRNQIqVQqvPLKKwCA//u//8OoUaOg1+vxv//9D6NGjTIbn5mZiUceeQQqlQpeXl544oknoNPparTOwMBADBgwAAUFBSbHfAHgt99+w+nTp+Hn54dBgwaZLXvx4kUsWbIE48aNw+DBgxEeHo7w8HCsW7cOAHD06NEa1VJTX3/9NQBg3LhxUKlUZv1ubm4YOnQoRFHE7t2767UWS+QNvkYiIqqT5557DkuXLsW+ffsAlIfx008/bTbu1q1biI6Oho+PD9auXYvCwkJjcO/duxcymfXbYRMmTMCePXuwdu1axMbGGtsrdkX/9a9/NZtv1apVmDFjBu7cuVPlvDdv3rS6hto4fvw4gPIwrupksAsXLgAAsrOz67UWSxjCREQOpqioCCqVCpcvX0azZs2waNEii+M++OADXL58Gb/88gv8/PwAlN8Ssk+fPvj222/x6KOPWr3OcePG4W9/+xs2bdqEnJwceHl5QRRF4xZtxXHjCufOncO0adNQUlKC2bNn4/HHH0f79u3h4eEBQRCQlJRk7K9Per0eAHD27FmcPXu22rGFhYX1Wosl3B1NRORAiouLMWbMGJw
|
||
|
"text/plain": [
|
||
|
"<Figure size 500x500 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"r = 1.5\n",
|
||
|
"xs_01 = iterate_map(x0=0.1, r=r, n=20)\n",
|
||
|
"xs_03 = iterate_map(x0=0.3, r=r, n=20)\n",
|
||
|
"xs_05 = iterate_map(x0=0.4, r=r, n=20)\n",
|
||
|
"with plot_style(figsize=(5, 5), titlesize=20):\n",
|
||
|
" plt.plot(xs_01, lw=3, label=0.1)\n",
|
||
|
" plt.plot(xs_03, lw=3, label=0.3)\n",
|
||
|
" plt.plot(xs_05, lw=3, label=0.5)\n",
|
||
|
" plt.ylim(0, 1)\n",
|
||
|
" plt.xticks([0, 5, 10, 15, 20])\n",
|
||
|
" plt.xlabel('iteration')\n",
|
||
|
" plt.ylabel('x')\n",
|
||
|
" plt.title(f'r = {r}')\n",
|
||
|
" plt.legend(title='$x_0$ value', fontsize=14, title_fontsize=16, frameon=False)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 85,
|
||
|
"id": "782fd773",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAeEAAAHxCAYAAABanASVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAAAACXBIWXMAAA9hAAAPYQGoP6dpAAC6yElEQVR4nOydeXxU5b3/P2fW7JPJvpIQCPsqu6CCGxbrVpci2Na2avVW78+22l61FhCr1m63LdpasajX4tKKrdWqWDEgioDsWyBAErLvmck66/n9cTKTeZ5zzixhJjOJ3/frxUvnzJkzT5KZ83m+uyCKogiCIAiCIIYdTbQXQBAEQRBfVkiECYIgCCJKkAgTBEEQRJQgESYIgiCIKEEiTBAEQRBRgkSYIAiCIKIEiTBBEARBRAkSYYIgCIKIEiTCBEEQBBElSIQJgiAIIkroor0AgiC+XJw4cQIfffQR9u7diyNHjqC5uRmtra3QarXIzs7GvHnzsGrVKlx77bUQBOG83uvkyZP497//je3b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CIKIEiTBBEARBRAkSYYIgCIKIEiTCBEEQBBElSIQJgiAIIkqQCBMEQRBElCARJgiCIIgoQSJMEARBEFGCRJggCIIgogSJMEEQBEFECRJhgiAIgogSJMIEQRAEESVIhAmCIAgiSpAIEwRBEESUIBEmCIIgiChBIkwQBEEQUWJEi/DevXuxYsUKmM1mJCYmYv78+di8eXNI1+js7MTPfvYzzJgxA8nJycjIyMC
|
||
|
"text/plain": [
|
||
|
"<Figure size 500x500 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"r = 3.2\n",
|
||
|
"xs_01 = iterate_map(x0=0.1, r=r, n=20)\n",
|
||
|
"xs_03 = iterate_map(x0=0.3, r=r, n=20)\n",
|
||
|
"xs_05 = iterate_map(x0=0.4, r=r, n=20)\n",
|
||
|
"with plot_style(figsize=(5, 5), titlesize=20):\n",
|
||
|
" plt.plot(xs_01, lw=3, label=0.1)\n",
|
||
|
" plt.plot(xs_03, lw=3, label=0.3)\n",
|
||
|
" plt.plot(xs_05, lw=3, label=0.5)\n",
|
||
|
" plt.ylim(0, 1)\n",
|
||
|
" plt.xticks([0, 5, 10, 15, 20])\n",
|
||
|
" plt.xlabel('iteration')\n",
|
||
|
" plt.ylabel('x')\n",
|
||
|
" plt.title(f'r = {r}')\n",
|
||
|
" plt.legend(title='$x_0$ value', fontsize=14, title_fontsize=16, frameon=False)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": 86,
|
||
|
"id": "dd04eb9b",
|
||
|
"metadata": {},
|
||
|
"outputs": [
|
||
|
{
|
||
|
"data": {
|
||
|
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAeEAAAHxCAYAAABanASVAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjcuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/bCgiHAA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YjFMTU3hxRdfRL1e5x7Xa8F6bdiDBw8ePHhwGy/bIAwAF1xwAQqFAh588EHusR//+MfN53jw4MGDBw+9wMsiCKdSKezZswepVIq5/wMf+ACAhvuWPkAcAO6++278+Mc/xvnnn48TTjihr8fqwYMHDx5ePti0NeGbb74ZDzzwAADgqaeeat63e/duAMDll1+Oyy+/HABw00034frrr8e1116L6667rvkaF154Id73vvfh5ptvxplnnonLLrsMCwsL+Ld/+zckk0n88z//cz8/kgcPHjx4eJlh0wbhBx54AF/96leZ+x588MEmtXzsscc2g7AZvvjFL2LXrl344he/iC984QuIx+N461vfiv/xP/6HlwV78ODBg4eewpsn7CKy2SwGBgaQyWQ8dbQHDx48vIxhNR5s2kzYgwcPGw/lWh3f/NUMFFXDlWdvRzToLTEePJjBu0I8ePCAfDWPG391I55cehIXbb8IHznzI/DL9peHj9z+GH763CIA4KfPLeCbHzjH7UP14OGowstCHe3BgwdzfGPPN3DH/jtwMHsQtzx9Cx48zLftdUKmVGsGYAB46MAKFnNlNw/Tg4ejDl4Q9uDBAx5ZeIS5/fj
|
||
|
"text/plain": [
|
||
|
"<Figure size 500x500 with 1 Axes>"
|
||
|
]
|
||
|
},
|
||
|
"metadata": {},
|
||
|
"output_type": "display_data"
|
||
|
}
|
||
|
],
|
||
|
"source": [
|
||
|
"r = 3.9\n",
|
||
|
"xs_01 = iterate_map(x0=0.1, r=r, n=20)\n",
|
||
|
"xs_03 = iterate_map(x0=0.3, r=r, n=20)\n",
|
||
|
"xs_05 = iterate_map(x0=0.4, r=r, n=20)\n",
|
||
|
"with plot_style(figsize=(5, 5), titlesize=20):\n",
|
||
|
" plt.plot(xs_01, lw=3, label=0.1)\n",
|
||
|
" plt.plot(xs_03, lw=3, label=0.3)\n",
|
||
|
" plt.plot(xs_05, lw=3, label=0.5)\n",
|
||
|
" plt.ylim(0, 1)\n",
|
||
|
" plt.xticks([0, 5, 10, 15, 20])\n",
|
||
|
" plt.xlabel('iteration')\n",
|
||
|
" plt.ylabel('x')\n",
|
||
|
" plt.title(f'r = {r}')\n",
|
||
|
" plt.legend(title='$x_0$ value', fontsize=14, title_fontsize=16, frameon=False)"
|
||
|
]
|
||
|
},
|
||
|
{
|
||
|
"cell_type": "code",
|
||
|
"execution_count": null,
|
||
|
"id": "78d8e347",
|
||
|
"metadata": {},
|
||
|
"outputs": [],
|
||
|
"source": []
|
||
|
}
|
||
|
],
|
||
|
"metadata": {
|
||
|
"kernelspec": {
|
||
|
"display_name": "Python 3 (ipykernel)",
|
||
|
"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.11.3"
|
||
|
}
|
||
|
},
|
||
|
"nbformat": 4,
|
||
|
"nbformat_minor": 5
|
||
|
}
|