Replies: 2 comments 4 replies
-
Result : code |
Beta Was this translation helpful? Give feedback.
4 replies
-
Hi @rtimms, I think the question is how to plot the Discharge capacity [A.h] against cycle number, not just the capacity. I also Have a similar question where I need to plot Discharge capacity against the Total charge throughput capacity. but the variables only has throughout capacity and discharge capacity, so the if plot it gives a different plot than a continuous decaying discharge capacity. (Please refer below code snipped and figure) cycle_number = 10
exp = pybamm.Experiment(
[
"Hold at 4.2 V until C/100 (5 minute period)",
"Rest for 4 hours (5 minute period)",
"Discharge at 0.1C until 2.5 V (5 minute period)", # initial capacity check
"Charge at 0.3C until 4.2 V (5 minute period)",
"Hold at 4.2 V until C/100 (5 minute period)",
]
+ [
(
"Discharge at 1C until 2.5 V", # ageing cycles
"Charge at 0.3C until 4.2 V (5 minute period)",
"Hold at 4.2 V until C/100 (5 minute period)",
)
]
* cycle_number
+ ["Discharge at 0.1C until 2.5 V (5 minute period)"], # final capacity check
)
sim = pybamm.Simulation(model, parameter_values=updated_parameters, experiment=exp, var_pts=var_pts)
sol = sim.solve()
Qt = sol["Throughput capacity [A.h]"].entries
DC = sol["Discharge capacity [A.h]"].entries
plt.plot(Qt, DC, label="DC") |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I must draw a discharge capacity fade curve like this picture to determine the battery cycle life.
[Code]
import pybamm
import matplotlib.pyplot as plt
import numpy as np
parameter_values = pybamm.ParameterValues("Mohtat2020")
parameter_values.update({"SEI kinetic rate constant [m.s-1]": 1e-14})
spm = pybamm.lithium_ion.SPM({"SEI": "ec reaction limited"})
param = spm.param
esoh_solver = pybamm.lithium_ion.ElectrodeSOHSolver(parameter_values, param)
Vmin = 3.0
Vmax = 4.2
Cn = parameter_values.evaluate(param.n.cap_init)
Cp = parameter_values.evaluate(param.p.cap_init)
n_Li_init = parameter_values.evaluate(param.n_Li_particles_init)
inputs={ "V_min": Vmin, "V_max": Vmax, "C_n": Cn, "C_p": Cp, "n_Li": n_Li_init}
esoh_sol = esoh_solver.solve(inputs)
print(f"Initial negative electrode SOC: {esoh_sol['x_100'].data[0]:.3f}")
print(f"Initial positive electrode SOC: {esoh_sol['y_100'].data[0]:.3f}")
Update parameter values with initial conditions
c_n_max = parameter_values.evaluate(param.n.prim.c_max)
c_p_max = parameter_values.evaluate(param.p.prim.c_max)
parameter_values.update(
{
"Initial concentration in negative electrode [mol.m-3]": esoh_sol["x_100"].data[0] * c_n_max,
"Initial concentration in positive electrode [mol.m-3]": esoh_sol["y_100"].data[0] * c_p_max,
}
)
pybamm.set_logging_level("NOTICE")
experiment = pybamm.Experiment([
(f"Discharge at 1C until {Vmin}V",
"Rest for 1 hour",
f"Charge at 1C until {Vmax}V",
f"Hold at {Vmax}V until C/50"
)
])
sim = pybamm.Simulation(spm, experiment=experiment, parameter_values=parameter_values)
sol = sim.solve()
experiment = pybamm.Experiment([
(f"Discharge at 1C until {Vmin}V",
"Rest for 1 hour",
f"Charge at 1C until {Vmax}V",
f"Hold at {Vmax}V until C/50")
] *1000,
termination="80% capacity"
)
sim = pybamm.Simulation(spm, experiment=experiment, parameter_values=parameter_values)
sol = sim.solve()
a1=sol["Discharge capacity [A.h]"].data
a2=sol.summary_variables["Cycle number"]
print(a2)
There's only 50 cycles here. What should I do to get the whole cycle (1000 I set up)?
I'd appreciate it if you could help me.
Beta Was this translation helpful? Give feedback.
All reactions