Many problems of optimization and equilibrium result in models in the general class of variational conditions, sometimes in a generalized form. Thus, if the problem is one of optimization, we first write optimality conditions and then try to compute with those. If instead of an optimization model we have a model involving some kind of equilibrium, then we write conditions expressing the equilibrium situation and try to solve those conditions. In general, such conditions will involve nonsmoothness (discontinuities in the first derivative) in an essential way.