lhs = sum(
                    m.flow[inp, out, p, ts] * m.timeincrement[ts]
                    for p, ts in m.TIMEINDEX