Skip to content

Commit

Permalink
#1477 fix bug with bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjrobins committed Aug 5, 2021
1 parent 9291bb9 commit ea59d9f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pybamm/solvers/base_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ def jacp(*args, **kwargs):
n_inputs = model.len_rhs_sens // model.len_rhs
elif model.len_alg != 0:
n_inputs = model.len_alg_sens // model.len_alg
if model.bounds[0].shape[0] < model.len_alg + model.len_alg_sens:
if model.bounds[0].shape[0] == model.len_rhs_and_alg:
model.bounds = (
np.repeat(model.bounds[0], n_inputs + 1),
np.repeat(model.bounds[1], n_inputs + 1),
Expand All @@ -635,10 +635,10 @@ def jacp(*args, **kwargs):
)
else:
# take care if calculate_sensitivites used then not used
if model.bounds[0].shape[0] > model.len_alg:
if model.bounds[0].shape[0] > model.len_rhs_and_alg:
model.bounds = (
model.bounds[0][:model.len_alg],
model.bounds[1][:model.len_alg],
model.bounds[0][:model.len_rhs_and_alg],
model.bounds[1][:model.len_rhs_and_alg],
)
if (model.mass_matrix is not None and
model.mass_matrix.shape[0] > model.len_rhs_and_alg):
Expand Down

0 comments on commit ea59d9f

Please sign in to comment.