Nonlinear Least pth Approximation and Nonlinear Programming with Applications in the Design of Networks and Systems