A general system of differential equations to model first order adaptive algorithms