Replies: 2 comments 1 reply
-
You need square brackets around the list of variables you want to plot, e.g. It would be faster to do this using import pybamm
model = pybamm.lithium_ion.DFN()
parameter_values = pybamm.ParameterValues("Chen2020")
parameter_values["Separator porosity"] = "[input]"
sim = pybamm.Simulation(model, parameter_values=parameter_values)
pors = [0.1, 0.3, 0.5, 0.7, 0.9]
sols = []
for por in pors:
sol = sim.solve([0, 3600], inputs={"Separator porosity": por})
sols.append(sol)
pybamm.dynamic_plot(sols, ["Terminal voltage [V]"], labels=pors) |
Beta Was this translation helpful? Give feedback.
0 replies
-
To find other variables you can do |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
So I want to see how the terminal voltage and the overpotential change when you change the separator porosity. So I thought I would do this whole thing in a loop. So I did the following(for the terminal voltage:
`import numpy as np
import pybamm
model = pybamm.lithium_ion.DFN()
parameter_values = pybamm.ParameterValues("Chen2020")
por = [0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0]
for i in range(len(por)):
parameter_values["Separator porosity"] = por[i]
sim = pybamm.Simulation(model, parameter_values=parameter_values)
sim.solve([0, 3600])
sim.plot("Terminal voltage [V]")`
The program falls over when asked to plot, and I have no idea why, as it seems to work for the actual simulation. The second part, is how do I obtain the overpotentials?
Beta Was this translation helpful? Give feedback.
All reactions