Define battery capacity #1635
-
I'm trying to simulate a constant current discharge for three different battery capacities (see example code below). I set the battery capacity using the import matplotlib.pyplot as plt
import pybamm
plt.style.use('default')
# Parameters
# ----------------------------------------------------------------------------
discharge = 1.8
capacities = [0.60, 0.70, 0.80]
# Simulations
# ----------------------------------------------------------------------------
t = []
capacity = []
current = []
voltage = []
for i in range(len(capacities)):
model = pybamm.lithium_ion.SPMe()
param = model.default_parameter_values
param['Nominal cell capacity [A.h]'] = capacities[i]
param['Current function [A]'] = '[input]'
sim = pybamm.Simulation(model, parameter_values=param)
sim.solve([0, 4000], inputs={'Current function [A]': discharge})
t.append(sim.solution['Time [s]'].entries)
capacity.append(sim.solution['Discharge capacity [A.h]'].entries)
current.append(sim.solution['Current [A]'].entries)
voltage.append(sim.solution["Terminal voltage [V]"].entries)
# Plot
# ----------------------------------------------------------------------------
_, ax = plt.subplots(tight_layout=True)
for i in range(len(capacities)):
ax.plot(t[i], voltage[i], label=f'{capacities[i]} Ah')
ax.set_xlabel('Time [s]')
ax.set_ylabel('Terminal voltage [V]')
ax.legend(loc='best')
_, ax = plt.subplots(tight_layout=True)
for i in range(len(capacities)):
ax.plot(t[i], capacity[i], label=f'{capacities[i]} Ah')
ax.set_xlabel('Time [s]')
ax.set_ylabel('Capacity [Ah]')
ax.legend(loc='best')
_, ax = plt.subplots(tight_layout=True)
for i in range(len(capacities)):
ax.plot(capacity[i], voltage[i], label=f'{capacities[i]} Ah')
ax.set_xlabel('Capacity [Ah]')
ax.set_ylabel('Voltage [V]')
ax.legend(loc='best')
plt.show() |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Nominal capacity is just nominal, used to convert between "C-rate" and "current". The easiest way to just change capacity is to change the area of the cell (electrode height or width). If you want to change the areal capacity (Ah/m2) you can change the thickness of either electrode or the active material volume fraction. Then see this notebook for calculating the theoretical capacity between voltage limits |
Beta Was this translation helpful? Give feedback.
Nominal capacity is just nominal, used to convert between "C-rate" and "current". The easiest way to just change capacity is to change the area of the cell (electrode height or width). If you want to change the areal capacity (Ah/m2) you can change the thickness of either electrode or the active material volume fraction. Then see this notebook for calculating the theoretical capacity between voltage limits