Stochastic Approximation Methods for Constrained and Unconstrained Systems