The linear theory of a plane regular truss built by means of the variational principles of Lagrange and Castigliano. According to glueing method, the truss was split into nodes and rods. Elastic analysis of rods and geometric conditions of the conjugation of their with the nodes showed that the stress-strain state of the truss is described by the nodal displacements, the total elongations of the rods and internal initial forces in them. All these unknown values are functions of two integer parameters, used for numbering the nodes and rods. The result of element-wise elastic analysis was the relationships connecting the total elongation of the rods with nodal displacements and initial forces. The remaining defining equations of the theory are derived from the variational principles of Lagrange and Castigliano, based on the discrete analogue of the calculus of variations. Its functionals are formed by sums and depend on functions of discrete arguments From the variational principle of Lagrange the static equations are obtained and a formulation of the boundary value problem in nodal displacements is given. The general solution of the static equations is represented to within two functions of integer parameters called force functions. Pointing to the redundancy of elastic systems, they play the same role as stress functions in the mechanics of elastic bodies. Using force functions, the compatibility equations for the total elongation of the rods are derived from the Castigliano variational principle and formulations of the boundary value problem in the initial forces and in the force functions is given.