BatterySimulatorBLAST/example.ipynb

510 lines
326 KiB
Plaintext
Raw Normal View History

2023-04-08 06:05:55 +09:00
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"### Battery life model library\n",
"Example notebook demonstrating how to use the battery life models in Python.\n",
"\n",
"First examples use the Kokam NMC111|Gr 75Ah battery life model. The battery modeled here is a high-power cell with long cycle life. Because nominal cell resistance is low, the relative change of resistance at end-of-life is quite high compared to other cell designs (~300% increase in cell resistance at 80% capacity if not more). Fade rates can be changed in the code to accomodate other cell models. Documentation is provided in the life model class. See https://ieeexplore.ieee.org/abstract/document/7963578 for the aging test details and results used to parameterize this model."
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"import matplotlib.pyplot as plt\n",
"from nmc111_gr_Kokam75Ah_2017 import Nmc111_Gr_Kokam75Ah_Battery"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"To run, the life model needs timeseries data: the time in seconds since beginning-of-life of the battery, the state-of-charge of the battery (0 to 1), and the ambient temperature (or battery temperature, if you have a thermal model)."
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
2023-04-08 06:11:26 +09:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAmYAAAGwCAYAAAADo6klAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAA9hAAAPYQGoP6dpAACU3klEQVR4nO3dd1zV9ffA8ddlIwKKA5w4SnMPcDa0voqZWdbvm5aW+lUzt4hWjkqzYQvEEWrupjasrGzYcmRuzIG5FSWQcCAqgsDn98fbewEZwuXe+7n3cp6Px+fR5XLv53MgvPfc9zjHoGmahhBCCCGE0J2L3gEIIYQQQghFEjMhhBBCCDshiZkQQgghhJ2QxEwIIYQQwk5IYiaEEEIIYSckMRNCCCGEsBOSm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C4QopzRNY+vWrYCsL7MUScyEU5B1ZrZhHC0LDAzE09Oz6AfmbVI+d67Z16tfv76pF25UVJTZ5yng1VehRg04cgTeesty5xWinDl69CgpKSl4enqa+l6LspHETDgFScxso0Q1zPI2KZ8xw9Sk3FwREREAfPTRRyQmJpbpXCb+/qqmGagmxkeOWOa8QpQzxvVlISEheHh46ByNc5DETDgFScxso0QL//M2KQ8PL/M1O3bsSOfOnbl+/TrvGgvFWsJjj0GPHqqP3qhRYImdn0KUM7K+zPIkMRNOQRIz27jlwv9bNCk3l3HUbMGCBaYG6mVmMKiOAJ6eqrnxqlWWOa8Q5YgxMZP1ZZYjiZlwCpKY2UaxI2YlaFJ
2023-04-08 06:05:55 +09:00
"text/plain": [
2023-04-08 06:11:26 +09:00
"<Figure size 640x480 with 2 Axes>"
2023-04-08 06:05:55 +09:00
]
},
2023-04-08 06:11:26 +09:00
"metadata": {},
2023-04-08 06:05:55 +09:00
"output_type": "display_data"
}
],
"source": [
"years = 10\n",
"hours = years * 365 * 24\n",
"t_hours = np.arange(hours + 1)\n",
"soc = np.tile(\n",
" np.array(\n",
" [1, 1, 1, 1, 1, 1,\n",
" 0.4, 0.4, 0.6, 0.6, 1, 1,\n",
" 0.9, 0.8, 0.7, 0.6, 0.5, 0.4,\n",
" 0.3, 0.2, 0.2, 0.4, 0.6, 0.8]\n",
" ),\n",
" int(len(t_hours/24))\n",
")\n",
"soc = np.append(soc, 1)\n",
"\n",
"TdegC = (\n",
" np.tile(np.concatenate([np.linspace(25, 35, 12), np.linspace(35, 25, 12)]),\n",
" int(len(t_hours)/24))\n",
" + np.tile(np.concatenate([np.linspace(-5, 5, 24*182), np.linspace(5, -5, 24*183)]),\n",
" int(len(t_hours)/(24*365)))\n",
")\n",
"TdegC = np.append(TdegC, 20)\n",
"\n",
"t_secs = t_hours * 3600\n",
"\n",
"fig, ax1 = plt.subplots()\n",
"ax1.plot(t_hours[:25], soc[:25], '-k')\n",
"ax1.set_xlabel('Time (hours)')\n",
"ax1.set_ylabel('State-of-charge')\n",
"\n",
"ax2 = ax1.twinx()\n",
"ax2.plot(t_hours[:25], TdegC[:25], '-r')\n",
"ax2.tick_params(axis='y', labelcolor='r')\n",
"ax2.set_ylabel('Temperature (Celsius)', color='r')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
2023-04-08 06:11:26 +09:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkAAAAGwCAYAAABB4NqyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAA9hAAAPYQGoP6dpAAB8EklEQVR4nO3deXxM5/cH8M+gSSxJCLJJxBoECRVL7LuilqK09lKqpaXaInZaYmntrX7bKrogFKX2KLFUqCDErrbEEqElQSQkmd8ffkYmmZncO3PvfZ5n5rxfr3m1mczcnEkic57tHJ1er9eDEEIIIcSBFGAdACGEEEKI1igBIoQQQojDoQSIEEIIIQ6HEiBCCCGEOBxKgAghhBDicCgBIoQQQojDoQSIEEIIIQ6nEOsAeJSdnY1bt27B1dUVOp2OdTiEEEIIkUCv1+Phw4fw9fVFgQKW53goATLh1q1b8Pf3Zx0GIYQQQqyQmJgIPz8/i4+hBMgEV1dXAM+/gW5uboyjIYQQQogUqamp8Pf3N7yPW0IJkAkvlr3c3NwoASKEEEIEI2X7Cm2CJoQQQojDoQSIEEIIIQ6HEiBCCCGEOBxKgAghhBDicCgBIoQQQojDoQSIEEIIIQ6HEiBCCCGEOBxKgAghhBDicCgBIoQQQojDoQSIEEIIIQ6HmwQoIiICOp0Oo0aNMtyn1+sxdepU+Pr6onDhwmjevDnOnDmT77XWr1+PoKAgODs7IygoCBs3blQxckIIIYSIhosE6OjRo/juu+8QHBxsdP+cOXMwb948LFmyBEePHoW3tzfatGmDhw8fmr1WTEwMevXqhX79+uHkyZPo168fevbsiSNHjqj9MgghhBA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bCBCde3cJm8yfwzb3N4x1iwN6s4nPdQwEuksVeVfyWnxzJQ087M8PM/SW4MSIIHlbnRJCOGLiKN8U/WBeLD677z1dF6YvcP0YRDWJm8yvXcQ4He5949Tt1iHoBlKgAQm4imTlCf2tYYsKhFbCojYuuGXw+IdKx8t4Im7A5fusQ7BpMt3H7MOQbaJv5tP2uwNJUACE7HOyHYB67lY2nsAmC51z7t9F00f6+fZXAFbNyzaw3+T39wyabMxcRCUAAksv2qiPJ6ayK9qK4+j/GUHLB8bX32Ev2KU8fn8bphqKcBa2lPLe0/+5HRphhAiJkqA7NiBf/icFraExxLsP/5lOQGab6awI0sztlmeHUxN52+j684zputD8ex2ingboHkukkr4Z0+/P5QA2bHw9adYhyCbo5RgV9thAWvTiHjCRMR6W/E3+e5DZYq5VjQ5ifjGzOvxfUsu3OHzxJ01KAGyY7cE7PlEiEj+t4/v5qGmzN2Z/14qKQmHlv6UUH/GVKNUlqTsDdxvpsUOK1KSyPlR/M14W4sSIEGJONohxBHxduJOyompK3f5akkyem3+s4O/xZpu/cLKL4fNH9t/Ydx6voponrmV/x7MnWfsZ5aeEiBBPbBQrIpXIk732jMeN8nn50HaU9YhyBZz5V/WIcjG2+k1KcUZeTsVu+jPS/k+Jpmzno1SZgftCSVAglp9NP/RBW9EXDuW2qGet1G+FIn301iHINuG4+K1cAjnbJQvxR8nHacYHnlJxPIYtqAESFBzBKyJMj8q/xERANx/zM8o/4DENfq/r/Kz6VjqLMlijkb5Uvec8DbKlyJJwGrQhDgCSoDsXOJ//IzypTbS+z2On1H+WIkn6XhqiLk2Vlpdot+O8bNn4uo9vvacSCF1dpAQwidKgOzcN9H8jPKlmvYHP6P8+xL3WvHUEHPmNj77IlmyYLe02UGeHBZwb89/HM2uEnGJuBfPFEqA7Nzqv/mrUkxIbltOidciZdwG8epsredo1k+qhH+lz2Lzcjo2I1P67KCc18e
2023-04-08 06:05:55 +09:00
"text/plain": [
2023-04-08 06:11:26 +09:00
"<Figure size 640x480 with 1 Axes>"
2023-04-08 06:05:55 +09:00
]
},
2023-04-08 06:11:26 +09:00
"metadata": {},
2023-04-08 06:05:55 +09:00
"output_type": "display_data"
}
],
"source": [
"plt.plot(t_hours/(24*365), TdegC)\n",
"plt.xlabel('Time (years)')\n",
"plt.ylabel('Temperature (Celsius)')\n",
"plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Instantiate the battery model."
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"cell = Nmc111_Gr_Kokam75Ah_Battery()"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"All battery models have five properties. The first is `_cap`, which is the nominal discharge capacity of the cell in Amp hours."
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"75"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cell._cap"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"The next four track battery lifetime values, and store the history of the battery as lifetime is simulated at each timestep/iteration:\n",
"- `states`: internal states of the battery model\n",
" - Ex., time-dependent capacity loss\n",
"- `outputs`: battery properties calculated from states\n",
" - Ex., relative discharge capacity\n",
"- `stressors`: values of stressors used by the model\n",
" - Ex., temperature, depth-of-discharge, charge-throughput\n",
" - Note that degradation rates are calculate from stressor timeseries, and then normalized for the timestep; for example, an Arrhenius expression would be evaluated from the temperature timeseries for the entire timestep, and then normalized by taking the time-based average - this gives a different value than if the Arrhenius expression was evaluated on the averager temperature. Other normalizations can include using the minimum or maximum value over the timestep, or using the root-mean-square.\n",
"- `rates`: values of degradation rates\n",
" - Ex., time-dependent degradation rate due to temperature and state-of-charge\n",
"\n",
"Battery models may have other properties, such as the open-circuit voltage as a function of state-of-charge, nominal DC resistance values, or first-life/second-life capacity definitions.\n",
"\n",
"This specific battery model is relatively complex, and has many states and outputs that describe the degradation state of the battery. Properties `states`, `outputs`, `stressors`, and `rates` are all stored in dicts:"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'q': array([1]),\n",
" 'q_LLI': array([1]),\n",
" 'q_LLI_t': array([1]),\n",
" 'q_LLI_EFC': array([1]),\n",
" 'q_LAM': array([1.01]),\n",
" 'r': array([1]),\n",
" 'r_LLI': array([1]),\n",
" 'r_LLI_t': array([1]),\n",
" 'r_LLI_EFC': array([1]),\n",
" 'r_LAM': array([1])}"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cell.outputs"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Output descriptions are in the class definition, replicated here:\n",
"- q: relative capacity\n",
"- q_LLI: relative lithium inventory\n",
"- q_LLI_t: relative lithium inventory, time dependent loss\n",
"- q_LLI_EFC: relative lithium inventory, charge-throughput dependent loss\n",
"- q_LAM: relative active material, charge-throughput dependent loss\n",
"- r: relative resistance\n",
"- r_LLI: relative SEI resistance\n",
"- r_LLI_t: relative SEI resistance, time dependent growth\n",
"- r_LLI_EFC: relative SEI resistance, charge-throughput dependent growth\n",
"- r_LAM: relative electrode resistance, q_LAM dependent growth"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"Accesing one output/state/rate/stressor is simple:"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array([1])"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"cell.outputs['q']"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"The battery model should be run in timesteps relavent to battery degradation, such as once per day. Larger or smaller timesteps could be used if desired, but timesteps should avoid splitting up cycles, or at least be long enough that miscounting cycles due to splitting them up does not introduce much error.\n",
"\n",
"Each battery model tracks the history of it's inputs (`stressors`), calculated degradation rates (`rates`), internal states (`states`), and outputs (`outputs`) each time `update_battery_state` is called. Debugging models is easier because the values of all inputs, internal calculations, and outputs are tracked."
]
},
{
"cell_type": "code",
"execution_count": 8,
"metadata": {},
"outputs": [],
"source": [
"t_days = np.arange(years*365)\n",
"for day in t_days:\n",
" hour_start = day*24\n",
" hour_end = (day+1)*24 + 1\n",
" # Update battery state\n",
" cell.update_battery_state(t_secs=t_secs[hour_start:hour_end], soc=soc[hour_start:hour_end], T_celsius=TdegC[hour_start:hour_end])"
]
},
{
"cell_type": "code",
2023-04-08 06:11:26 +09:00
"execution_count": 9,
2023-04-08 06:05:55 +09:00
"metadata": {},
"outputs": [
{
"data": {
2023-04-08 06:11:26 +09:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkAAAAGwCAYAAABB4NqyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAA9hAAAPYQGoP6dpAABbI0lEQVR4nO3deVxU9cIG8GdmYBh2BGRfxF1EEVFBcMk0UMtcKsk1zFzKciFbvG3aW3K1MssFd81yX9OumpR77gi4b4CACCIqu2wz5/2DnO5cUBmY4QDzfD+f+XyaM2cOz8x7a573d875/SSCIAggIiIiMiBSsQMQERER1TYWICIiIjI4LEBERERkcFiAiIiIyOCwABEREZHBYQEiIiIig8MCRERERAbHSOwAdZFKpcKdO3dgaWkJiUQidhwiIiKqAkEQkJeXBxcXF0ilTx/jYQGqxJ07d+Du7i52DCIiIqqG1NRUuLm5PXUfFqBKWFpaAij/Aq2srEROQ0RERFWRm5sLd3d39e/407AAVeLxaS8rKysWICIionqmKpev8CJoIiIiMjgsQERERGRwWICIiIjI4LAAERERkcFhASIiIiKDwwJEREREBocFiIiIiAwOCxAREREZHBYgIiIiMjgsQERERGRwWICIiIjI4LAAERERkcFhASIiIiKDwwJEREREBocFiIiIiAwOCxAREREZHBYgIiIiMjiiFqAjR45gwIABcHFxgUQiwc6dO5/5nsOHD8Pf3x8KhQJNmzbFkiVLKuyzbds2eHt7w8TE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773D
2023-04-08 06:05:55 +09:00
"text/plain": [
2023-04-08 06:11:26 +09:00
"<Figure size 640x480 with 1 Axes>"
2023-04-08 06:05:55 +09:00
]
},
2023-04-08 06:11:26 +09:00
"metadata": {},
2023-04-08 06:05:55 +09:00
"output_type": "display_data"
}
],
"source": [
"plt.plot(cell.stressors['t_days']/365, cell.outputs['q'])\n",
"plt.xlabel('Time (years)')\n",
"plt.ylabel('Relative discharge capacity')\n",
"plt.ylim((0.7, 1.02))\n",
"plt.show()"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"The cell resistance and capacity trajectories are wiggily because the temperature of the battery is varying throughout each year, varying the degradation rate. Dispatch is the same each day, so that is constant.\n",
"\n",
"The model keeps track of how much charge-throughput has occured throughout life, as well, based on the input state-of-charge timeseries. Conversion from charge-throughput, in Amp-hours, to changes of cell state-of-charge, which is dependent on battery performance (health, temperature and SOC dependent resistances), is assumed to happen externally to the model. This simple simulation is essentially assuming that the current magnitude is continuously being adjusted based on the the state-of-health of the battery."
]
},
{
"cell_type": "code",
2023-04-08 06:11:26 +09:00
"execution_count": 10,
2023-04-08 06:05:55 +09:00
"metadata": {},
"outputs": [
{
"data": {
2023-04-08 06:11:26 +09:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkAAAAGwCAYAAABB4NqyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAA9hAAAPYQGoP6dpAABfNklEQVR4nO3deVhU1f8H8PfMwMwAsojIvoiiKCKoqCxuuSRamkt9RXPPSstyIVtsU/tZfG0xzRR3zXLNLSs1MXdxSQTcUQEFEURUdlmcub8/yOk7gcrADBeY9+t57vPEmTOXz1zLeXfuuedIBEEQQERERGREpGIXQERERFTTGICIiIjI6DAAERERkdFhACIiIiKjwwBERERERocBiIiIiIwOAxAREREZHROxC6iN1Go1bt26BUtLS0gkErHLIS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UCgWsrKy0jtrAx8kKrg3NUFSqxqErd8Quh4iIqN4QLQDJ5XIEBAQgKipKqz0qKgohISFPfK+pqSlcXV0hk8mwceNG9O/fH1JpxR9FEATExcXByclJb7XXFIlEopkMvfcib4MRERHpi4mYvzw8PByjRo1Chw4dEBwcjGXLliElJQUTJ04EUHZrKi0tTbPWz5UrV3Dq1CkEBgbi/v37mDdvHs6fP48ffvhBc87Zs2cjKCgIzZs3R25uLr777jvExcVh0aJFonzG6gpt7YBVx5Lx56VMlKrUMJWJfteSiIiozhM1AIWFheHu3bv47LPPkJ6eDl9fX+zatQseHh4AgPT0dK01gVQqFb755hs
2023-04-08 06:05:55 +09:00
"text/plain": [
2023-04-08 06:11:26 +09:00
"<Figure size 640x480 with 1 Axes>"
2023-04-08 06:05:55 +09:00
]
},
2023-04-08 06:11:26 +09:00
"metadata": {},
2023-04-08 06:05:55 +09:00
"output_type": "display_data"
}
],
"source": [
"plt.plot(cell.stressors['efc'], cell.outputs['q'])\n",
"plt.xlabel('Equivalent full cycles')\n",
"plt.ylabel('Relative discharge capacity')\n",
"plt.ylim((0.7, 1.02))\n",
"plt.show()"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"This dispatch has a little more than 1 EFC per day.\n",
"\n",
"We can plot the separate contributions to capacity or resistance fade, as well."
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"(0.7, 1.02)"
]
},
"execution_count": 11,
"metadata": {},
"output_type": "execute_result"
},
{
"data": {
2023-04-08 06:11:26 +09:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkAAAAGwCAYAAABB4NqyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAA9hAAAPYQGoP6dpAABzm0lEQVR4nO3dd1xV9R/H8de9bJkiKjhA3CJOnODIcudKUzQXjs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CjQEmP144QOz4PHt/Vt5nbQ8H39FWbmtqrGE+qTU2B5WOLtyyTdvszV62FqRxFCiPzFzEpf6AwPgk7zoFhFSHgE+6foe4T+mqNfzV6ILJACKJdZ2BQF4MatCJWTCCFEPmVsBnX7wtDj+lNkDlXgyUPw/wrm1NWPEUrVqZ1S5HFSAOUyazv9nBa3I6NUTiKEEPmc1kg/SPrDI9B5AdiU0Z8a2zoMFjeHsKNqJxR5mBRAuczWXr8S/K3w2yonEUKIAkJrBHV6w8cB+uU2zG0h8iwsbwOb3ofHkS8+hih0pADKZc7OLgDcCruhchIhhChgTMz1Y4Q+PqVfaBWNfiHWufXgxDJIlatvxT+kAMpllStXACAyXAogIYTIEZYO0GkuvLsbSntA0mP430hY1QkehKqdTuQRUgDlstpuVcDIhCQZnyeEEDmrtAcM8oe234GxhX4yxYWecOwH6Q0SUgDltvavN8X5k43Y9/iGhGSpgoQQIkdpjaDRB/DhYXBpAsnxsO1TWOsNcffUTidUJAVQLitmZYathSmKAiF349SOI4QQhYN9eei/FdpNAyMzuLoTFjWB0IMvfq0okKQAymUajYaqTvrZKS9GxKicRgghChG
2023-04-08 06:05:55 +09:00
"text/plain": [
2023-04-08 06:11:26 +09:00
"<Figure size 640x480 with 1 Axes>"
2023-04-08 06:05:55 +09:00
]
},
2023-04-08 06:11:26 +09:00
"metadata": {},
2023-04-08 06:05:55 +09:00
"output_type": "display_data"
}
],
"source": [
"plt.plot(cell.stressors['t_days']/365, cell.outputs['q_LLI'])\n",
"plt.plot(cell.stressors['t_days']/365, cell.outputs['q_LAM'])\n",
"plt.plot(cell.stressors['t_days']/365, cell.outputs['q'], '--k')\n",
"plt.xlabel('Time (years)')\n",
"plt.ylabel('Relative discharge capacity')\n",
"plt.legend([r'q$_{LLI}$', r'q$_{LAM}$', 'q'])\n",
"plt.ylim((0.7, 1.02))"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"From the result, the cell will experience sudden failure very shortly; considering this is near 70% remaining capacity, this is physically reasonable."
]
},
{
"cell_type": "code",
2023-04-08 06:11:26 +09:00
"execution_count": 12,
2023-04-08 06:05:55 +09:00
"metadata": {},
"outputs": [
{
"data": {
2023-04-08 06:11:26 +09:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAioAAAGwCAYAAACHJU4LAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAA9hAAAPYQGoP6dpAABVBElEQVR4nO3dd1gT9wMG8DessEFBBMRFxQU40bon7ln3Fq2zbuusrXVUqFStW4tW6t6jauvALS4EByIqqIgTERXCkJHkfn+g/KSiEgxcEt7P8+QhuTsur6lt3n7v7nsSQRAEEBEREWkgPbEDEBEREX0MiwoRERFpLBYVIiIi0lgsKkRERKSxWFSIiIhIY7GoEBERkcZiUSEiIiKNZSB2gC+hVCrx9OlTWFhYQCKRiB2HiIiIckEQBCQmJsLR0RF6ep8eM9HqovL06VOULFlS7BhERESUB48ePYKTk9Mnt9HqomJhYQEg8w9qaWkpchoiIiLKDZlMhpIlS2Z9j3+KVheVd4d7LC0tWVSIiIi0TG5O2+DJtERERKSxWFSIiIhIY7GoEBERkcbS6nNUckuhUCAjI0PsGBrP0NAQ+vr6YscgIiLKotNFRRAExMTEID4+XuwoWsPa2hr29vacl4aIiDSCTheVdyXFzs4Opqam/PL9BEEQkJKSgtjYWACAg4ODyImIiIh0uKgoFIqskmJjYyN2HK1gYmICAIiNjYWdnR0PAxERkeh09mTad+ekmJqaipxEu7z7vHhODxERaQKdLSrv8HCPavh5ERGRJtH5okJERETai0WFiIiINBaLChEREWksFhUtkZ6eLnYEIiIqZM7fi0NymlzUDDp7ebK2a9KkCdzc3GBkZIQNGzbA1dUVp0+fFjsWEREVAi/jE9Gy9xA8NP4KI736YE4nN9GyFKqiIggC3mQoCvx9TQz183Q1zfr16zFy5EicO3cOgiDkQzIiIqLs9p24hL69uiPl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qwCx6KiJW7evImjR49izZo1AIA6depg6NChkEgkWSUFAFxcXBAeHg47Ozv0798fANCzZ08AwNOnT2Frawsjo8LVxomItM1vf27H1JEDIWSkwearKgg5ewylHYqJHUsUEkGLZxKTyWSwsrJCQkICLC0ts61LTU1FVFQUypYtC2Nj3T8rWl34uRERiWvpgYsY901DQCGHo1sdhJ49ChtrC7FjqdWnvr//iyMqREREGkChFPDroVtYc+4lijQZBPv0pwg6vKtQXIL8KSwqREREInsW9xrfbzqP8zGZr2dNm4TRzcrp/GRuucGiQkREJKJDZy6jW7euyFACJb0WYlG/euhUrYTYsTQGqxoREZFIvvdZgXaejZDy4hGQ8QbeLRxYUv6DIypEREQF7LUsCS17D0Xwv9sAAMUreeD0P3tRoayTyMk0D0dUiIiICtDOI2fgVN4tq6Q06zUcD69fYEn5CBYVIiKiAqBQClh56i68Rk9GyvNoGJoXxfw1W3F862oYGfIAx8fwkyEiIspnUXHJmLzzOoKjX6NIy1FwsrfDwU1/wKW0o9jRNB5HVIiIiPKJXK5An/E/o0brngiOfg1zqQEWDWqK22f2s6TkEkdUiIiI8sH5a7fQuUdfvIi8CgDwaN4B/uP7w6mIqcjJtAtHVIiIiNTsh4Vr0LBOLbyIvAqJoTEGTp6Lw95DWFLygCMqWiA9PZ03EiQi0gLxicnw7PEtQg5vBwAUdXbH3zu2okFNV5GTaa9CWVSSk5M/uk5fXz/bzfg+ta2enh5MTEw+ua2ZmZnK+Zo0aQI3NzcYGRlhw4YNcHV1xenTp1XeDxERFZyoF0mo1aApXkYEAwCa9BiKf9Yvg6mxVORk2q1QFhVzc/OPrmvbti3++eefrNd2dnZISUnJcdvGjRvj1KlTWa/LlCmDuLi4bNv
2023-04-08 06:05:55 +09:00
"text/plain": [
2023-04-08 06:11:26 +09:00
"<Figure size 640x480 with 1 Axes>"
2023-04-08 06:05:55 +09:00
]
},
2023-04-08 06:11:26 +09:00
"metadata": {},
2023-04-08 06:05:55 +09:00
"output_type": "display_data"
}
],
"source": [
"plt.plot(cell.stressors['t_days']/365, cell.outputs['r_LLI'])\n",
"plt.plot(cell.stressors['t_days']/365, cell.outputs['r_LAM'])\n",
"plt.plot(cell.stressors['t_days']/365, cell.outputs['r'], '--k')\n",
"plt.xlabel('Time (years)')\n",
"plt.ylabel('Relative DC resistance')\n",
"plt.legend([r'r$_{LLI}$', r'r$_{LAM}$', 'r'])\n",
"plt.show()"
]
},
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"Repeat with other battery life models."
]
},
{
"cell_type": "code",
2023-04-08 06:11:26 +09:00
"execution_count": 13,
2023-04-08 06:05:55 +09:00
"metadata": {},
"outputs": [
{
"data": {
2023-04-08 06:11:26 +09:00
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAkAAAAGwCAYAAABB4NqyAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMiwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8qNh9FAAAACXBIWXMAAA9hAAAPYQGoP6dpAAEAAElEQVR4nOzdd3gUVRfA4d/sZnezyaZX0ikh9N47SBGkWOgQqZbPAggqoiBWUFHEhoA0C1KkC4ig9N4SaaETAiGQAOm9zPfHJAtL6oY04L7PM0+S2Sl3EsKe3HvuuZIsyzKCIAiCIAiPEVV5N0AQBEEQBKGsiQBIEARBEITHjgiABEEQBEF47IgASBAEQRCEx44IgARBEARBeOyIAEgQBEEQhMeOCIAEQRAEQXjsWJR3AyqirKwsrl+/jo2NDZIklXdzBEEQBEEoAlmWiY+Px8PDA5Wq4D4eEQDl4fr163h7e5d3MwRBEARBKIarV6/i5eVV4DEiAMqDjY0NoHwDbW1ty7k1giAIgiAURVxcHN7e3sb38YKIACgPOcNetra2IgASBEEQhIdMUdJXRBK0IAiCIAiPHREACYIgCILw2BEBkCAIgiAIjx0RAAmCIAiC8NgRAZAgCIIgCI8dEQAJgiAIgvDYEQGQIAiCIAiPHREACYIgCILw2BEBkCAIgiAIjx0RAAmCIAiC8NgRAZA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V9Cw6GgdyjnVlZsFlqtMS8oL1lZmSTFxBB/+5YSKN2KMn4en/15Ykw0GelpxNyIIOZGRL730llZ3xMYOWPr7IqNs4uxF8n
2023-04-08 06:05:55 +09:00
"text/plain": [
2023-04-08 06:11:26 +09:00
"<Figure size 640x480 with 1 Axes>"
2023-04-08 06:05:55 +09:00
]
},
2023-04-08 06:11:26 +09:00
"metadata": {},
2023-04-08 06:05:55 +09:00
"output_type": "display_data"
}
],
"source": [
"from lfp_gr_SonyMurata3Ah_2018 import Lfp_Gr_SonyMurata3Ah_Battery\n",
"from nmc111_gr_Sanyo2Ah_2014 import Nmc111_Gr_Sanyo2Ah_Battery\n",
"from nmc811_grSi_LGMJ1_4Ah_2020 import Nmc811_GrSi_LGMJ1_4Ah_Battery\n",
"from nca_gr_Panasonic3Ah_2018 import Nca_Gr_Panasonic3Ah_Battery\n",
"from nmc_lto_10Ah_2020 import Nmc_Lto_10Ah_Battery\n",
"from lmo_gr_NissanLeaf66Ah_2ndLife_2020 import Lmo_Gr_NissanLeaf66Ah_2ndLife_Battery\n",
"\n",
"cell_nmc_kokam = Nmc111_Gr_Kokam75Ah_Battery()\n",
"cell_lfp = Lfp_Gr_SonyMurata3Ah_Battery()\n",
"cell_nmc_sanyo = Nmc111_Gr_Sanyo2Ah_Battery()\n",
"cell_nmc811_grSi = Nmc811_GrSi_LGMJ1_4Ah_Battery()\n",
"cell_nca = Nca_Gr_Panasonic3Ah_Battery()\n",
"cell_nmc_lto = Nmc_Lto_10Ah_Battery()\n",
"cell_lmo = Lmo_Gr_NissanLeaf66Ah_2ndLife_Battery()\n",
"\n",
"for day in t_days:\n",
" hour_start = day*24\n",
" hour_end = (day+1)*24 + 1\n",
" # NMC Kokam\n",
" cell_nmc_kokam.update_battery_state(t_secs=t_secs[hour_start:hour_end], soc=soc[hour_start:hour_end], T_celsius=TdegC[hour_start:hour_end])\n",
" # LFP\n",
" cell_lfp.update_battery_state(t_secs=t_secs[hour_start:hour_end], soc=soc[hour_start:hour_end], T_celsius=TdegC[hour_start:hour_end])\n",
" # NMC Sanyo\n",
" cell_nmc_sanyo.update_battery_state(t_secs=t_secs[hour_start:hour_end], soc=soc[hour_start:hour_end], T_celsius=TdegC[hour_start:hour_end])\n",
" # LG MJ1 NMC811 GrSi\n",
" cell_nmc811_grSi.update_battery_state(t_secs=t_secs[hour_start:hour_end], soc=soc[hour_start:hour_end], T_celsius=TdegC[hour_start:hour_end])\n",
" # NCA Panasonic\n",
" cell_nca.update_battery_state(t_secs=t_secs[hour_start:hour_end], soc=soc[hour_start:hour_end], T_celsius=TdegC[hour_start:hour_end])\n",
" # NMC LTO\n",
" cell_nmc_lto.update_battery_state(t_secs=t_secs[hour_start:hour_end], soc=soc[hour_start:hour_end], T_celsius=TdegC[hour_start:hour_end])\n",
" # LMO Nissan Leaf\n",
" cell_lmo.update_battery_state(t_secs=t_secs[hour_start:hour_end], soc=soc[hour_start:hour_end], T_celsius=TdegC[hour_start:hour_end])\n",
"\n",
"plt.plot(cell_nmc_kokam.stressors['t_days']/365, cell_nmc_kokam.outputs['q'])\n",
"plt.plot(cell_lfp.stressors['t_days']/365, cell_lfp.outputs['q'])\n",
"plt.plot(cell_nmc_sanyo.stressors['t_days']/365, cell_nmc_sanyo.outputs['q'])\n",
"plt.plot(cell_nmc811_grSi.stressors['t_days']/365, cell_nmc811_grSi.outputs['q'])\n",
"plt.plot(cell_nca.stressors['t_days']/365, cell_nca.outputs['q'])\n",
"plt.plot(cell_nmc_lto.stressors['t_days']/365, cell_nmc_lto.outputs['q'])\n",
"plt.plot(cell_lmo.stressors['t_days']/365, cell_lmo.outputs['q'])\n",
"plt.xlabel('Time (years)')\n",
"plt.ylabel('Relative discharge capacity')\n",
"plt.legend(['NMC-Gr (Kokam)','LFP-Gr (Sony Murata)', 'NMC-Gr (Sanyo)', 'NMC811-GrSi (LG MJ1)', 'NCA-Gr (Panasonic)', 'NMC-LTO', 'LMO-Gr (2nd Life) (Leaf)'])\n",
"plt.ylim((0.7, 1.02))\n",
"plt.show()"
]
}
],
"metadata": {
"kernelspec": {
2023-04-08 06:11:26 +09:00
"display_name": "base",
2023-04-08 06:05:55 +09:00
"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",
2023-04-08 06:11:26 +09:00
"version": "3.9.13"
2023-04-08 06:05:55 +09:00
},
2023-04-08 06:11:26 +09:00
"orig_nbformat": 4,
"vscode": {
"interpreter": {
"hash": "e4cce46d6be9934fbd27f9ca0432556941ea5bdf741d4f4d64c6cd7f8dfa8fba"
}
}
2023-04-08 06:05:55 +09:00
},
"nbformat": 4,
"nbformat_minor": 2
}