Helper class to calculate the Jacobian of an expression.
known_jacs (dict {variable ids -> pybamm.Symbol}) – cached jacobians
clear_domain (bool) – whether or not the Jacobian clears the domain (default True)
This function recurses down the tree, computing the Jacobian using the Jacobians defined in classes derived from pybamm.Symbol. E.g. the Jacobian of a ‘pybamm.Multiplication’ is computed via the product rule. If the Jacobian of a symbol has already been calculated, the stored value is returned. Note: The Jacobian is the derivative of a symbol with respect to a (slice of) a State Vector.
symbol (pybamm.Symbol) – The symbol to calculate the Jacobian of
variable (pybamm.Symbol) – The variable with respect to which to differentiate
Symbol representing the Jacobian