Convert to CasADi#

class pybamm.CasadiConverter(casadi_symbols=None)[source]#
convert(symbol: Symbol, t: MX, y: MX, y_dot: MX, inputs: dict | None) MX[source]#

This function recurses down the tree, converting the PyBaMM expression tree to a CasADi expression tree

Parameters:
  • symbol (pybamm.Symbol) – The symbol to convert

  • t (casadi.MX) – A casadi symbol representing time

  • y (casadi.MX) – A casadi symbol representing state vectors

  • y_dot (casadi.MX) – A casadi symbol representing time derivatives of state vectors

  • inputs (dict) – A dictionary of casadi symbols representing parameters

Returns:

The converted symbol

Return type:

casadi.MX