How to change a parameter inside the function graphite_cracking_rate_Ai2020

Hi Everyone,

I am using the degradation models with the OKane2022 parameter set, and for my analysis, I need to change the k_cr =Paris’ law cracking rate to different rates for example 1x,10x, and 30x. The value is inside OKane2022.py as the function graphite_cracking_rate_Ai2020.

Is there a simple way of doing this, could someone guide me, please?

Thank you.

I think the easiest way is to pull that function out of the parameter set and redefine it times a scaling factor.

k_cr = parameter_values["Positive electrode cracking rate"]

def my_new_k_cr(T):
    scaling = pybamm.Parameter("Scaling factor")
    return scaling * k_cr(T)

parameter_values["Positive electrode cracking rate"] = my_new_k_cr

You can update the scaling as a new parameter.