Skip to content

Commit ea59d9f

Browse files
committed
#1477 fix bug with bounds
1 parent 9291bb9 commit ea59d9f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pybamm/solvers/base_solver.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ def jacp(*args, **kwargs):
613613
n_inputs = model.len_rhs_sens // model.len_rhs
614614
elif model.len_alg != 0:
615615
n_inputs = model.len_alg_sens // model.len_alg
616-
if model.bounds[0].shape[0] < model.len_alg + model.len_alg_sens:
616+
if model.bounds[0].shape[0] == model.len_rhs_and_alg:
617617
model.bounds = (
618618
np.repeat(model.bounds[0], n_inputs + 1),
619619
np.repeat(model.bounds[1], n_inputs + 1),
@@ -635,10 +635,10 @@ def jacp(*args, **kwargs):
635635
)
636636
else:
637637
# take care if calculate_sensitivites used then not used
638-
if model.bounds[0].shape[0] > model.len_alg:
638+
if model.bounds[0].shape[0] > model.len_rhs_and_alg:
639639
model.bounds = (
640-
model.bounds[0][:model.len_alg],
641-
model.bounds[1][:model.len_alg],
640+
model.bounds[0][:model.len_rhs_and_alg],
641+
model.bounds[1][:model.len_rhs_and_alg],
642642
)
643643
if (model.mass_matrix is not None and
644644
model.mass_matrix.shape[0] > model.len_rhs_and_alg):

0 commit comments

Comments
 (0)