Skip to content
Discussion options

You must be logged in to vote

Try

import pybamm
import numpy as np

model = pybamm.lithium_ion.DFN()
param = pybamm.ParameterValues("Marquis2019")
timescale = param.evaluate(model.timescale)

# make dummy temperature data
t = np.linspace(0, 3600, 360)
temp = 298 + np.sin(2 * np.pi * t)
temp_interpolant = pybamm.Interpolant(t, temp, timescale * pybamm.t)

param["Ambient temperature [K]"] = temp_interpolant
param["Initial temperature [K]"] = 298

sim = pybamm.Simulation(model, parameter_values=param)
sim.solve([0, 3600])
sim.plot(
    ["Current [A]", "Terminal voltage [V]", "Volume-averaged cell temperature [K]"]
)

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@meckwell
Comment options

@rtimms
Comment options

rtimms Dec 6, 2022
Collaborator

@DrSOKane
Comment options

DrSOKane Dec 6, 2022
Collaborator

@meckwell
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by meckwell
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