Abstract A numerical approach is presented to determine the load bearing capacity of structural elements made of heterogeneous materials subjected to variable loads. Melan’s lower-bound shakedown theorem is applied to representative volume elements. Combined with the homogenization technique, the material effective properties are determined through transformation from the mesoscopic to macroscopic admissible loading domains. For the numerical applications, finite element method and large-scale nonlinear optimization, based on an interior-point-algorithm, are used. The methodology is illustrated by the application to regular and random heterogeneous materials. This way, the proposed method provides a direct numerical approach to evaluate the macroscopic strength of heterogeneous structures as a useful tool for the design of structures.