Nonlinear superposition law for generalized Ermakov systems