substitute_pyomo2casadi

(function from pyomo.dae.simulator)

pyomo.dae.simulator.substitute_pyomo2casadi(expr, templatemap)[source]

Substitute IndexTemplates in an expression tree.

This substitution function is used to replace Pyomo intrinsic functions with CasADi functions.

Parameters:
  • expr – a Pyomo expression

  • templatemap – dictionary mapping _GetItemIndexer objects to mutable params

Returns:

a new expression tree with all substitutions done