File tree 1 file changed +2
-3
lines changed
1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -608,9 +608,9 @@ def jacp(*args, **kwargs):
608
608
609
609
# if we have changed the equations to include the explicit sensitivity
610
610
# equations, then we also need to update the mass matrix
611
- n_inputs = model .len_rhs_sens // model .len_rhs
612
611
n_state_without_sens = model .len_rhs_and_alg
613
612
if calculate_sensitivities_explicit :
613
+ n_inputs = model .len_rhs_sens // model .len_rhs
614
614
if model .mass_matrix .shape [0 ] == n_state_without_sens :
615
615
model .mass_matrix_inv = pybamm .Matrix (
616
616
block_diag (
@@ -625,8 +625,7 @@ def jacp(*args, **kwargs):
625
625
)
626
626
else :
627
627
# take care if calculate_sensitivites used then not used
628
- n_state_with_sens = model .len_rhs_and_alg * (n_inputs + 1 )
629
- if model .mass_matrix .shape [0 ] == n_state_with_sens :
628
+ if model .mass_matrix .shape [0 ] > n_state_without_sens :
630
629
model .mass_matrix_inv = pybamm .Matrix (
631
630
model .mass_matrix_inv .entries [:n_state_without_sens ,
632
631
:n_state_without_sens ]
You can’t perform that action at this time.
0 commit comments