Skip to content
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
3e32d20
Add test and fix bug
pipliggins Sep 13, 2025
6f54438
style: pre-commit fixes
pre-commit-ci[bot] Sep 13, 2025
6c889db
Remove some unused arguments
pipliggins Sep 17, 2025
cad2c3f
style: pre-commit fixes
pre-commit-ci[bot] Oct 13, 2025
37c28a5
First pass at making model.y0 a list of len(inputs).
pipliggins Oct 16, 2025
d9b6ad7
Fix all tests except jax
pipliggins Oct 16, 2025
0053240
style: pre-commit fixes
pre-commit-ci[bot] Oct 16, 2025
eb6bdb9
Merge branch 'develop' into 5154-input-params
pipliggins Oct 20, 2025
ad9eaa8
Update jax solver
pipliggins Oct 24, 2025
3c5006c
Merge branch 'develop' into 5154-input-params
pipliggins Oct 24, 2025
ceee46c
Add a y0 property to BaseModel for backwards compatibility
pipliggins Oct 24, 2025
ed97506
Test that events are caught all the way through an inputs list
pipliggins Oct 24, 2025
ba5d56b
Make my zips strict
pipliggins Oct 24, 2025
d06d979
inputs to _integrate must be list[dict]
pipliggins Oct 24, 2025
2f97cc7
Refactor _integrate_single and add test for error
pipliggins Oct 27, 2025
4a4b5fb
style: pre-commit fixes
pre-commit-ci[bot] Oct 27, 2025
8e4f45b
Merge branch 'develop' into 5154-input-params
pipliggins Oct 27, 2025
d40cec3
Fix example script error
pipliggins Oct 27, 2025
6818544
Remove unused y0S from _integrate_single
pipliggins Oct 27, 2025
8ab05ad
style: pre-commit fixes
pre-commit-ci[bot] Oct 27, 2025
381d488
Add ids to parameterized idaklu-jax tests
pipliggins Oct 28, 2025
f81ca5c
style: pre-commit fixes
pre-commit-ci[bot] Oct 28, 2025
b6ea79c
Merge branch 'develop' into 5154-input-params
pipliggins Nov 3, 2025
d05d9d8
Use BaseModel for integration test with obvious initial cons/input pa…
pipliggins Nov 4, 2025
7bb4d99
Don't be too strict with func_args longer than symbol.children
agriyakhetarpal Nov 13, 2025
56bd16f
Add a test
agriyakhetarpal Nov 13, 2025
e538149
Merge branch 'develop' into roundtrip-serialisation-fix
agriyakhetarpal Nov 14, 2025
425af11
Add support for uniform grid sizing across subdomains (#720) (#5253)
swastim01 Nov 15, 2025
d24a728
Merge branch 'develop' into roundtrip-serialisation-fix
agriyakhetarpal Nov 15, 2025
6ba2cde
Fix typo in Butler-Volmer equation docstring (#5279)
cnaples79 Nov 16, 2025
e893156
fix bug with bulk ocp lithiation (#5280)
rtimms Nov 18, 2025
6c8cbfd
doc: fix typo in concentration description in notebook (#5284)
gregordecristoforo Nov 19, 2025
af64ddd
Merge pull request #5276 from pybamm-team/main
valentinsulzer Nov 19, 2025
385ae7b
fix: instruct uv to install into system for CI (#5288)
pipliggins Nov 20, 2025
1319b4a
Fix `InputParameter` serialisation (#5289)
MarcBerliner Nov 20, 2025
eda4ebe
Merge branch 'develop' into roundtrip-serialisation-fix
valentinsulzer Nov 20, 2025
86fec31
Merge pull request #5274 from agriyakhetarpal/roundtrip-serialisation…
valentinsulzer Nov 20, 2025
80e1870
Bugfix: inputs for `initial_conditions_from` scale evaluation (#5285)
BradyPlanden Nov 21, 2025
4e06880
Merge branch 'develop' into 5154-input-params
pipliggins Nov 21, 2025
f77c002
Fix broken test after merge
pipliggins Nov 21, 2025
300c553
Move calculation of t_eval with discontinuities into single loop
pipliggins Nov 24, 2025
73ab559
Add `silence_sundials_errors` solver option (#5290)
BradyPlanden Nov 24, 2025
e37f985
Merge branch 'develop' into 5154-input-params
pipliggins Nov 25, 2025
a1f5a90
Experiments can't use lists of inputs, remove references to inputs li…
pipliggins Nov 26, 2025
ef3006f
coverage changes
pipliggins Nov 26, 2025
3204e1e
Mark jax gpu/unknown platform as no coverage
pipliggins Nov 26, 2025
bb62015
Fix idaklu-jax closure bug?
pipliggins Nov 26, 2025
789e717
try again
pipliggins Nov 26, 2025
7e6dbbe
Add test for different discontinuity event times error
pipliggins Nov 26, 2025
19c8b50
Test for model.y0 error
pipliggins Nov 26, 2025
df19f3c
Revert jax changes
pipliggins Nov 27, 2025
593d2aa
Update C-Rate current for changing nominal capacity (#5286)
BradyPlanden Nov 27, 2025
91f29ef
Merge branch 'develop' into 5154-input-params
pipliggins Dec 1, 2025
97b03ff
fix jax test?
pipliggins Dec 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 19 additions & 33 deletions docs/source/examples/notebooks/solvers/dae-solver.ipynb

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions src/pybamm/models/base_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,17 @@ def algebraic_root_solver(self):
def algebraic_root_solver(self, algebraic_root_solver):
self._algebraic_root_solver = algebraic_root_solver

@property
def y0(self):
if not hasattr(self, "y0_list") or self.y0_list is None:
return None
elif len(self.y0_list) == 1:
return self.y0_list[0]
else:
raise ValueError(
"Model contains multiple initial states. Access using y0_list instead."
)

def get_parameter_info(self, by_submodel=False):
"""
Extracts the parameter information and returns it as a dictionary.
Expand Down
2 changes: 0 additions & 2 deletions src/pybamm/simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,6 @@ def solve(
showprogress=False,
inputs=None,
t_interp=None,
initial_conditions=None,
**kwargs,
):
"""
Expand Down Expand Up @@ -542,7 +541,6 @@ def solve(
inputs=inputs,
t_interp=t_interp,
**kwargs,
initial_conditions=initial_conditions,
)

elif self.operating_mode == "with experiment":
Expand Down
11 changes: 9 additions & 2 deletions src/pybamm/solvers/algebraic_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def tol(self):
def tol(self, value):
self._tol = value

def _integrate(self, model, t_eval, inputs_dict=None, t_interp=None):
def _integrate_single(self, model, t_eval, inputs_dict, y0):
"""
Calculate the solution of the algebraic equations through root-finding

Expand All @@ -90,14 +90,21 @@ def _integrate(self, model, t_eval, inputs_dict=None, t_interp=None):
The times at which to compute the solution
inputs_dict : dict, optional
Any input parameters to pass to the model when solving
y0 : array-like
The initial conditions for the model

Returns
-------
:class:`pybamm.Solution`
A Solution object containing the times and values of the solution,
as well as various diagnostic messages.
"""
inputs_dict = inputs_dict or {}
if model.convert_to_format == "casadi":
inputs = casadi.vertcat(*[x for x in inputs_dict.values()])
else:
inputs = inputs_dict

y0 = model.y0
if isinstance(y0, casadi.DM):
y0 = y0.full()
y0 = y0.flatten()
Expand Down
Loading
Loading