Skip to content
Discussion options

You must be logged in to vote

You can do things like this

from pybamm import Interpolant, exp, constants
import numpy as np


def graphite_diffusivity(sto, T):
    sto_ref = np.array([0, 4e-2, 1e-1, 1.5e-1, 1.9e-1, 5e-1, 6e-1, 9.7e-1, 1])
    diffusivity_ref = np.array(
        [6e-12, 2e-12, 1e-12, 3e-13, 1e-13, 1e-14, 1e-15, 2e-15, 4e-13]
    )
    
    D_ref = Interpolant(sto_ref, diffusivity_ref, sto)

    E_D_s = 42770
    arrhenius = exp(E_D_s / constants.R * (1 / 298.15 - 1 / T))

    return D_ref * arrhenius

but you might find you get better performance from fitting a function to your data and using that instead

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@thuwangming
Comment options

Answer selected by brosaplanella
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1846 on December 09, 2021 12:16.