Skip to content
Discussion options

You must be logged in to vote

This example might help

import pybamm
from pybamm import exp, constants

# pick parameters
param = pybamm.ParameterValues("Ecker2015")

# define custom diffusivity function with some input parameters we can specify when solving
a = pybamm.InputParameter("a")
b = pybamm.InputParameter("b")
c = pybamm.InputParameter("c")


def D_n(sto, T):
    D_ref = a * exp(-b * sto) + c
    E_D_s = 3.03e4
    arrhenius = exp(-E_D_s / (constants.R * T)) * exp(E_D_s / (constants.R * 296))
    return D_ref * arrhenius

# update parameters
param["Negative electrode diffusivity [m2.s-1]"] = D_n

# set up simulation 
model = pybamm.lithium_ion.SPMe()
sim = pybamm.Simulation(model, parameter_values=param)

# so…

Replies: 2 comments 2 replies

Comment options

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

Comment options

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

Answer selected by CaXYZ
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants