if Nb != Ntd:
                raise ValueError('Inconsistent size of b_lo and b_up')