Implementation of the implicit backward Euler method