simulation systems or cost functions with division by zero leads to error/hang up in casadi integrator.