A dissipated energy maximization approach to elastic-perfectly plastic analysis of planar frames