Skip to content

Commit

Permalink
Merge pull request pybamm-team#3944 from pybamm-team/fix-name-dimensi…
Browse files Browse the repository at this point in the history
…onal

Fix name dimensional
  • Loading branch information
valentinsulzer authored Mar 30, 2024
2 parents 60ba076 + 3d50b5f commit 3b39e9b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 21 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@

## Breaking changes

- The ODES solver was removed due to compatability issues. Users should use IDAKULU, Casadi, or JAX instead. ([#3932](https://github.com/pybamm-team/PyBaMM/pull/3932))
- Renamed "ocp_soc_0_dimensional" to "ocp_soc_0" and "ocp_soc_100_dimensional" to "ocp_soc_100" ([#3942](https://github.com/pybamm-team/PyBaMM/pull/3942))
- The ODES solver was removed due to compatibility issues. Users should use IDAKLU, Casadi, or JAX instead. ([#3932](https://github.com/pybamm-team/PyBaMM/pull/3932))
- Integrated the `[pandas]` extra into the core PyBaMM package, deprecating the `pybamm[pandas]` optional dependency. Pandas is now a required dependency and will be installed upon installing PyBaMM ([#3892](https://github.com/pybamm-team/PyBaMM/pull/3892))
- Renamed "have_optional_dependency" to "import_optional_dependency" ([#3866](https://github.com/pybamm-team/PyBaMM/pull/3866))
- Integrated the `[latexify]` extra into the core PyBaMM package, deprecating the `pybamm[latexify]` set of optional dependencies. SymPy is now a required dependency and will be installed upon installing PyBaMM ([#3848](https://github.com/pybamm-team/PyBaMM/pull/3848))
Expand Down
16 changes: 6 additions & 10 deletions pybamm/models/full_battery_models/lithium_ion/electrode_soh.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ def __init__(
Up = param.p.prim.U
T_ref = param.T_ref

V_max = param.ocp_soc_100_dimensional
V_min = param.ocp_soc_0_dimensional
V_max = param.ocp_soc_100
V_min = param.ocp_soc_0
Q_n = pybamm.InputParameter("Q_n")
Q_p = pybamm.InputParameter("Q_p")

Expand Down Expand Up @@ -579,12 +579,8 @@ def _check_esoh_feasible(self, inputs):

# Parameterize the OCP functions
if self.OCV_function is None:
self.V_max = self.parameter_values.evaluate(
self.param.ocp_soc_100_dimensional
)
self.V_min = self.parameter_values.evaluate(
self.param.ocp_soc_0_dimensional
)
self.V_max = self.parameter_values.evaluate(self.param.ocp_soc_100)
self.V_min = self.parameter_values.evaluate(self.param.ocp_soc_0)
if self.options["open-circuit potential"] == "MSMR":
# will solve for potentials at the sto limits, so no need
# to store a function
Expand Down Expand Up @@ -672,8 +668,8 @@ def get_initial_stoichiometries(self, initial_value, tol=1e-6, inputs=None):

if isinstance(initial_value, str) and initial_value.endswith("V"):
V_init = float(initial_value[:-1])
V_min = parameter_values.evaluate(param.ocp_soc_0_dimensional)
V_max = parameter_values.evaluate(param.ocp_soc_100_dimensional)
V_min = parameter_values.evaluate(param.ocp_soc_0)
V_max = parameter_values.evaluate(param.ocp_soc_100)

if not V_min <= V_init <= V_max:
raise ValueError(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ def __init__(self, name="ElectrodeSOH model"):
U_w = param.p.prim.U
Q = Q_w * (x_100 - x_0)

V_max = param.ocp_soc_100_dimensional
V_min = param.ocp_soc_0_dimensional
V_max = param.ocp_soc_100
V_min = param.ocp_soc_0

self.algebraic = {
x_100: U_w(x_100, T_ref) - V_max,
Expand Down
8 changes: 2 additions & 6 deletions pybamm/parameters/electrical_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@ def _set_parameters(self):
)
self.voltage_low_cut = pybamm.Parameter("Lower voltage cut-off [V]")
self.voltage_high_cut = pybamm.Parameter("Upper voltage cut-off [V]")
self.ocp_soc_0_dimensional = pybamm.Parameter(
"Open-circuit voltage at 0% SOC [V]"
)
self.ocp_soc_100_dimensional = pybamm.Parameter(
"Open-circuit voltage at 100% SOC [V]"
)
self.ocp_soc_0 = pybamm.Parameter("Open-circuit voltage at 0% SOC [V]")
self.ocp_soc_100 = pybamm.Parameter("Open-circuit voltage at 100% SOC [V]")
# Current as a function of time
self.current_with_time = pybamm.FunctionParameter(
"Current function [A]", {"Time [s]": pybamm.t}
Expand Down
4 changes: 2 additions & 2 deletions pybamm/parameters/lithium_ion_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ def _set_parameters(self):
self.n_cells = self.elec.n_cells
self.voltage_low_cut = self.elec.voltage_low_cut
self.voltage_high_cut = self.elec.voltage_high_cut
self.ocp_soc_0_dimensional = self.elec.ocp_soc_0_dimensional
self.ocp_soc_100_dimensional = self.elec.ocp_soc_100_dimensional
self.ocp_soc_0 = self.elec.ocp_soc_0
self.ocp_soc_100 = self.elec.ocp_soc_100

# Domain parameters
for domain in self.domain_params.values():
Expand Down

0 comments on commit 3b39e9b

Please sign in to comment.