Skip to content

Commit

Permalink
Merge pull request #6 from abillscmu/energy-summary
Browse files Browse the repository at this point in the history
Energy summary
  • Loading branch information
aabills authored May 10, 2023
2 parents acc1bc2 + 688c9a0 commit 1342866
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions pybamm/models/full_battery_models/lithium_ion/electrode_soh.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,14 +271,19 @@ def solve(self, inputs):
sol_dict = {key: sol[key].data[0] for key in sol.all_models[0].variables.keys()}

# Calculate theoretical energy
x_0 = sol_dict["x_0"]
y_0 = sol_dict["y_0"]
x_100 = sol_dict["x_100"]
y_100 = sol_dict["y_100"]
energy = pybamm.lithium_ion.electrode_soh.theoretical_energy_integral(
self.parameter_values, x_100, x_0, y_100, y_0
)
sol_dict.update({"Maximum theoretical energy [W.h]": energy})
try:
x_0 = sol_dict["x_0"]
y_0 = sol_dict["y_0"]
x_100 = sol_dict["x_100"]
y_100 = sol_dict["y_100"]
energy = pybamm.lithium_ion.electrode_soh.theoretical_energy_integral(
self.parameter_values, x_100, x_0, y_100, y_0
)
sol_dict.update({"Maximum theoretical energy [W.h]": energy})
except:
warnings.warn("couldn't calculate theoretical energy")


return sol_dict

def _set_up_solve(self, inputs):
Expand Down

0 comments on commit 1342866

Please sign in to comment.