Skip to main content

A 99 line code for discretized Michell truss optimization written in Mathematica


The main purpose of the paper is to provide an easy-to-use code for topological optimization of the least weight trusses, written in the Mathematica programming language. The main idea of the presented approach consists in using a fixed ground structure and the linear programming formulation of the optimization problem. The solver is based on the fast interior point method. The strong effort is done to create the effective generator of the computational model utilizing the high regularity of the ground structure and the high sparsity of the geometric matrix. The efficiency and reliability of the algorithm is confirmed in several numerical tests. Due to a linear programming formulation of the optimization problem the method presented in the paper assures finding the global optimum, hence it may be considered as the useful tool for verification of results obtained in other ways. The appended complete Mathematica code of the program developed will be supplied by the Publisher on SpringerLink.


The optimum design problem: find the lightest, plane, pin-jointed frame of a bounded compliance, transmitting a given loading to a part of the boundary of the given feasible domain—turns out to be equivalent to the problem of finding the lightest pin-jointed frame of a bounded stress level, with equal stress limits in tension and compression, transmitting the loading to the prescribed boundary of the feasible domain, see Hemp (1973) and Achtziger (1997). The analytical solutions to this problem must satisfy the conditions of the theory of Michell trusses; see Hemp (1973) and Rozvany et al. (1995). These solutions exceed the class of trusses: they are discrete-continuous structures composed of the fibrous domains of orthogonal microstructure reinforced by bars of finite cross sections. These solutions can be approximated from within the subclass of trusses (i.e. pin-jointed frames of finite number of bars) or from within the continuum description thus giving up prediction of the reinforcing bars and excluding possibility of considering the point loads. Having at our disposal these two approximate methods to attack the initial problem it is thought appropriate yet to choose the discrete approximation—as free of the two drawbacks mentioned. The natural incorporation of the point loads seems here crucial; note that almost all available Michell solutions concern this class of loadings.

Note, however, that the sole knowledge of the Michell’s theory does not deliver hints of how the optimal layout looks like. Only having an impression of the correct layout one can construct the Hencky net and then endow it with appropriate mechanical properties. The complete solutions are rare. It is sufficient to stress here that the static part of the theory of Michell’s cantilever supported on a circle has only been put forward in the relatively new paper by Graczykowski and Lewiński (2005), where a proof of vanishing the duality gap between kinematic and static formulations of this problem has been published. Note also, that due to hyperbolicity of the governing equations of Michell’s trusses the layouts are usually composed of many subdomains with border lines being the lines of discontinuity of some stress components; see e.g. Fig. 3 in Graczykowski and Lewiński (2007).

Having in view the above mentioned properties of Michell trusses it is not easy to predict a new solution correctly: many layouts can be imagined as correct for the same load and the same feasible domain geometry. It is really not clear which of them should be discussed and which of them should be rejected a priori. The new layouts are not the simple composition of the known layouts. Some suggestions are very convincing, but may be misleading. Thus a theoretician needs an unbiased hint from the purely numerical side.

The really valuable numerical predictions of Michell-like structures do not draw upon the properties of the known analytical solutions. The genuine method of their construction was developed in Dorn et al. (1964); it is based on the concept of the ground structure composed of all bars connecting given regular set of nodes. Most of these bars are not necessary to equilibrate the applied loading and, consequently, disappear during the optimization process. This prediction, however, cannot be done in advance. The cross section areas are the main but not the only design variables. The crucial point of this approach is that the cross section areas may assume nonnegative values. Thus the zero values are admissible, which paves the way to find the catenary structures, capable of carrying only one set of loads. Let us remind here the funicular structures transmitting systems of parallel forces to fixed supports. Such a specific class of structures should be encompassed by the numerical methods. The ground structure methods satisfy this condition, provided that the global stiffness matrix is not required to be invertible.

The present paper is close in spirit to the paper by Gilbert and Tyas (2003), where the initial optimization problem has been rearranged to the so called plastic design formulation assuming the form of the linear programming problem. Gilbert and Tyas (2003) solved this problem with using the interior point method. They significantly improved the traditional ground structure approach by the iterative member adding technique.

The same numerical problem is solved in the present paper by other implementation of the interior point method, announced in Sokół and Lewiński (2009). The code has been written in Mathematica 7 symbolic language, seek Wolfram (2003). The method as such would be useless, without taking advantage of the geometric matrix being sparse. The details of the program are explained in Section 3, while the whole 99-line optimization code has been appended to the paper. This reference to the title of the popular paper by Sigmund (2001) has been suggested by anonymous Reviewer. The code listed here can be freely downloaded from the internet web page connected with this paper, see Online Resource 1.

The software developed applies to the case of plastic design with: (a) equal permissible stresses in tension and compression: σ T  = σ C , (b) unequal stress bounds for tension and compression: \(\sigma_{T} \ne \sigma_{C}\). This numerical tool makes it possible to construct new optimal layouts for which the analytical solutions are unknown, and to check already published analytical solutions. In particular, the present paper confirms that the analytical results published in Lewiński et al. (1994a, b) for the case of σ T  = σ C and in Graczykowski and Lewiński (2007) for the case of unequal stress limits—are correct. In particular, this software has delivered a numerical confirmation of the huge family of benchmarks being published in Graczykowski and Lewiński (2010).

The software developed has also made it possible to predict a correct layout of the unsolved till now problem of two symmetric parallel forces to be optimally transmitted to fixed nodes, in the case of the feasible domain being the half-plane. This numerical prediction has paved the way to find the analytical solution. The optimal layout turns out to compare favourably with the numerical results for the ground structures of high density; the reader is referred to Sokół and Lewiński (submitted) for the details.

Concluding, the software developed delivers numerical predictions of the characteristics of the optimal layouts with the volume predictions approaching the optimal volume with arbitrary accuracy. Since the analytical predictions are usually found by the kinematic method, while the numerical predictions follow from static consideration, this consistency of both the results—showing that the duality gap is slowly vanishing with increase of the density of the ground structure - simultaneously confirms correctness of the analytical results.

Minimum volume truss optimization problem

The goal of the present paper is to find a truss of minimal volume subject to the compliance constraint, as formulated bellow; cf. Achtziger (2007)

$$ {\begin{array}{@{}ll} \raisebox{4pt}[0pc][0pc]{$s.t.$} & {{\begin{array}{@{}l} {\mathop {\min }\limits_{{\rm {\bf A}}\in R^M,\;{\rm {\bf q}}\in R^N} {\rm {\bf L}}^T{\rm {\bf A}}} \\[8pt] {{\rm {\bf K}}\,{\rm {\bf q}}={\rm {\bf P}}} \\[2pt] {{\rm {\bf P}}^T{\rm {\bf q}}\le W_0 } \\[2pt] {{\rm {\bf A}}\ge 0} \\ \end{array} }} \\ \end{array} } $$

Here \({\bf L} = [L_{1}, L_{2}, ..., L_{M}]^{T}\) represents the vector of bar lengths, \({\bf A} = [A_{1}, A_{2}, ..., A_{M}]^{T}\) represents the vector of cross section areas, while P and q are the vectors of nodal loads and displacements. K is the stiffness matrix and W 0 is a given positive constant. The last inequality is understood component-wise i.e. A i  ≥ 0. The cross section areas A i are the main design variables. If the ground structure is viewed as fixed, the vector L of bar lengths is prescribed. Note that the equilibrium equations are treated as equality constraints. The displacements q j are state variables, independent of A i . Thus the number of unknown variables is N + M. Finding numerical solution to problem (1) requires expensive methods of the nonlinear programming. Therefore, it is rather not applicable for large tasks corresponding to the ground structures of high density, with big N and M numbers.

To make the problem less complex we shall pass to the formulation with forces in members as the only state variables, see Achtziger (2007) and Gilbert and Tyas (2003). The problem (1) can be reformulated to equivalent formulation (Achtziger 2007)

$$ {\begin{array}{@{}llc} \raisebox{-2pt}[0pc][0pc]{$s.t.$} \hfill & {{\begin{array}{@{}l} {\mathop {\min }\limits_{{\rm {\bf T}}\in R^M,\,{\rm {\bf C}}\in R^M} {\rm {\bf L}}^T({{\rm {\bf T}}+{\rm {\bf C}}})} \\[10pt] {{\rm {\bf B}}^T\,({{\rm {\bf T}}-{\rm {\bf C}}})={\rm {\bf P}}} \\[2pt] {{\rm {\bf T}}\ge {\rm {\bf 0}},\;\;\;\;{\rm {\bf C}}\ge {\rm {\bf 0}}} \\[2pt] \end{array} }} \hfill \\ \end{array} } $$

where T and C are the vectors of tension and compression forces in bars and B is the geometric matrix of components representing directional cosines of bars. The latter problem, being still equivalent to the problem (1), involves 2M design variables but now it becomes a linear programming problem that can be solved by well-developed numerical tools, applicable for large number of unknowns. Thus the ground structures of high density may be successfully analyzed.

The problem (2) may be rearranged to a standard form of a linear programming problem by introducing the new design variables:

$$ \emph{v}_i =T_i \;L_i \;\mbox{and}\;\emph{v}_{M+i} =C_i \;L_i \;\mbox{for}\;i=1,\ldots ,M. $$

and by introducing the matrix

$$\begin{array}{rll} {\rm {\bf H}}&=&\big[{{\rm {\bf B}}^T{\bf \Lambda},-{\rm {\bf B}}^T{\bf \Lambda}}\big],\;\mbox{where}\\ {\bf \Lambda} &=&\mbox{diag}[{1 /L_1}, 1/{L_2}, \ldots, 1/L_{M}]. \end{array}$$

Computation of this matrix may be performed by dividing every column of matrix B T by the length of the corresponding bar, but H may also be derived directly by computing the quotients \(\Delta x_i /L_i^2\) and \(\Delta y_i /L_i^2\). Note that for integer increments Δx i and Δy i the components of matrix H are rational numbers and may be preserved in exact form (using appropriate software). For currently available optimization method it is not any advantage, but it may be important for future numerical treatments. To conclude, the truss topology optimization problem may be written in the standard form of linear programming as follows

$$ {\begin{array}{@{}ll} \raisebox{-3pt}[0pc][0pc]{$s.t.$} & {{\begin{array}{@{}l} \displaystyle {\mathop {\min }\limits_{\emph{v}\in R^{2M}} \sum\limits_i {\emph{v}_i} ={\rm {\bf e}}^T\,{\rm {\bf v}}} \\[10pt] {{\rm {\bf H}}\,{\rm {\bf v}}={\rm {\bf P}}} \\[2pt] {{\rm {\bf v}}\ge {\rm {\bf 0}}} \\ \end{array} }} \\ \end{array} } $$

with all cost coefficients in the objective function equal to one (e is a vector of length 2M, whose entries are all equal to 1).

The objective functions in (2) or (5) correspond to—but are not exactly—the optimum volume determined by (1). The problem consists just in simple scaling but to make the paper self-contained the basic formulas will be outlined bellow. For easier comparison of results obtained in different ways it is worth to introduce a normalized, non-dimensional volume as well as other auxiliary quantities. The static problem considered in the paper is linear. Consequently, if two times bigger loading is applied two times bigger displacements and axial forces will appear. Similarly the lengths of bars are proportional to the size of the structure. It is worth to introduce the non-dimensional quantities (denoted by upper dash) in the following manner:

$$ {\rm {\bf P}}=P\overline {\rm {\bf P}} ,\;\;\;{\rm {\bf S}}=P\overline {\rm {\bf S}} ,\;\;\;{\rm {\bf L}}=h\overline {\rm {\bf L}} ,\;\;\;{\rm {\bf q}}=P{\kern-.7pt} h\overline {\rm {\bf q}} ,\;\;\;\mbox{etc}. $$

where the scalar P is a referential load intensity and h is an arbitrary chosen size of a structure (height, length, width, etc.). The optimal volume subject to constrained compliance may be written as

$$ V_W =\frac{\left( {\sum {\left| {S_i } \right|L_i } } \right)^2}{E\,W_0 }=\frac{P^2h^2}{E\,W_0}\left( {\sum {\left| {\overline S _i } \right|\overline L _i } } \right)^2=\frac{P^2h^2}{E\,W_0 }\;\overline V _W, $$

where \(\overline{V}_W \) is a non-dimensional compliance controlled volume, given by

$$ \overline{V}_W =\left( {\sum {\left| {\overline{S}_i } \right|\overline{L}_i }} \right)^2, $$

Correspondingly, the optimal volume subject to constrained stresses is expressed by

$$ V_\sigma =\frac{\sum {\left| {S_i } \right|L_i } }{\sigma _0 }=\frac{Ph}{\sigma _0 }\left( {\sum {\left| {\overline{S}_i } \right|\bar {L}_i } } \right)=\frac{Ph}{\sigma _0 }\;\overline{V}_\sigma , $$

where \(\overline V _\sigma \) is a normalized, non-dimensional stress controlled volume, given by

$$ \overline V _\sigma =\sum {\left| {\overline S _i } \right|\overline L _i } . $$

Note that equations linking stress and compliance controlled volumes are quadratic; for example:

$$ \overline V _\sigma =\sqrt {\overline V _W } $$


$$ V_W =\frac{\sigma _0^2 }{E\,W_0 }V_\sigma ^2 . $$

These formulas are important for proper interpretation and comparison of different results presented in the literature, see Gilbert and Tyas (2003) and Achtziger (2007). Further, we shall write \(\overline V _\sigma =\overline V\).

The plastic layout optimization problem (2) can be generalized to the case of unequal stress limits for tension and compression: \(\sigma_{T} \ne \sigma_{C}\). Note that in fully-stressed trusses the volumes of the bars under tension are equal to T i L i /σ T and the volumes of the bars under compression are equal to C i L i /σ C . Thus we can formulate the following optimization problem

$$ {\begin{array}{@{}ll} \raisebox{-4pt}[0pc][0pc]{$s.t.$} & {{\begin{array}{@{}l} {\mathop {\min }\limits_{{\rm {\bf T}}\in R^M,\,{\rm {\bf C}}\in R^M} {\rm {\bf L}}^T{\rm {\bf T}}+\kappa \,{\rm {\bf L}}^T{\rm {\bf C}}} \\[10pt] {{\rm {\bf B}}^T\,\left( {{\rm {\bf T}}-{\rm {\bf C}}} \right)={\rm {\bf P}}} \\[2pt] {{\rm {\bf T}}\ge {\rm {\bf 0}},\quad {\rm {\bf C}}\ge {\rm {\bf 0}}} \\ \end{array} }} \\ \end{array} }, $$

in which the ratio of limiting stresses is denoted by κ = σ T /σ C . Passing from (2) to (13) requires only a “cosmetic” change in the objective function. Note, however, that the latter problem is not equivalent to the problems previously discussed in this paper, see Rozvany (1996).

Details of numerical implementation

The choice of the adequate optimization method directly depends on the type of the problem to be solved. In the case of optimization problem (1) the general or specialized methods of nonlinear programming have to be applied. Usually they are expensive and limited to relatively small tasks. Contrary, the problems (2), (5) and (13) may be solved using linear programming methods. The most popular, the simplex or revised simplex methods are possible but not adequate for large-scale problems. In practice, such tasks with thousands of unknowns are almost intractable using these methods due to the exponentially growing time of computation regarding to the problem size. However, the newer and much more effective linear programming methods are becoming available. For today, the interior point method is one of the most reasonable choices. This method was developed by Karmarkar (1984) and later improved by Mehrotra (1992), Wright (1997) and Nocedal and Wright (1999). The method has even been successfully generalized to a class of nonlinear convex optimization problems. The basic idea of the method consists of a barrier function used to encode the convex set of constraints. Contrary to the simplex method which goes along the boundary, it moves through the interior of the feasible region and reaches the optimal solution asymptotically. Two most popular versions of this method: the primal affine scaling method and the primal–dual interior point method are presented in detail in the book by Bhatti (2000). The second version requires more memory but is significantly faster.

The next, very important topic in developing the whole algorithm is the generator of the computational model. It should be noted that the fixed ground structure has to be dense but at the same time very regular. It is composed of groups of identical elements (neglecting unessential translations in XY plane or XYZ space). The stiffness matrices as well as directional cosines are equal in these groups and may be calculated only once for a given group of bars. For a dense ground structure, thousands of bars in one group may exist so the final profit of the single calculation is significant. Moreover, due to high regularity of the mesh there is no need of creating nodes and elements like in a typical FEM program—they are optionally needed only for graphical presentations. In the program presented in this paper the patterns of elements are introduced to preserve the memory. The pattern includes the necessary and condensed data for the whole family of bars; they are: nodal increments, indices for loops, lengths and directional cosines of bars (see Appendix 1). To solve the optimization problem (2) all what is needed is creating the vectors L, P and the geometric matrix B. The last one requires, however, the further attention. It is clear that this matrix is very sparse. Independently of the problem size every row of it contains only four nonzero elements (or six for space trusses). This sparsity must be utilized to make the algorithm efficient. First of all, the sparse matrix representation allows to preserve a huge amount of memory and to deal with large-scale problems, that otherwise would be intractable. Additionally, the great benefit of the computation time may be achieved by avoiding unnecessary algebraic operations, especially multiplication by zero. Obviously it requires applying some specialized procedures (libraries) for sparse matrices, but in the present day they are commonly available. Concluding, the sparse matrix representation is essential for the overall efficiency of the algorithm, especially for large-scale problems. The larger problem size is—the greater benefit of memory and processor time may be achieved.

Let us consider the plane truss with the ground structure restricted to the rectangular area. Three demonstrative examples of such structures are shown in Fig. 1. Note that the mesh density is described by four numbers: N X , N Y , D X , D Y . The first two denote the numbers of divisions of the rectangle in X and Y directions, and correspond to the “external” density. (Every node in the mesh is uniquely identified by a pair of integers, numbered from 0 to N X and from 0 to N Y for X and Y directions, respectively.) The next two numbers D X and D Y describe the “internal” density—it is a depth (in the Manhattan distance manner) of possible connections between nodes. In general these numbers may also be defined separately for X and Y directions. Nevertheless, if possible, they should be equal. It results from the fact that the ground structure should form the mesh of mutually orthogonal families of bars. Therefore, it is also strongly recommended that the basic cell of the mesh is square, rather than rectangular.

Fig. 1

The examples of ground meshes with different depth of internal connections: a 4 × 3:1 × 1–55 elements, b 4 × 3:4 × 2–115 elements, c 8 × 6:5 × 5–1,054 elements

The code for truss topology optimization has been written in Mathematica 7 (Wolfram 2003). It is the powerful mathematical program with the comfortable environment for advanced computations and visualizations. Thanks to many functions ready for use, like global operations on the whole vectors or matrices, the code is much stricter than in any classical programming languages (like C/C+ + or similar). Moreover the Mathematica has an internal support for sparse matrices and a powerful version of the interior point method (see SparseArray[...] and LinearProgramming[..., Method → “InteriorPoint”] for details). Description of the internal implementation of the interior point method applied in Mathematica is included e.g. in Champion and Strzebonski (2008). The program has been divided into separate procedures (modules) that have thoroughly been tested and optimized for speed and memory usage. For example, to create a dynamic list, the natural but relatively slow functions Append or AppendTo are replaced by more efficient pair of functions Reap-Sow. Many of auxiliary arrays were packed by ToPackedArray function to preserve the memory. Thanks to a compact coding in Mathematica the program is short. Its listing is included in Appendix 1. The program is adjustable and offers the full control of the size and density of the ground structure as well as any loading and supports. The typical call to the program and its output are shown in Fig. 2. The block of input data is simple and takes only first four lines. The example of the data input presented below corresponds to a well known Michell cantilever; cf. Fig. 2.

Fig. 2

The example of calling of the OptimalTruss and its output

For today only plane trusses were implemented and tested in the program. Theoretically the similar algorithm would be used for space trusses but the problem size increases dramatically, thus the smarter strategies are required in this case. It will be the topic of the further research and the next versions of the presented program.


The program described in the previous section has been thoroughly examined in many numerical tests. A few of them are presented bellow.

As the first example, consider a long cantilever beam shown in Fig. 3a. Assume that the domain of possible material is restricted to a rectangular panel with the ratio of length to height equal to 3:1. The left side of the panel is clamped while the right side is loaded by the vertical force applied at the middle-central point. The problem is classical and may be viewed as one of the most popular benchmark tests. The exact-analytical solution was obtained for the first time in Lewiński et al. (1994a); see Fig. 3b. This layout consists of two Michell circular fans of origins at the corner-supports and then of four orthogonal-curvilinear Hencky nets: Michell “shield” (Michell 1904), two Chan fans (Chan 1967), and the “shield” found in Lewiński et al. (1994a). The exact value of the optimal stress controlled volume is equal to 13.5972 Ph/σ 0. It may be observed that middle supports as well as material in some regions are not necessary and disappear in the optimal structure. It is worth to note that the analytical solution is hard to obtain (it requires the advanced mathematical tools for solving hyperbolic differential equations and is based on Bessel and Lommel special functions). Contrary, the numerical solution may easily be obtained using the algorithm presented in this paper.

Fig. 3

Long cantilever problem and the exact optimal truss layout by Lewiński et al. (1994a)

To make the investigation more extensive many different ground structures are tested. The truss layouts obtained for different densities of the ground structure are presented in Figs. 4, 5, 6, 7, 8, 9, 10, 11, and 12. The thickness and the gray scale of lines are proportional to square root of cross section areas. Dark-thick lines correspond to thick bars and light-thin lines—to thin bars, respectively. Obviously the denser ground structures give better results regarding to the optimal volume as well as the distribution of material. Density should however be understood not only as the external division of the domain into the number of rectangular cells. The density of internal connections is of the same importance because it allows transferring of forces in different directions. It is clearly visible on results presented in Figs. 4 and 5. They refer to the ground structures with internal density 1 × 1. It means that only horizontal, vertical and 45°-slope bars are included, like in Fig. 1a. It is no matter what the external density is used—in all cases the optimal volume is equal to 15.0 Ph/σ 0; this result is over 10% worse than exact one. The improvement of the solution may be achieved only after including bars with new directions; compare the results in Figs. 610. The influence of the internal density is evident. For the densest mesh 120 × 40 with internal density 20 × 20 (see Fig. 12), the result is very close to the exact solution; the relative error of the volume is equal to 0.11%. Topology and shape of the final truss correspond also very well to the exact layout shown in Fig. 3b.

Fig. 4

Mesh 6 × 2:1 × 1; V = 15.0 P h/σ 0

Fig. 5

Mesh 60 × 20:1 × 1; V = 15.0 P h/σ 0

Fig. 6

Mesh 6 × 2:2 × 2; V = 14.5 P h/σ 0

Fig. 7

Mesh 12 × 4:2 × 2; V = 13.9321 P h/σ 0

Fig. 8

Mesh 60 × 20:3 × 3; V = 13.6953 P h/σ 0

Fig. 9

Mesh 60 × 20:5 × 5; V = 13.6439 P h/σ 0

Fig. 10

Mesh 60 × 20:20 × 20; V = 13.6343 P h/σ 0

Fig. 11

Mesh 120 × 40:10 × 10; V = 13.6126 P h/σ 0

Fig. 12

Mesh 120 × 40:20 × 20. V = 13.6120 P h/σ 0

The efficiency of the presented algorithm has been thoroughly examined using the internal Mathematica’s functions like ByteCount[], Timing[], etc. The results are collected in Table 1. The first column describes the applied mesh density. The next two columns include the total numbers of nodes and elements. The RAM capacities needed for storing the matrix H defined in (4) are given in two next columns, respectively for sparse and full matrix representations. The next (sixth) column includes the processor time used to solve the optimization problem. The next column presents the normalized, non-dimensional stress volume defined by (10) and the last column includes the relative error corresponding to the exact solution given by Lewiński et al. (1994a). Note that the speed and the numerical stability of the program are very good. The sparse matrix representation allows preserving a lot of memory. For example, in the last densest mesh almost 3.5 millions of design variables were used (two times the number of bars). This task requires more than 250 GB RAM just for storing matrix H in full form and only 159 MB of RAM using sparse matrix representation. The profit is evident. The calculations were performed on Intel Core 2 Duo E8400/3 GHz based PC with 4 GB of RAM. This fact clearly demonstrates the power and efficiency of the presented approach. The last problem took only about 13 min, which is an excellent result for so large-scale problem.

Table 1 Results of the first example regarding to efficiency

The second example is shown in Fig. 13. It is a structure transmitting two symmetrically located vertical forces to two fixed supports. The forces are applied at 1/4 and 3/4 of the span length. The feasible domain is the half plane over the line linking the supports. The layouts obtained for different densities of the mesh are shown in Fig. 14. The results are collected in Table 2. The layouts of Fig. 14 have recently played the role of hints of the analytical solution. This solution is being put forward in the paper by Sokół and Lewiński (submitted); see Fig. 15, where the optimal layout of the problem of Fig. 13 is reported.

Fig. 13

Half-plane with two forces and two fixed supports

Fig. 14

Optimal layouts for different densities of the ground structure

Table 2 Results of the second example regarding to efficiency
Fig. 15

Exact-analytical solution from Sokół and Lewiński (submitted)

All trusses shown in Fig. 14 are structurally unstable. The same property characterizes the Michell continuum in Fig. 15. Despite this instability the solutions are correct, because the virtual work of the forces P on the zero-energy modes vanishes. This is discussed in detail in Sokół and Lewiński (submitted). The great advantage of the numerical method proposed is that it does not exclude such unstable structures from the algorithm. This complies with the Michell remark no III, p. 591 in Michell (1904). It should also be noted that due to direct solving of the linear programming problem (2) the method terminates with a guaranteed correct result.

The last example concerns the reliability of the program in the case of different stress limits for tension and compression: \(\sigma_{T} \ne \sigma_{C}\). The corresponding optimization problem for this case is given in (13). The exact results of the problem shown in Fig. 16 are given by Graczykowski and Lewiński (2010). The following ratios κ = σ T /σ C have been examined: 1, 3, 5, 7, 9, 100. The selected optimal-numerical layouts are presented in Fig. 17. All of them have been executed for the ground structure of density 110 × 40:20:20, with 4,551 nodes and 1,587,926 elements. The volumes obtained in numerical way agree very well with the exact volumes reported in Graczykowski and Lewiński (2010). The layouts fit also very well. For example, the angle of flare of the upper fan matches well the theoretical value of this angle which is equal to \(\arctan (\sqrt \kappa)\). The comparison of the results is given in Table 3. One can notice that the relative error of the volume as well as CPU time increase for growing κ. Thus the tasks with \(\kappa \ne 1\) are harder to solve. The program presented in the paper is capable of solving them successfully.

Fig. 16

Michell cantilever problem for \(\sigma_{T} \ne \sigma_{C}\); see Graczykowski and Lewiński (2010)

Fig. 17

Numerical solutions for: a κ = 1, b κ = 3, c κ = 9, d κ = 100

Table 3 Comparison of analytical and numerical solutions


The computational program developed should serve as a convenient tool for predicting new exact solutions to the Michell problems. The listing of the program can be found in Appendix 1. It requires the Mathematica, version 6 or higher. The program is based on the concept of the ground structure and that is why it produces results which are not built on any knowledge of properties of the optimum layouts. This is the essential virtue of the method, since the complete theory of Michell structures has not been developed till now and we cannot unconditionally say that the properties noted in the most cited reference sources hold good in all specific cases.

The correct prediction of the solution of problem in Fig. 13 seems to be a success, since the pseudo truss in Fig. 15 is structurally unstable and this solution is highly sensitive to the position of forces P, in contrast to the better known cantilever solutions (e.g. Graczykowski and Lewiński 2010; Lewiński et al. 1994a, b) in which the Hencky net is independent of the loading applied.


  1. Achtziger W (1997) Topology optimization of discrete structures: an introduction in view of computational and nonsmooth aspects. In: Rozvany GIN (ed) Topology optimization in structural mechanics. Springer, Heidelberg, pp 57–100

    Google Scholar 

  2. Achtziger W (2007) On simultaneous optimization of truss geometry and topology. Struct Multidisc Optim 33:285–304

    Article  MathSciNet  Google Scholar 

  3. Bhatti MA (2000) Practical optimization methods with Mathematica applications. Springer, New York

    MATH  Google Scholar 

  4. Champion B, Strzebonski A (2008) Constrained optimization. Wolfram Mathematica Tutorial Collection. Wolfram Research, Inc

  5. Chan HSY (1967) Half-plane slip-line fields and Michell structures. Quart J Appl Mech 34:433–448

    Google Scholar 

  6. Dorn WS, Gomory RE, Greenberg HJ (1964) Automatic design of optimal structures. J Mec 3:25–52

    Google Scholar 

  7. Gilbert M, Tyas A (2003) Layout optimization of large-scale pin-jointed frames. Eng Comput 20:1044–1064

    MATH  Article  Google Scholar 

  8. Graczykowski C, Lewiński T (2005) The lightest plane structures of a bounded stress level transmitting a point load to a circular support. Control Cybern 34:227–253

    MATH  Google Scholar 

  9. Graczykowski C, Lewiński T (2007) Michell cantilevers constructed within trapezoidal domains – part IV: complete exact solutions of selected optimal designs and their approximations by trusses of finite number of joints. Struct Multidisc Optim 33:113–129

    Article  Google Scholar 

  10. Graczykowski C, Lewiński T (2010) Michell cantilevers constructed within a halfstrip. Tabulation of selected benchmark results. Struct Multidisc Optim (in press)

  11. Hemp WS (1973) Optimum structures. Clarendon, Oxford

    Google Scholar 

  12. Karmarkar N (1984) A new polynomial time algorithm for linear programming. Combinatorica 4:373–395

    MATH  Article  MathSciNet  Google Scholar 

  13. Lewiński T, Zhou M, Rozvany GIN (1994a) Extended exact solutions for least-weight truss layouts—part I: cantilever with a horizontal axis of symmetry. Int J Mech Sci 36:375–398

    MATH  Article  Google Scholar 

  14. Lewiński T, Zhou M, Rozvany GIN (1994b) Extended exact solutions for least-weight truss layouts—part II: unsymmetric cantilevers. Int J Mech Sci 36:399–419

    Article  Google Scholar 

  15. Mehrotra S (1992) On the implementation of a primal-dual interior point method. SIAM J Optim 2:575–601

    MATH  Article  MathSciNet  Google Scholar 

  16. Michell AGM (1904) The limits of economy of material in frame structures. Phil Mag 8:589–597

    Google Scholar 

  17. Nocedal J, Wright S (1999) Numerical optimization. Springer, New York

    MATH  Book  Google Scholar 

  18. Rozvany GIN (1996) Some shortcomings in Michell’s truss theory. Struct Optim 12:244–250

    Article  Google Scholar 

  19. Rozvany GIN, Bendsøe MP, Kirsch U (1995) Layout optimization of structures. Appl Mech Rev 48:41–119

    Article  Google Scholar 

  20. Sigmund O (2001) A 99 line topology optimization code written in Matlab. Struct Multidisc Optim 21:120–127

    Article  Google Scholar 

  21. Sokół T, Lewiński T (2009) Application of the interior point method to truss topology optimization. In: Proceeding of int. conf. on “Lightweight Structures in Civil Engineering” (XV LSCE 2009). Micro-Publisher-Consultant-Project, Warsaw, pp 162–168

    Google Scholar 

  22. Wolfram S (2003) The Mathematica book, 5th edn. Wolfram Media, Champaign

    Google Scholar 

  23. Wright S (1997) Primal-dual interior-point methods. SIAM, Philadelphia, PA

    MATH  Google Scholar 

Download references


The paper was prepared within the Research Grant no N506 071338, financed by the Polish Ministry of Science and Higher Education, entitled: Topology Optimization of Engineering Structures. Simultaneous shaping and local material properties determination.

Open Access

This article is distributed under the terms of the Creative Commons Attribution Noncommercial License which permits any noncommercial use, distribution, and reproduction in any medium, provided the original author(s) and source are credited.

Author information



Corresponding author

Correspondence to Tomasz Sokół.

Electronic supplementary material

Below is the link to the electronic supplementary material.

(PDF 151 KB)

Rights and permissions

Open Access This is an open access article distributed under the terms of the Creative Commons Attribution Noncommercial License (, which permits any noncommercial use, distribution, and reproduction in any medium, provided the original author(s) and source are credited.

Reprints and Permissions

About this article

Cite this article

Sokół, T. A 99 line code for discretized Michell truss optimization written in Mathematica. Struct Multidisc Optim 43, 181–190 (2011).

Download citation


  • Topology optimization of trusses
  • Ground structure
  • Linear programming
  • Interior point method
  • Sparse matrix representation