Charging to upper cutoff terminal voltage not possible using experiment method, and issues with Current Function parameter #2354
Unanswered
HassanSewailem
asked this question in
Q&A
Replies: 0 comments
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.
-
Hello,
I am currently trying to run the following experiment, where the parameter set used is the Ai2020 set (Lower cutoff = 3V, Upper cutoff = 4.2V),
charge_exp1 = pybamm.Experiment(["Charge at 0.06C until 4.2V (1 second period)"])
charge_sim1 = pybamm.Simulation(new_model, parameter_values=params, experiment=charge_exp1)
charge_sol1 = charge_sim1.solve(calc_esoh=False)
charge_sol1.plot()
EP[1] = charge_sol1.data['Electrolyte potential [V]'][0, -1]
I have fully depleted the battery beforehand, and set initial conditions to a new model, and used the new model for experiments. When I run such an experiment, I get an error, even when changing the current value. However, the experiment runs when I set the experiment to charge until a lower terminal voltage, such as 3.6V.
What would be the reason that I cannot fully charge the battery using the experiment method? Is there a workaround to fully charge the battery?
Also, I tried simulating a charging experiment by changing the current function, shown in the code below,
params['Current function [A]'] = -2.28 ## current
sim = pybamm.Simulation(new_model, parameter_values=params)
solution = sim.solve(t_eval =[0, 3600]) ## solve for one hour (3600 s)
sim.plot() ## plotting all variables
solution.data.keys() ## Checking the solution variables available
solution.data['Electrolyte concentration [mol.m-3]'].shape
However this also gives the error "SolverError: Maximum number of decreased steps occurred at t=72.72727272727273. Try solving the model up to this time only or reducing dt_max (currently, dt_max=2.6214708054693796) and/or reducing the size of the time steps or period of the experiment."
Both methods above used to work before I updated PyBamm, so I am not sure what changed that caused these errors. If there is a solution to both methods, that would be great.
The code used before that can be found below,
importing necessary libraries
import pybamm
import numpy as np
import matplotlib.pyplot as plt
Model and parameter set initiation
options = {"SEI": "ec reaction limited",
"SEI film resistance": "distributed",
"lithium plating":"irreversible"}
model = pybamm.lithium_ion.DFN(options=options) ## P2D model
model.options.possible_options
model.options.print_options() ## Print possible options in model
params = pybamm.ParameterValues("Ai2020")
Searching available parameters and adding plating parameters from OKane2022 to Ai2020 parameters
def plating_exchange_current_density_OKane2020(c_e, c_Li, T):
k_plating = 0.001
def SEI_limited_dead_lithium_OKane2022(L_sei):
gamma_0 = 1e-6
L_inner_0 = params("Initial inner SEI thickness [m]")
L_outer_0 = params("Initial outer SEI thickness [m]")
L_sei_0 = L_inner_0 + L_outer_0
def stripping_exchange_current_density_OKane2020(c_e, c_Li, T):
k_plating = Parameter("Lithium plating kinetic rate constant [m.s-1]")
params.update({ 'Initial plated lithium concentration [mol.m-3]': 0.0,
#'Exchange-current density for plating [A.m-2]': pybamm.FunctionParameter(plating_exchange_current_density_OKane2020),
'Lithium plating kinetic rate constant [m.s-1]': 1e-9,
'Lithium plating transfer coefficient': 0.65,
'Typical plated lithium concentration [mol.m-3]' : 1000.0,
'Lithium metal partial molar volume [m3.mol-1]' : 1.30e-05,
'Exchange-current density for stripping [A.m-2]' : stripping_exchange_current_density_OKane2020,
'Dead lithium decay constant [s-1]' : 1e-6,
'Dead lithium decay rate [s-1]' :SEI_limited_dead_lithium_OKane2022,
'Exchange-current density for plating [A.m-2]' : plating_exchange_current_density_OKane2020}, check_already_exists=False)
#params.search("vol")
params.values()
#def plating_function(c_e, c_Li, T):
k_plating = 0.001
return pybamm.constants.F * k_plating * c_e
params.update({'Exchange-current density for plating [A.m-2]': plating_exchange_current_density_OKane2020}, check_already_exists=False)
params.search("exchange")
#chemistry = pybamm.parameter_sets.Ai2020 ## Use Ai2020 parameter set,
#chemistry = pybamm.ParameterValues("Ai2020") ## Use Ai2020 parameter set,
#params = pybamm.ParameterValues(chemistry = chemistry)
#params.search("width")
Depleting the battery first and setting initial conditions to the ones
discharge_exp = pybamm.Experiment(["Discharge at C/10 until 3V"]) ## Setting up experiment to deplete battery at low current rate
discharge_sim = pybamm.Simulation(model, parameter_values=params, experiment=discharge_exp) ## Simulating experiment
discharge_sol = discharge_sim.solve(calc_esoh=False)
discharge_sol.plot()
MODEL RE-INITIALIZATION:
Now initialize the model with the solution of the discharge, and then charge
We could also do this inplace by setting inplace to True, which modifies the original
model in place
new_model = model.set_initial_conditions_from(discharge_sol, inplace=False)
########################################################################################
Beta Was this translation helpful? Give feedback.
All reactions