Abstract Nonlinear complementarity problems and variational inequalities in nonlinear equilibrium problems are studied within a unified framework. Based on the generalized Rockafellar–Tonti diagram, a bi-complementarity problem with both internal and external nonlinear complementarity conditions is proposed. A general duality theory in variational inequality is established and the Mosco dual variational inequality has been generalized to the nonsmooth systems. In order to study the frictional contact problem of beam theory, a two-dimensional elastoplastic beam model is proposed. The external complementarity condition provides the free boundary of contact region, while the internal complementarity condition gives the interface of the elastic–plastic regions. Our results shown that in nonsmooth equilibrium problems, the dual approaches are much easier than the primal problems.