diff --git a/examples/scripts/compare_lithium_ion.py b/examples/scripts/compare_lithium_ion.py index 5b6c81b05e..f18b6121b0 100644 --- a/examples/scripts/compare_lithium_ion.py +++ b/examples/scripts/compare_lithium_ion.py @@ -25,4 +25,10 @@ sims.append(sim) # plot -pybamm.dynamic_plot(sims) +pybamm.dynamic_plot( + sims, + [ + "Average negative particle concentration [mol.m-3]", + "Average positive particle concentration [mol.m-3]", + ], +) diff --git a/examples/scripts/compare_particle_models.py b/examples/scripts/compare_particle_models.py index d780452004..6c515b685c 100644 --- a/examples/scripts/compare_particle_models.py +++ b/examples/scripts/compare_particle_models.py @@ -5,16 +5,16 @@ # load models models = [ - pybamm.lithium_ion.DFN( + pybamm.lithium_ion.SPM( options={"particle": "Fickian diffusion"}, name="Fickian diffusion" ), - pybamm.lithium_ion.DFN( + pybamm.lithium_ion.SPM( options={"particle": "uniform profile"}, name="uniform profile" ), - pybamm.lithium_ion.DFN( + pybamm.lithium_ion.SPM( options={"particle": "quadratic profile"}, name="quadratic profile" ), - pybamm.lithium_ion.DFN( + pybamm.lithium_ion.SPM( options={"particle": "quartic profile"}, name="quartic profile" ), ] diff --git a/pybamm/models/submodels/particle/x_averaged_polynomial_profile.py b/pybamm/models/submodels/particle/x_averaged_polynomial_profile.py index c6a59246bd..b8cdc94a6a 100644 --- a/pybamm/models/submodels/particle/x_averaged_polynomial_profile.py +++ b/pybamm/models/submodels/particle/x_averaged_polynomial_profile.py @@ -245,6 +245,7 @@ def set_rhs(self, variables): R = variables[f"X-averaged {domain} particle sizes [m]"] # eq 15 of Subramanian2005 + # equivalent to dcdt = -i_cc / (eps * F * L) dcdt = -3 * j_xav / param.F / R if self.size_distribution is False: diff --git a/pybamm/parameters/parameter_values.py b/pybamm/parameters/parameter_values.py index 51078d0fc1..3eb09b467f 100644 --- a/pybamm/parameters/parameter_values.py +++ b/pybamm/parameters/parameter_values.py @@ -696,6 +696,9 @@ def _process_symbol(self, symbol): new_symbol.bounds = tuple([self.process_symbol(b) for b in symbol.bounds]) return new_symbol + elif isinstance(symbol, numbers.Number): + return pybamm.Scalar(symbol) + else: # Backup option: return the object return symbol