Skip to content
Discussion options

You must be logged in to vote

Something like this should work

import pybamm
model = pybamm.lithium_ion.DFN()

# set the default model parameters
param = model.default_parameter_values

# change the current function to be an input parameter
param["Current function [A]"] = "[input]"

# set up simlation
simulation = pybamm.Simulation(model, parameter_values=param)

# solve the model at the given time points, passing the current as an input
simulation.step(dt=100, npts=100, inputs={"Current function [A]": 1.6})
simulation.step(dt=100, npts=100, inputs={"Current function [A]": -1.6})

# plot
simulation.plot()

Replies: 1 comment 11 replies

Comment options

You must be logged in to vote
11 replies
@fireyan8
Comment options

@TomTranter
Comment options

@fireyan8
Comment options

@TomTranter
Comment options

Answer selected by fireyan8
@fireyan8
Comment options

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