-
-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
1,247 additions
and
259 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Base Experiment Class | ||
===================== | ||
|
||
.. autoclass:: pybamm.Experiment | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Experiments | ||
=========== | ||
|
||
Classes to help set operating conditions for some standard battery modelling experiments | ||
|
||
.. toctree:: | ||
|
||
experiment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
Solution | ||
======== | ||
|
||
.. autoclass:: pybamm._BaseSolution | ||
:members: | ||
|
||
.. autoclass:: pybamm.Solution | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# Constant-current constant-voltage charge | ||
# | ||
import pybamm | ||
import matplotlib.pyplot as plt | ||
|
||
pybamm.set_logging_level("INFO") | ||
experiment = pybamm.Experiment( | ||
[ | ||
"Discharge at C/10 for 13 hours or until 3.3 V", | ||
"Rest for 1 hour", | ||
"Charge at 1 A until 4.1 V", | ||
"Hold at 4.1 V until 50 mA", | ||
"Rest for 1 hour", | ||
] | ||
* 3, | ||
period="2 minutes", | ||
) | ||
model = pybamm.lithium_ion.DFN() | ||
sim = pybamm.Simulation(model, experiment=experiment, solver=pybamm.CasadiSolver()) | ||
sim.solve() | ||
|
||
# Plot voltages from the discharge segments only | ||
fig, ax = plt.subplots() | ||
for i in range(3): | ||
# Extract sub solutions | ||
sol = sim.solution.sub_solutions[i * 5] | ||
# Extract variables | ||
t = sol["Time [h]"].entries | ||
V = sol["Terminal voltage [V]"].entries | ||
# Plot | ||
ax.plot(t - t[0], V, label="Discharge {}".format(i + 1)) | ||
ax.set_xlabel("Time [h]") | ||
ax.set_ylabel("Voltage [V]") | ||
ax.set_xlim([0, 13]) | ||
ax.legend() | ||
|
||
# Show all plots | ||
sim.plot() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# | ||
# Constant-current constant-voltage charge | ||
# | ||
import pybamm | ||
|
||
pybamm.set_logging_level("INFO") | ||
experiment = pybamm.Experiment( | ||
[ | ||
"Discharge at C/2 until 11 V", | ||
"Rest for 1 hour", | ||
"Charge at C/2 until 14.5 V", | ||
"Hold at 14.5 V until 200 mA", | ||
"Rest for 1 hour", | ||
] | ||
) | ||
model = pybamm.lead_acid.Full() | ||
sim = pybamm.Simulation(model, experiment=experiment, solver=pybamm.CasadiSolver()) | ||
sim.solve() | ||
sim.plot() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# | ||
# GITT discharge | ||
# | ||
import pybamm | ||
|
||
pybamm.set_logging_level("INFO") | ||
experiment = pybamm.Experiment( | ||
["Discharge at C/20 for 1 hour", "Rest for 1 hour"] * 20, | ||
) | ||
model = pybamm.lithium_ion.DFN() | ||
sim = pybamm.Simulation(model, experiment=experiment, solver=pybamm.CasadiSolver()) | ||
sim.solve() | ||
sim.plot() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Oops, something went wrong.