Dynamic coupling design for nonlinear output agreement and time-varying flow control