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 convertt (
casadi.MX
) – A casadi symbol representing timey (
casadi.MX
) – A casadi symbol representing state vectorsy_dot (
casadi.MX
) – A casadi symbol representing time derivatives of state vectorsinputs (dict) – A dictionary of casadi symbols representing parameters
- Returns:
The converted symbol
- Return type:
casadi.MX