An iterative penalty function method in structural analysis