# Degradation of Lg 18650 MH1 cell

**URL:** <https://pybamm.discourse.group/t/degradation-of-lg-18650-mh1-cell/99>\
**Category:** General\
**Created:** [10 January 2025 12:06 UTC](https://pybamm.discourse.group/t/degradation-of-lg-18650-mh1-cell/99 "2025-01-10T12:06:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![shubh](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@shubh](https://pybamm.discourse.group/u/shubh)\
**Post date:** [10 January 2025 12:06 UTC](https://pybamm.discourse.group/t/degradation-of-lg-18650-mh1-cell/99/1 "2025-01-10T12:06:11Z")

</div>

Hii all i am trying to simulate the aging of Lg 18650 MH1 cell and matching my simulation plot with experimental data/plot, but not getting the desired plot.  
**Experimental plot**

 ![Figure_1](https://global.discourse-cdn.com/free1/uploads/pybamm/original/1X/8bce77360d9ff1a6f935450d3246fd0e5d34aa4b.png)

**Pybamm code**  
import pybamm  
import numpy as np  
import matplotlib.pyplot as plt

model = pybamm.lithium\_ion.SPMe({“SEI”: “solvent-diffusion limited”})  
param = pybamm.ParameterValues(“OKane2022”)  
experiment = pybamm.Experiment(  
[  
“Discharge at 0.5C until 2.95V”,  
“Charge at 0.5C until 4.15V”,  
“Hold at 4.15V until 50mA”,  
“Rest for 10 minutes”,  
] \* 5 # Example with 5 cycles for demonstration  
)

sim = pybamm.Simulation(model, parameter\_values=param, experiment=experiment)

solution = sim.solve()

time = solution[“Time [s]”].data  
current = solution[“Current [A]”].data  
discharge\_capacity = solution[“Discharge capacity [A.h]”].data

discharge\_capacities =   
cycle\_numbers =   
for i in range(1, len(time)):  
# Check for the end of discharge: current transitions to zero or positive  
if current[i] \> 0 and current[i - 1] \<= 0: # Discharge phase ends when current becomes positive  
discharge\_capacities.append(discharge\_capacity[i - 1]) # Record capacity at the end of discharge  
cycle\_numbers.append(len(discharge\_capacities)) # Cycle number corresponds to the index

plt.figure(figsize=(8, 5))  
plt.plot(cycle\_numbers, discharge\_capacities, ‘bo-’, label=“Discharge Capacity”)  
plt.xlabel(“Cycle Number”)  
plt.ylabel(“Capacity (A.h)”)  
plt.title(“Discharge Capacity vs Cycle Number”)  
plt.legend()  
plt.grid(True)  
plt.show()

\*_Simulation plot_

 ![image](https://global.discourse-cdn.com/free1/uploads/pybamm/original/1X/906096645ab05d46a919c34bbe5bbd0b5ac61bd5.png)

---

<div class="post-metadata">

**Author:** ![AkilaJ](https://yyz2.discourse-cdn.com/free1/user_avatar/pybamm.discourse.group/akilaj/32/12_2.png) [@AkilaJ](https://pybamm.discourse.group/u/AkilaJ)\
**Post date:** [11 January 2025 04:03 UTC](https://pybamm.discourse.group/t/degradation-of-lg-18650-mh1-cell/99/3 "2025-01-11T04:03:52Z")

</div>

Hi,

I think this is because of PyBaMM convention use for current. Discharge capacity always starts at zero then increases during a discharge. The convention PyBaMM use is that current is positive for a discharge and negative for a charge. Refer: This [discussion](https://github.com/pybamm-team/PyBaMM/discussions/3685#discussioncomment-8010758)

However, I also tried with enabling other degradation mechanisms with DFN model, and it gives me following plot. But for SPMe still the same.

 ![dd](https://global.discourse-cdn.com/free1/uploads/pybamm/original/1X/1ba97e3448a970f8e72e69983b298990e4a4d796.png)

```python3
import pybamm
import numpy as np
import matplotlib.pyplot as plt

# Define the model and parameters
#model = pybamm.lithium_ion.SPMe({"SEI": "solvent-diffusion limited"})

model = pybamm.lithium_ion.DFN(
    {
        "SEI": "solvent-diffusion limited",
        "SEI porosity change": "true",
        "lithium plating": "partially reversible",
        "lithium plating porosity change": "true", # alias for "SEI porosity change"
        "particle mechanics": ("swelling and cracking", "swelling only"),
       
        "SEI on cracks": "true",
        "loss of active material": "stress-driven",
    }
)

param = pybamm.ParameterValues("OKane2022")

# Define the experiment
experiment = pybamm.Experiment(
    [
        "Discharge at 0.5C until 2.95V",
        "Charge at 0.5C until 4.15V",
        "Hold at 4.15V until 50mA",
        "Rest for 10 minutes",
    ] * 5 # Example with 5 cycles for demonstration
)

# Create and solve the simulation
sim = pybamm.Simulation(model, parameter_values=param, experiment=experiment)
solution = sim.solve()

# Extract solution variables
time = solution["Time [s]"].data
current = solution["Current [A]"].data
discharge_capacity = solution["Discharge capacity [A.h]"].data

#discharge_capacity = np.abs(solution["Discharge capacity [A.h]"].data)

# Initialize lists to store discharge capacities and cycle numbers
discharge_capacities = []
cycle_numbers = []

# Iterate to find discharge capacities at the end of each discharge phase
for i in range(1, len(time)):
    # Check for the end of discharge: current transitions to zero or positive
    if current[i] > 0 and current[i - 1] <= 0: # Discharge ends when current becomes positive
        discharge_capacities.append(discharge_capacity[i - 1]) # Record capacity at end of discharge
        cycle_numbers.append(len(discharge_capacities)) # Cycle number corresponds to the index

# Plot discharge capacity vs. cycle number
plt.figure(figsize=(8, 5))
plt.plot(cycle_numbers, discharge_capacities, 'bo-', label="Discharge Capacity")
plt.xlabel("Cycle Number")
plt.ylabel("Capacity (A.h)")
plt.title("Discharge Capacity vs Cycle Number")
plt.legend()
plt.grid(True)
plt.show()

```

---

<div class="post-metadata">

**Author:** ![shubh](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@shubh](https://pybamm.discourse.group/u/shubh)\
**Post date:** [14 January 2025 13:20 UTC](https://pybamm.discourse.group/t/degradation-of-lg-18650-mh1-cell/99/4 "2025-01-14T13:20:57Z")

</div>

Here is the follow up question. I am getting output as shown in Picture.

 ![3. SPMe model_Okane2022 parameter_1500 cycles_experimental and simuated plot together](https://global.discourse-cdn.com/free1/uploads/pybamm/original/1X/9ab70b94cde6c383b1b07c2394fc8a986ecfbdbe.png)

VS18-191 is the experimental plot. The simulated plot in blue is not matching with experimental plot. There is huge difference in capacity of plots. How can I match both plot capacities?
