# How to change a parameter inside the function graphite\_cracking\_rate\_Ai2020

**URL:** <https://pybamm.discourse.group/t/how-to-change-a-parameter-inside-the-function-graphite-cracking-rate-ai2020/71>\
**Category:** General\
**Created:** [18 December 2024 02:55 UTC](https://pybamm.discourse.group/t/how-to-change-a-parameter-inside-the-function-graphite-cracking-rate-ai2020/71 "2024-12-18T02:55:01Z")\
**Posts on this page:** 2\
**Page:** 1

<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:** [18 December 2024 02:55 UTC](https://pybamm.discourse.group/t/how-to-change-a-parameter-inside-the-function-graphite-cracking-rate-ai2020/71/1 "2024-12-18T02:55:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![brosaplanella](https://yyz2.discourse-cdn.com/free1/user_avatar/pybamm.discourse.group/brosaplanella/32/6_2.png) [@brosaplanella](https://pybamm.discourse.group/u/brosaplanella)\
**Post date:** [7 February 2025 14:50 UTC](https://pybamm.discourse.group/t/how-to-change-a-parameter-inside-the-function-graphite-cracking-rate-ai2020/71/2 "2025-02-07T14:50:30Z")

</div>

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

```python3
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.
