Skip to content

Commit

Permalink
#858 update state vector to allow derivative of y or ydot
Browse files Browse the repository at this point in the history
  • Loading branch information
martinjrobins committed Mar 4, 2020
1 parent 801492b commit 5127652
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pybamm/expression_tree/state_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ def _base_evaluate(self, t=None, y=None, u=None):
return out

def _jac(self, variable):
if isinstance(variable, pybamm.StateVector):
return _jac_same_vector(variable)
else if isinstance(variable, pybamm.StateVector):

def _jac_same_vector(self, variable):
"""
Differentiate a slice of a StateVector of size m with respect to another
slice of a StateVector of size n. This returns a (sparse) matrix of size
Expand Down

0 comments on commit 5127652

Please sign in to comment.