A new method of solving some discrete problems of mechanics