Calculus of variations is a powerful tool for research in the field of mechanics. Variation principles, on the one hand, have a deep theoretical significance, revealing the energy basis of the theory and establishing a connection between different approaches to solving problems. On the other hand, they are of great practical significance, because if there are expressions for functional, they allow to find differential equations and natural (not caused by external circumstances) boundary conditions in cases where it is difficult to do so directly. Moreover, direct methods allow getting a solution to the variation problem, passing the compilation and solution of differential equations. Based on the variation principle of structural synthesis, the design problem for a rod spatial structure is solved. The example of designing a four-rod truss is considered.