Skip to content

Commit 5127652

Browse files
committed
#858 update state vector to allow derivative of y or ydot
1 parent 801492b commit 5127652

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pybamm/expression_tree/state_vector.py

+5
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,11 @@ def _base_evaluate(self, t=None, y=None, u=None):
118118
return out
119119

120120
def _jac(self, variable):
121+
if isinstance(variable, pybamm.StateVector):
122+
return _jac_same_vector(variable)
123+
else if isinstance(variable, pybamm.StateVector):
124+
125+
def _jac_same_vector(self, variable):
121126
"""
122127
Differentiate a slice of a StateVector of size m with respect to another
123128
slice of a StateVector of size n. This returns a (sparse) matrix of size

0 commit comments

Comments
 (0)