Releases: pybamm-team/PyBaMM
Releases · pybamm-team/PyBaMM
v23.9rc1
v23.9rc0
Features
- The parameter "Ambient temperature [K]" can now be given as a function of position
(y,z)
and timet
. The "edge" and "current collector" heat transfer coefficient parameters can also depend on(y,z)
(#3257) - Spherical and cylindrical shell domains can now be solved with any boundary conditions (#3237)
- Processed variables now get the spatial variables automatically, allowing plotting of more generic models (#3234)
- Numpy functions now work with PyBaMM symbols (e.g.
np.exp(pybamm.Symbol("a"))
returnspybamm.Exp(pybamm.Symbol("a"))
). This means that parameter functions can be specified using numpy functions instead of pybamm functions. Additionally, combining numpy arrays with pybamm objects now works (the numpy array is converted to a pybamm array) (#3205) - Half-cell models where graphite - or other negative electrode material of choice - is treated as the positive electrode (#3198)
- Degradation mechanisms
SEI
,SEI on cracks
andlithium plating
can be made to work on the positive electrode by specifying the relevant options as a 2-tuple. If a tuple is not given andworking electrode
is set toboth
, they will be applied on the negative electrode only. (#3198) - Added an example notebook to demonstrate how to use half-cell models (#3198)
- Added option to use an empirical hysteresis model for the diffusivity and exchange-current density (#3194)
- Double-layer capacity can now be provided as a function of temperature (#3174)
pybamm_install_jax
is deprecated. It is now replaced withpip install pybamm[jax]
(#3163)- Implement the MSMR model (#3116)
- Added new example notebook
rpt-experiment
to demonstrate how to set up degradation experiments with RPTs (#2851)
Bug fixes
- Fixed a bug where empty lists passed to QuickPlot resulted in an IndexError and did not return a meaningful error message (#3359)
- Fixed a bug where there was a missing thermal conductivity in the thermal pouch cell models (#3330)
- Fixed a bug that caused incorrect results of “{Domain} electrode thickness change [m]” due to the absence of dimension for the variable
electrode_thickness_change
(#3329). - Fixed a bug that occured in
check_ys_are_not_too_large
when trying to referencey-slice
where the referenced variable was not apybamm.StateVector
(#3313 - Fixed a bug with
_Heaviside._evaluate_for_shape
which meant some expressions involving heaviside function and subtractions did not work (#3306) - Attributes of
pybamm.Simulation
objects (models, parameter values, geometries, choice of solver, and output variables) are now private and as such cannot be edited in-place after the simulation has been created (#3267 - Fixed bug causing incorrect activation energies using
create_from_bpx()
(#3242) - Fixed a bug where the "basic" lithium-ion models gave incorrect results when using nonlinear particle diffusivity (#3207)
- Particle size distributions now work with SPMe and NewmanTobias models (#3207)
- Attempting to set
working electrode
tonegative
now triggers anOptionError
. Instead, set it topositive
and use what would normally be the negative electrode as the positive electrode. (#3198) - Fix to simulate c_rate steps with drive cycles (#3186)
- Always save last cycle in experiment, to fix issues with
starting_solution
andlast_state
(#3177) - Fix simulations with
starting_solution
to work withstart_time
experiments (#3177) - Fix SEI Example Notebook (#3166)
- Thevenin() model is now constructed with standard variables:
Time [s]
,Time [min]
,Time [h]
(#3143) - Error generated when invalid parameter values are passed (#3132)
- Parameters in
Prada2013
have been updated to better match those given in the paper, which is a 2.3 Ah cell, instead of the mix-and-match with the 1.1 Ah cell from Lain2019 (#3096) - The
OneDimensionalX
thermal model has been updated to account for edge/tab cooling and account for the current collector volumetric heat capacity. It now gives the correct behaviour compared with a lumped model with the correct total heat transfer coefficient and surface area for cooling. (#3042)
Optimizations
- Improved how steps are processed in simulations to reduce memory usage (#3261)
- Added parameter list support to JAX solver, permitting multithreading / GPU execution (#3121)
Breaking changes
- Dropped support for i686 (32-bit) architectures on GNU/Linux distributions (#3412)
- The class
pybamm.thermal.OneDimensionalX
has been moved topybamm.thermal.pouch_cell.OneDimensionalX
to reflect the fact that the model formulation implicitly assumes a pouch cell geometry (#3257) - The "lumped" thermal option now always used the parameters "Cell cooling surface area [m2]", "Cell volume [m3]" and "Total heat transfer coefficient [W.m-2.K-1]" to compute the cell cooling regardless of the chosen "cell geometry" option. The user must now specify the correct values for these parameters instead of them being calculated based on e.g. a pouch cell. An
OptionWarning
is raised to let users know to update their parameters (#3257) - Numpy functions now work with PyBaMM symbols (e.g.
np.exp(pybamm.Symbol("a"))
returnspybamm.Exp(pybamm.Symbol("a"))
). This means that parameter functions can be specified using numpy functions instead of pybamm functions. Additionally, combining numpy arrays with pybamm objects now works (the numpy array is converted to a pybamm array) (#3205) - The
SEI
,SEI on cracks
andlithium plating
submodels can now be used on either electrode, which means the__init__
functions for the relevant classes now havedomain
as a required argument (#3198) - Likewise, the names of all variables corresponding to those submodels now have domains. For example, instead of
SEI thickness [m]
, useNegative SEI thickness [m]
orPositive SEI thickness [m]
. (#3198) - If
options["working electrode"] == "both"
and eitherSEI
,SEI on cracks
orlithium plating
are not provided as tuples, they are automatically made into tuples. This directly modifiesextra_options
, notdefault_options
to ensure the other changes todefault_options
still happen when required. (#3198) - Added option to use an empirical hysteresis model for the diffusivity and exchange-current density (#3194)
- Double-layer capacity can now be provided as a function of temperature (#3174)
pybamm_install_jax
is deprecated. It is now replaced withpip install pybamm[jax]
(#3163)- PyBaMM now has optional dependencies that can be installed with the pattern
pip install pybamm[option]
e.g.pybamm[plot]
(#3044)
v23.5
Features
- Enable multithreading in IDAKLU solver (#2947)
- If a solution contains cycles and steps, the cycle number and step number are now saved when
solution.save_data()
is called (#2931) - Experiments can now be given a
start_time
to define when each step should be triggered (#2616)
Optimizations
- Test
JaxSolver
's compatibility with Python3.8
,3.9
,3.10
, and3.11
(#2958) - Update Jax (0.4.8) and JaxLib (0.4.7) compatibility (#2927)
Bug fixes
- Realign 'count' increment in CasadiSolver._integrate() (#2986)
- Fix
pybamm_install_odes
and update the required SUNDIALS version (#2958) - Fixed a bug where all data included in a BPX was incorrectly assumed to be given as a function of time.(#2957)
- Remove brew install for Mac from the recommended developer installation options for SUNDIALS (#2925)
- Fix
bpx.py
to correctly generate parameters for "lumped" thermal model (#2860)
Breaking changes
- Deprecate functionality to load parameter set from a csv file. Parameter sets must now be provided as python dictionaries (#2959)
v23.5rc0
Bug fixes
- Realign 'count' increment in CasadiSolver._integrate() (#2986)
Features
- Enable multithreading in IDAKLU solver (#2947)
- If a solution contains cycles and steps, the cycle number and step number are now saved when
solution.save_data()
is called (#2931) - Experiments can now be given a
start_time
to define when each step should be triggered (#2616)
Optimizations
- Test
JaxSolver
's compatibility with Python3.8
,3.9
,3.10
, and3.11
(#2958) - Update Jax (0.4.8) and JaxLib (0.4.7) compatibility (#2927)
- Removed
importlib_metadata
as a required dependency for user installations (#3050)
Bug fixes
- Fix
pybamm_install_odes
and update the required SUNDIALS version (#2958) - Fixed a bug where all data included in a BPX was incorrectly assumed to be given as a function of time.(#2957)
- Remove brew install for Mac from the recommended developer installation options for SUNDIALS (#2925)
- Fix
bpx.py
to correctly generate parameters for "lumped" thermal model (#2860)
Breaking changes
- Deprecate functionality to load parameter set from a csv file. Parameter sets must now be provided as python dictionaries (#2959)
v23.4.1
v23.4
Bug fixes
- Parameter sets can now contain the key "chemistry", and will ignore its value (this previously would give errors in some cases) (#2901)
- Fixed a bug in the discretisation of initial conditions of a scaled variable (#2856)
- Fixed keyerror on "all" when getting sensitivities from IDAKLU solver(#2883)
Breaking changes
- Made
Jupyter
a development only dependency. NowJupyter
would not be a required dependency for users while installingPyBaMM
. (#2846)
v23.3
Features
- Added option to limit the number of integrators stored in CasadiSolver, which is particularly relevant when running simulations back-to-back #2823
- Added new variables, related to electrode balance, for the
ElectrodeSOH
model (#2807) - Added method to calculate maximum theoretical energy. (#2777) and add to summary variables (#2781)
- Renamed "Terminal voltage [V]" to just "Voltage [V]". "Terminal voltage [V]" can still be used and will return the same value as "Voltage [V]". (#2740)
- Added "Negative electrode surface potential difference at separator interface [V]", which is the value of the surface potential difference (
phi_s - phi_e
) at the anode/separator interface, commonly controlled in fast-charging algorithms to avoid plating. Also added "Positive electrode surface potential difference at separator interface [V]". (#2740) - Added "Bulk open-circuit voltage [V]", which is the open-circuit voltage as calculated from the bulk particle concentrations. The old variable "Measured open circuit voltage [V]", which referred to the open-circuit potential as calculated from the surface particle concentrations, has been renamed to "Surface open-circuit voltage [V]". (#2740) "Bulk open-circuit voltage [V]" was briefly named "Open-circuit voltage [V]", but this was changed in (#2845)
- Added an example for
plot_voltage_components
, explaining what the different voltage components are. (#2740)
Bug fixes
- Fixed excessive RAM consumption when running multiple simulations (#2823)
- Fixed a bug where variable bounds could not contain
InputParameters
(#2795) - Improved
model.latexify()
to have a cleaner and more readable output (#2764) - Fixed electrolyte conservation in the case of concentration-dependent transference number (#2758)
- Fixed
plot_voltage_components
so that the sum of overpotentials is now equal to the voltage (#2740) - Fixed use of last_state as starting_solution in Simulation.solve() (#2822)
Optimizations
Breaking changes
ElectrodeSOH.solve
now returns a{str: float}
dict instead of apybamm.Solution
object (to avoid having to do.data[0]
every time). In any code that usessol = ElectrodeSOH.solve()
,sol[key].data[0]
should be replaced withsol[key]
. (#2779)- Removed "... cation signed stoichiometry" and "... electrons in reaction" parameters, they are now hardcoded. (#2778)
- When using
solver.step()
, the first time point in the step is shifted bypybamm.settings.step_start_offset
(default 1 ns) to avoid having duplicate times in the solution steps from the end of one step and the start of the next. (#2773) - Renamed "Measured open circuit voltage [V]" to "Surface open-circuit voltage [V]". This variable was calculated from surface particle concentrations, and hence "hid" the overpotential from particle gradients. The new variable "Bulk open-circuit voltage [V]" is calculated from bulk particle concentrations instead. (#2740)
- Renamed all references to "open circuit" to be "open-circuit" instead. (#2740)
- Renamed parameter "1 + dlnf/dlnc" to "Thermodynamic factor". (#2727)
- All PyBaMM models are now dimensional. This has been benchmarked against dimensionless models and found to give around the same solve time. Implementing dimensional models greatly reduces the barrier to entry for adding new models. However, this comes with several breaking changes: (i) the
timescale
andlength_scales
attributes of a model have been removed (they are no longer needed) (ii) several dimensionless variables are no longer defined, but the corresponding dimensional variables can still be accessed by adding the units to the name (iii) some parameters used only for non-dimensionalization, such as "Typical current [A]", have been removed (#2419)
v23.2
v23.1
Features
- Changed linting from
flake8
toruff
(#2630). - Changed docs theme to pydata theme and start to improve docs in general (#2618).
- New
contact resistance
option, new parameterContact resistance [Ohm]
and new variableContact overpotential [V]
(#2598). - Steps in
Experiment
can now be tagged and cycle numbers be searched based on those tags (#2593).
Bug fixes
v22.12
Features
- Added functionality to create
pybamm.ParameterValues
from a BPX standard JSON file (#2555). - Allow the option "surface form" to be "differential" in the
MPM
(#2533) - Added variables "Loss of lithium due to loss of active material in negative/positive electrode [mol]". These should be included in the calculation of "total lithium in system" to make sure that lithium is truly conserved. (#2529)
initial_soc
can now be a string "x V", in which case the simulation is initialized to start from that voltage (#2508)- The
ElectrodeSOH
solver can now calculate electrode balance based on a target "cell capacity" (requires cell capacity "Q" as input), as well as the default "cyclable cell capacity" (requires cyclable lithium capacity "Q_Li" as input). Use the keyword argumentknown_value
to control which is used. (#2508)
Bug fixes
- Fixed bug with
EntryPoints
in Spyder IDE (#2584) - Fixed electrolyte conservation when options {"surface form": "algebraic"} are used
- Fixed "constant concentration" electrolyte model so that "porosity times concentration" is conserved when porosity changes (#2529)
- Fix installation on
Google Colab
(pybtex
andColab
issue) (#2526)
Breaking changes
- Renamed "Negative/Positive electrode SOC" to "Negative/Positive electrode stoichiometry" to avoid confusion with cell SOC (#2529)
- Removed external variables and submodels. InputParameter should now be used in all cases (#2502)
- Trying to use a solver to solve multiple models results in a RuntimeError exception (#2481)
- Inputs for the
ElectrodeSOH
solver are now (i) "Q_Li", the total cyclable capacity of lithium in the electrodes (previously "n_Li", the total number of moles, n_Li = 3600/F * Q_Li) (ii) "Q_n", the capacity of the negative electrode (previously "C_n"), and "Q_p", the capacity of the positive electrode (previously "C_p") (#2508)