LayOpt: an educational web-app for truss layout optimization

A new interactive truss layout optimization web-app has been developed for educational use. This has been designed to be used on a range of devices, from mobile phones to desktop PCs. Truss designs are first generated via numerical layout optimization and then rationalized via geometry optimization. It is then shown that these designs can be simplified using a computationally inexpensive process that allows the user to control the trade-off between complexity and structural volume. The process involves the use of smooth Heaviside representations of member existence variables, with nodal slack forces employed that allow unstable intermediate truss structures. Full details of the web-app are provided in this contribution, from underlying formulation to cloud computing implementation. A range of numerical examples are used to demonstrate the efficacy of the web-app, and to show how it can potentially be used in educational and practical engineering settings.


Introduction
Interactive educational tools have been invaluable in raising awareness of the power of continuum topology optimization methods, from the TopOpt web-app launched in 2000 (Tcherniak and Sigmund 2001) to apps designed to run on mobile phones or tablets (Aage 2013;Nguyen et al. 2020).These tools are able to demonstrate to interested users the power of topology optimization, by allowing them to solve simple, generally two-dimensional, userdefined design problems.These tools, together with short educational scripts written in MATLAB and other high level languages (e.g.Sigmund 2001;Andreassen et al. 2011;Wei et al. 2018), have contributed to the development of a vibrant research and user community in the field.
Whereas those active in the continuum topology optimization field have benefited from the availability of interactive educational tools for the last two decades, there have to date been no similar interactive educational tools Responsible Editor: Emilio Carlos Nelli Silva Linwei He linwei.he@sheffield.ac.uk 1 Department of Civil and Structural Engineering, University of Sheffield, Mappin Street, Sheffield, S1 3JD, UK 2 LimitState Ltd, Sheffield, UK for truss layout optimization (also known as 'truss topology optimization'), though a number of short educational scripts have been made available (e.g.Sokół 2011;Zegard and Paulino 2014;He et al. 2019b).Also, a truss optimization method employing a 'growth' heuristic has been made available as a downloadable software program for PCs (Martinez et al. 2007).Truss layout optimization methods can identify structurally efficient arrangements of discrete structural elements forming a structure, and are particularly well suited for problems where the proportion of the available design domain occupied by structure is small, as is common for design problems encountered by structural engineers working in the construction industry.
However, until recently truss layout optimization methods have not found favour in industry.This is partly because the solutions obtained using basic numerical layout optimization methods will generally appear impractical to engineers working in practice, comprising numerous closely spaced elements that would be difficult to fabricate using traditional methods.Nevertheless, details of projects where optimal layouts have been used to guide and inspire designers working in practice have recently been outlined by Graczykowski and Lewiński (2020) and Zegard et al. (2020).
New digital fabrication techniques are now expanding the range of structures that can be fabricated and the current climate emergency is making increased material efficiency a far higher priority.Also, means of rationalizing the raw solutions obtained via truss layout optimization have been developed in recent years (He and Gilbert 2015).Nevertheless, solutions will still often appear over-complex to practitioners and in the present contribution a new computationally efficient means of allowing the user to manage the trade-off between complexity and volume is presented.
To demonstrate the efficacy of truss layout optimization when used in conjunction with the aforementioned postprocessing methods, these are here incorporated in a new interactive truss layout optimization web-app, LayOpt, publicly accessible via https://www.layopt.com.The webapp is designed to allow users to interactively solve a wide range of two-dimensional truss layout optimization problems, on a range of devices.
Specifically, the use of web-technologies and complementary serverless cloud computing techniques mean that computations can be carried out in the cloud, ensuring scalability (thousands of simultaneous connections are possible), and obviating the need for a powerful client, thereby allowing a wide range of devices to be used to access the web-app, including desktop computers, tablets and mobile phones, as shown in Fig. 1.The use of industry standard protocols means that the web-app will work on almost all web browsers released since 2011, and many released earlier than that too.
The paper is organized as follows: Section 2 presents details of the underlying numerical methods, including the new simplification process; Section 3 presents details of the cloud computing-based software architecture used by the web-app; Section 4 presents a wide range of example problems that demonstrate the range of applicability of the web-app; finally conclusions are drawn in Section 5.

Truss layout optimization
Truss layout optimization (after Dorn et al. 1964) provides a method of identifying minimum volume structures for a given design domain and set of loads and boundary conditions, e.g.see the example problem shown in Fig. 2a.This contains only a single point load, but any number of loads can be handled, applied either simultaneously or in separate load-cases.
Here, a rigid-plastic material model is assumed.Many common engineering materials exhibit a plastic response as failure is approached, and, by utilizing this behaviour, greater material savings can be realized.The use of a plastic formulation also obviates the need to include elastic compatibility constraints in the formulation.For single load-case problems a statically determinate layout can be found that will also be optimal when an elastic material is involved.However, for multiple load-case problems the optimal elastic and plastic solutions will diverge, with the volumes computed using the formulation described herein representing lower bounds on the corresponding elastic solutions.
In the truss layout optimization procedure, the design domain is first discretized using a series of nodes that are then connected by potential truss members to form a 'ground structure'.For a fully general solution, each node should be connected to every other node; however, this becomes computationally challenging when large numbers of nodes are involved.To address this an adaptive 'member adding' strategy can be used (Gilbert and Tyas 2003;Pritchard et al. 2005;He et al. 2019b), which is guaranteed to obtain the same solution as would be obtained had all members been connected from the outset.
The iterative member adding strategy begins with a reduced ground structure, such as the one shown in Fig. 2b.Then at each iteration the following optimization problem (after He et al. 2019b) is assembled and solved, based on the current ground structure: where V is the total volume of members, l = [l 1 , l 2 , ..., l m ] T is a vector of element lengths.a = [a 1 , a 2 , ..., a m ] T is the vector of variables representing cross section areas of each element, B is a matrix of direction cosines, q (k) is a vector of variables representing the axial force in each element in load-case k, and T is the vector of externally applied forces.σ + and σ − are the permitted stresses in tension and compression respectively.Once the problem is solved, solutions for both the primal (1) and dual problems (see He et al. 2019b for details) are extracted.The element forces and areas obtained from the primal problem provide an interim solution, the minimum volume structure possible using the current ground structure, which can be presented to the user to indicate progress.The solution of the dual problem furnishes the virtual displacements of each node.These can be used to calculate virtual strain values for each potential member, regardless of whether or not this is present in the current ground structure.If the virtual strain of a potential member would violate the dual constraint value, then that potential member is considered as a candidate for admission to the ground structure in the next iteration.Figure 2c shows the current ground structure at the final iteration (in grey), as well as the identified optimal structure (where tensile members are shown in red and compressive members in blue; this convention is used throughout this paper).
Figure 3 shows the layout optimization process, which ends with a filtering and validation stage.

Filtering and validation
Problem (1) generally has optimal solutions where the majority of the variables a and q are zero, i.e. most elements in the ground structure are not required in the final optimal structure.However, the numerical methods used to solve this optimization problem usually provide solutions where  these variables are close to, but not exactly, zero.Thus, in order to use the solutions obtained in the subsequent geometry optimization stage, a filtering and validation step is required.
Unlike the filter algorithm proposed, e.g., by Ramos and Paulino (2016), where elements are removed during the optimization process, thus potentially influencing the form of the optimal solution, here filtering is only utilized after the optimal solution has been found.The resulting filtered solution is obtained by removing elements with an area below a certain filter value (e.g., the grey lines in Fig. 2d show the members that remain after filtering).Then a validation problem is set up and solved to check that the filtered solution is capable of supporting the required loads.If the validation fails, then the process is repeated using a different (lower) filter value.It is convenient to set this filter value relative to a max , the largest area in the solution; an initial filter value of 0.01a max is chosen by default.On subsequent attempts this reduces by an order of magnitude each time, to 0.001a max , then 0.0001a max etc.Thus, relatively simple filtered structures are first tested, and only if these are found to be structurally unviable are structures with fewer filtered members tested.
The validation of the filtered problems involves solving an optimization problem that is similar to problem (1): minimize a,q (k) where, f T are the maximum absolute values of the slack forces across all load-cases, Ṽ is the penalized structural volume, obtained using the sum of slack forces fs , and μ s is a large multiplier value, taken as 20V 0 , where V 0 is the volume after layout optimization.In a successful validation, the objective value from (2) will be very close to the objective value from (1), and the slack forces will not be used.However, if key elements have been removed by the filter, then the slack forces may be the only way constraint (2b) can be satisfied, leading to a substantial increase in the objective function.Alternatively, other load paths may be able to transmit the load previously carried by the removed key elements, but these will by definition generally be sub-optimal, and therefore will also lead to an increase in the objective value.A small tolerance of 1% increase in volume is permitted in this stage.Due to this validation requirement, the filtered structures may still contain some thin, but structurally important, members; Fig. 5a shows an example of such a structure.

Geometry optimization
Layout optimization can be used to identify the globally minimum volume structure comprising joints that lie on the original nodal grid.However, lower volume solutions can usually be obtained if the joints are allowed to migrate to other positions.Thus, a geometry optimization step can be used to improve the layout optimization solution by adding joint positions as optimization variables (see He and Gilbert 2015).
The geometry optimization formulation is very similar to (2) except that the geometrical coefficients, such as element lengths and direction cosines, are now calculated in the optimization process from new nodal position variables.Thus, objective function (2a) can now be written as: ( 3 )  Note that the problem is no longer convex, and a globally optimum solution cannot be guaranteed.However, the use of a layout optimization solution as a starting point tends to ensure that high quality solutions can be obtained.
Once the nodes are permitted to move it is important to ensure that the extents of the design domain are respected.For a convex domain, this simply involves adding constraints to ensure that each node does not move outside the domain.However, when concave domains are involved this becomes more complex.Here, the approach described by He et al. (2019a) is used.
As the problem is now non-linear and non-convex, numerical instabilities may be encountered.To counter this, limits are placed on the distance moved by each node.This greatly improves stability, but also necessitates an iterative process so that nodes can gradually migrate towards their optimal location.This iterative process is stopped once the sum of the distances moved by all nodes is deemed sufficiently small.
The resulting structure will often contain elements that intersect, especially in the case of 2D problems.However, in practice any intersection point would usually be viewed as a joint, whose location therefore needs to be optimized.Thus, new nodes are created at intersection points, and the geometry optimization process is performed on the resulting new structure.The overall algorithm for this procedure is shown in Fig. 4.
A further complication is that nodes may migrate towards each other.Thus any nodes that become too close to each other are merged between iterations.
The overall effect of the geometry optimization process is to rationalize the structures obtained via layout optimization, often removing many thin members from the structure, e.g. as is evident in Fig. 5b.

Structural simplification via Heaviside projection
Even if the filtering and geometry optimization procedures detailed in the previous sections are applied, the solutions obtained will often still be quite complex in form.This can make them appear impractical to designers, hampering uptake.Here a simplification method is proposed that allows the total number of members in a given structure to be reduced, thereby reducing overall structural complexity (Fig. 6).In the interests of computational efficiency this is achieved by handling integer member 'existence' variables x via a smooth Heaviside projection H (x) (Guest et al. 2004).Here the selected projection function is: where, μ is a predefined projection factor that determines the accuracy of the approximation (see Fig. 7).Using this Heaviside projection, the 'existence' of a given member i can now be expressed by its cross-sectional area a i .Let a ref denote a reference member area such that the following is satisfied: (5) Since reducing complexity is likely to lead to higher volume structures, it is convenient to manage the trade- where the optimization objective is to minimize the total number of members Φ M .Also, constraint (6e) defines the acceptable trade-off in structural volume, where is a specified allowable volume increase ratio and V ref is a reference structural volume (taken as the volume prior to the start of the simplification step), and where a ref is here taken as a max .
Problem (6) is solved using various values of the projection factor μ, progressively increasing this from 2, 5, 10 up to 20.Initially a small value of μ is used, which provides rich gradient information that can be used to minimize the objective function in the optimization; larger values improve the speed of convergence.In each case the goal is to remove members with small cross-sectional areas.The process terminates if no member can be removed or if μ has reached 20 (where the Heaviside projection closely resembles the integer values).Since this is a heuristic process, there is no guarantee that the simplification process will always be successful, and the solutions obtained will generally be only locally optimal.On the other hand, useful solutions can often be obtained in practice, and the speed of the process renders it suitable for use in the interactive webapp described herein; a sample simplified design is shown in Fig. 5c.
The process described is effective at reducing the total number of members in a structure.However, since the volume of the resulting structures need only satisfy the volume increase limit (6e), there is no requirement or expectation that the volume will be a minimum, even among structures with the same layout.Therefore, it is useful to undertake a further geometry optimization step (Section 2.3) after the simplification, which should be preceded by a filtering and validation step (Section 2.2).This does, however, mean that the resulting optimized structure may often have a markedly lower volume than implied by the specified volume increase ratio.This is demonstrated in Figs. 8 and 9, which show how the specified allowable volume increase ratio influences the layout of the generated structures.
Note that although the problem shown in Fig. 8 is symmetrical, several of the simplified solutions are asymmetric.Previous research has demonstrated that the optimal solution may be asymmetric when various practical constraints are considered, such as when discrete bar areas are stipulated (Stolpe 2016), or when limits are placed on the number of joints (Fairclough and Gilbert 2020).Thus, although the simplification method used here does not guarantee that the solutions will be globally optimal, asymmetric solutions are to be expected.
If symmetrical solutions are desired, for aesthetic or other reasons, this may be enforced using additional constraints, as outlined in Fairclough and Gilbert (2020).However, this may then result in solutions with a larger volume and/or a higher level of complexity.

Software architecture
This section describes in more detail the main features of the web-app and how these have been implemented.Readers who are more interested in the results that can be obtained using the web-app can proceed directly to Section 4. The software comprises three main elements.Firstly, a series of client-side Javascript/HTML5 files which form the user interface, and allow the user to construct the desired problem.Secondly, a cloud-hosted server, which serves both the static user interface pages and dynamic pages containing solutions to the user-specified problems.Finally, the actual solving of the optimization problems occurs using a serverless compute platform.The interaction between these components is detailed in Fig. 10.

User interface
The user interface centres around a HTML5 canvas element (Fulton and Fulton 2013) which displays the problem setup and the solutions.The canvas is also the main input area, where the user can add and remove features from the problem.When the user interacts using a mouse input, a visual change in size assists the user in editing the desired point.When a touch input is detected, larger invisible touch targets are added to points and symbols for ease of selection.
The main canvas is accompanied by a ribbon bar containing various tools to allow the user to add elements (e.g.loads and supports) to the problem, as well as to move, rotate and delete problem elements.Implementation of the tools is simplified by use of the paper.jslibrary (Lehni and Puckey 2011) which provides tools to assist drawing on the canvas and interacting with it.
The menu bars are laid out using responsive design principles (Marcotte 2011) to allow use on any size of screen, with the layout automatically collapsing to multiple rows, or drop-down menus, at small screen sizes, as shown in Fig. 1.Thus, the web-app is usable on a range of platforms from desktop computers to smartphones, and should remain compatible with new devices and platforms as long as they support a standard web browser.
All user interface actions are handled entirely client-side to improve responsiveness and to provide a smoother user experience.This permits features such as the snapping of points to the nodal grid.

Cloud Server
To keep the user fully informed with progress towards a solution, and to provide increased educational value, the web-app displays solutions from intermediate iterations in the member adding (see Section 2.1) and geometry optimization (see Section 2.3) procedures.These are displayed in real time, as they are calculated, and can also be exported as an animation.Each problem that the user sends is handled with one AJAX (Asynchronous Javascript And XML) request-response pair (Brinzarea-Iamandi et al. 2009).This avoids the need to keep track of individual sessions on the server, as each problem request contains all the input data required to solve it.This is known as a RESTful, or stateless architecture (Richardson and Amundsen 2013).
To provide all intermediate solutions as they become available, the response is chunked.This is implemented on the server by using a PHP script (Brinzarea-Iamandi et al. 2009) to process messages from the serverless function, allowing flushing of the output buffers at appropriate points.This is the major hurdle in a fully serverless implementation.
The server interface also provides the ability to save and load solutions from the global database.The current problem is saved to the global database when 'Get sharable link' is clicked in the menu, and the generated ID for that problem is returned to the user.The ID of the problem is then added as a query string to the URL to produce a link that will allow anyone to access that problem.When the app is opened in this way, all functionality is maintained, so the new user can modify the opened problem.To save their modifications, they must generate a new sharable link, and cannot overwrite the existing saved file.This feature allows easy sharing of solutions on social media, with co-workers or in a classroom setting.

Serverless processing
To allow for maximum scalability, the main processing of the problems is implemented using serverless technology, namely the Lambda service offered by Amazon Web Services (AWS).This allows functions to be run without pre-provisioning the computational resources (Chapin and Roberts 2020).Whilst there is a small initial time overhead, this is comparatively small for all but the smallest truss optimization problems.Using this serverless approach, it is possible to avoid the substantial extra time that would be needed to dynamically provision additional computational resources to handle peaks in usage.
Note that there are limits on both source code size and duration of execution with most serverless platforms; however, these are generally sufficient for problems which would be solved in a while-you-wait scenario such as a webapp (at the time of writing, the execution time limit for the AWS Lambda service is 15 min).
This function has been programmed in the C++ language, using the Lambda runtime API.This allows the use of efficient third party solvers, namely MOSEK (MOSEK ApS 2019) for the solution of the linear layout optimization problem, and IPOPT (Wächter and Biegler 2006) for the non-linear geometry optimization and simplification problems.The use of C++ also allowed reuse of the codebase previously employed by He et al. (2019aHe et al. ( , 2021aHe et al. ( , 2021b)), and also means that future versions of LayOpt can potentially readily take advantage of additional enhancements in that codebase.Note that the user interfaces described in He et al. (2019a), He et al. (2021a), and He et al. (2021b) are more powerful and provide access to more advanced features (e.g.solution of 3D design problems and CAD geometry design domain import), but have a considerably steeper learning curve for users than the LayOpt web-app.Links to these more advanced software tools can be found on the 'About' page of the LayOpt web-app.

Simple examples
A number of simple example problems that illustrate key features of the LayOpt web-app are first considered.These also allow a range of structural insights to be drawn.

Variation of support conditions
The first example, shown in Fig. 11, demonstrates the influence of boundary conditions on the identified optimal structures.
It is evident that as the level of support restraint is increased, lower volumes can be achieved.It is also evident that significantly simpler structures can be obtained using the Heaviside projection method, and that these structures require relatively little more material than the corresponding unsimplified designs.
In terms of the specific structures obtained, the structure shown in Fig. 11b may not seem intuitive at first sight.However, it can perhaps be better understood by considering a beam with the same loading and support conditions.The bending moment diagram for such a beam would have sagging moments over the majority of its length, but with a hogging moment in the vicinity of the fixed support.This is reflected in the solution obtained by the presence of two separate structures in Fig. 11b; the left hand structure has a typical cantilever form, with members in tension along the top edge, i.e. resisting a hogging moment, whilst the right hand structure resembles the spanning structure in Fig. 11a, with compressive elements on the top edge, i.e resisting a sagging moment.These two structures meet at a single point, coinciding with the point of zero moment in the bending moment diagram.
A similar effect can be observed in Fig. 11c, where the principal tensile member is partially supported by compressive members emanating from the supports and by a wheel structure at midspan.Again, this approximately reflects the bending moment diagram of the corresponding beam.However, the depth of the beam here is such that these additional elements provide only a slight volume saving, and the Heaviside simplification produces a structure consisting of only two tensile members.

Variation of simplification tolerance
The second example involves a classical cantilever problem, shown in Fig. 12.The first row shows the solution after layout and geometry optimization, which resembles the solution given by Chan (1960).However, the presence of ribs of members that are incomplete introduces irregularity to the structure.These incomplete ribs offer only minimal advantage in terms of volume, and can therefore be removed by specifying a small permitted volume increase in the Heaviside simplification phase.In this example a 0.1% permitted volume increase removes all incomplete ribs from the solution.
When larger volume increases are permitted in the simplification stage, more significant changes to the solutions obtained are evident.The objective of the nonlinear optimization problem solved in the simplification stage is to reduce the number of members; however, the simplified solutions also demonstrate improvements in a number of other measures that would affect the real-world difficulty of fabricating a design, such as the number of joints and the presence of small inclined angles between adjacent members.
As previously noted, asymmetric solutions are often obtained, even when considering symmetrical or antisymmetrical problems, as seen in Fig. 12.When an asymmetric solution is obtained, it can be observed to frequently consist of parts of two neighbouring symmetrical solutions.For example in Fig. 12, the 2% permitted volume increase solution has characteristics of both the 1% and 3% solutions.Whilst this may not seem immediately intuitive, it means that a wider range of solutions can be identified.Additionally, the speed of the proposed simplification approach means that it is feasible to try a wide range of permitted volume increases in order to obtain the most visually satisfying result.

Fig. 12
Cantilever problem: influence of permitted volume increase on form of optimized structures generated using Heaviside simplification procedure (24 × 16 unit domain; unit applied load and limiting stresses)

Problems with non-convex design domains
Figure 13 shows variants of the problem presented in Fig. 12 though now with a hole placed in the centre of the design domain, rendering this non-convex.When the design domain is non-convex, it is necessary to remove elements from the ground structure if they protrude outside the domain.In the layout optimization stage this can be easily calculated a priori, whilst in the geometry optimization and simplification stages, additional constraints must be using the method described by He et al. (2019a).
Figure 13 shows solutions for a range of hole sizes.The first solutions shown for each problem have a small permitted volume increase (0.1-0.5%) during the simplification stage, chosen to eliminate incomplete ribs and to provide a clearer layout.The second solution for each problem includes a more significant level of simplification, corresponding to a permitted volume increase of 10-15%.Again the exact value for each problem has been chosen to produce visually satisfying results, for example by favouring symmetrical structures or minimizing the number of incomplete ribs.

Educational examples
In this section examples are presented that demonstrate a range of principles of optimal structures.These could provide suitable starting points for using the LayOpt webapp as a teaching aid on a taught module, with the concepts involved illustrated in an engaging and interactive way.

Statically determinate and indeterminate problems
In Michell's seminal 1904 paper on optimal structures (Michell 1904), the half-wheel structure problem shown in the first column of Fig. 14 is considered.Michell gives the volume of this structure as where F is the magnitude of the force (here taken as 1), a is the distance from a support to the load (here taken as 8), and σ T and σ C are the limiting tension and compression stresses respectively.Thus, for the first structure shown in Fig. 14b, the minimum volume would be 8π ≈ 25.13.The numerical techniques embedded in the LayOpt web-app provide upper bound solutions, which closely approximate the corresponding analytical solutions when high nodal resolutions are employed.An interesting exercise for students could include observing the volume as the 'grid refinement' slider is changed, and potentially extrapolating the results to infer the solution with infinitely many nodes, using the approach described by Darwich et al. ( 2010).The 1 σ C + 1 σ T multiplier in ( 7) is common to all of the solutions presented by Michell, and originates from his use Fig. 14 Midspan point load problem: influence of changing tensile and compressive stress limits on form of optimized structures for statically determinate and indeterminate problems (unit applied load) of Maxwell (1872)'s earlier theorem.It can be seen from the first column of Fig. 14 that this proportionality holds for the sub-optimal layout depicted.Furthermore, this implies that the layout of the optimal structure does not change with different stress ratios, since only member sizes are changed.This can also be observed in the first column of Fig. 14.
However, as outlined by Rozvany (1996), Michell and Maxwell's theories are only valid for support conditions which are statically determinate.For statically indeterminate problems, the criteria given by Hemp (1973) must be used instead.
The second column of Fig. 14 shows a variant of the problem where both supports are fixed pins, rendering the problem statically indeterminate.It is evident that the layout of the optimal solution now changes as the limiting stresses are changed.These different layouts also generate different reaction forces (the direction of the resultant reaction force will coincide with that of the single bar connected to each support).Finally, it is evident that there is no longer a simple relationship between the volumes of the different solutions.

Near-optimal structures
Figure 15 shows solutions for a simple cantilever problem for a range of limiting tensile and compressive stress values.This problem has been widely studied in the literature since it was first studied by Chan (1960).In contrast to the circular/radial members present in Fig. 14, the optimal cantilever layouts involve tensile and compressive members that follow more complex curved trajectories, but which remain (near-)orthogonal to each other.
As the numerical methods of the LayOpt app cannot obtain true truss-like continua, the tension and compression members can generally only be near-orthogonal.Similar discretised structures have been considered previously, for example by Prager (1978) and Mazurek et al. (2011), where regular meshes comprising triangular and quadrilateral cells have been constructed.Similar regular meshes can often be identified using the LayOpt app, especially if a small level of simplification is used to remove incomplete and branching ribs, as has been done in Fig. 15 (see also Fig. 12).
In such a structure, quadrilateral cells are always cyclic (i.e.opposite angles sum to 180 • ).LayOpt's image export feature allows solutions to be exported to a graphics software package so this could potentially be checked as part of an exercise.When the limiting stresses in tension and compression are equal, two of the angles (the top and bottom in Fig. 15) in each cell are exactly equal to 90 • , whatever the discretization level.This can be more easily seen in the structures with fewer members, e.g.see the 3% simplification solution shown in Fig. 12.When the allowable stresses are unequal, one of these angles will approach a right angle from above, and the other from Fig. 15 Cantilever problem: influence of changing tensile and compressive stress limits on form of optimized structures (16 × 16 unit domain; supports 6 units apart; unit applied load; 0.1% volume increase permitted during simplification) below.Of the remaining two angles, the one in the direction where the coordinate curves diverge (i.e. the right side in Figs. 15 and 12) approaches 90 • from below, whilst the remaining angle approaches a right angle from above.LayOpt provides a useful interface for students to explore variants of the problems presented in Fig. 15, helping them to gain an intuitive understanding of the different behaviours possible.
As the problem in Fig. 15 is statically indeterminate, the layout changes with different stress limits.However, the (near-)orthogonality of tension and compression members is still maintained.The differences in layout may perhaps be most clearly seen in the triangle formed by the edge of the domain between the two supports, and the innermost elements of the two fan regions.Deriving the angles of this triangle may prove a useful exercise for students, following a Mohr's circle based approach similar to that presented by Rozvany and Gollub (1990).It is found that the angle at top support (for the truss-like continuum solution) becomes α = arctan σ C σ T , with the angle at the bottom support being α − 90 • .The numerical results available from the LayOpt app will approach these values (from above) as the resolution is increased.

Multiple loads and multiple load-cases
The simply supported spanning structure problems shown in Fig. 16 can be used to illustrate fundamental differences between single and multiple load-case problems.In an educational setting students can be asked to consider how they expect the loads applied to influence the optimal structural forms.
Initially the two loads can be considered entirely separately, with Fig. 16b and c showing the resulting optimal solutions.
If both loads will always be applied at the same time, then these can be considered together as part of a single loadcase.This gives the optimal structure shown in Fig. 16a.Note that the volume of the structure shown in Fig. 16a is less than the sum of the volumes of the structures shown in Fig. 16b and c, indicating the benefits that can be accrued by considering the two loads together.However, it can be observed that if the structure shown in Fig. 16a were to be loaded with only one of the loads (or indeed with any unequal combination of these), then it would collapse as it is in a state of unstable equilibrium.
Conversely, suppose that the two loads shown in Fig. 16b and Fig. 16c can only be applied separately.In this case, they can be applied as part of two separate load-cases, giving rise to the optimal structure shown in Fig. 16d.This structure again has a significantly smaller volume than would be obtained by combining the structures shown in Fig. 16b and c.
The form of the structure shown in Fig. 16d may be better understood by considering the superposition principle described by Nagtegaal and Prager (1973).For a problem involving a material with equal limiting tension and compression stress, and supporting external force vectors f (1) and f (2) in load-cases 1 and 2 respectively, the solution may be found by superimposing the optimized structures obtained by solving two single loadcase problems.However, these single load-case prob-Fig.16 Two loads (a) optimized when both loads applied in a single load-case, (b) and (c) optimized structures to resist only one of the loads, (d) optimized structure when loads are applied in separate load-cases, (e) and (f) optimized structures for component load-cases of (d), using superposition principle (24 × 4 unit domain; unit loads applied at span/3 from supports; unit limiting stresses; nodal grid spacing = 2 3 units) lems are not simply the two load-cases of the original problem; instead they have external force vectors given by: These are referred to as component load-cases, or 'sum' and 'difference' load-cases respectively.Figure 16e and f show the component load-cases and their solutions for the two load-case problems considered earlier.Note that these combine, both in form and volume, to give the structure shown in Fig. 16d.The signs of the forces in the members in Fig. 16f are different in each of the two load-cases; thus, these members appear in grey in Fig. 16d.Note that the form of the structure shown in Fig. 16d is also capable of handling any convex combination of the two loads.This can be easily seen from the component loadcase solutions, by combining the forces of Fig. 16e with the forces of Fig. 16f multiplied by an appropriate factor between −1 and 1.
Finally, Fig. 17 shows the result of performing Heaviside simplification on the structure shown in Fig. 16d, using a 20% permitted volume increase.The structure obtained in this case resembles a Warren truss, a commonly adopted design in structural engineering practice.This suggests that the Warren truss provides a reasonably economical design for a spanning problem of this sort.Note that in general the superposition principle cannot be used during the simplification stage and the full multiple load-case problem must instead be solved.

Structural engineering examples
Finally, examples are presented that show how the LayOpt web-app can be applied to problems of the sort tackled by structural engineers.Although the problems considered here are highly simplified, they suggest that the web-app could be useful when seeking structurally efficient layouts at the initial conceptual design stage.Alternatively, more complex problems can be tackled when the same underlying technology is embedded in parametric CAD software (He et al. 2021a, b).

Portal structure
Figure 18 shows a portal structure designed to enclose a large open space, e.g. for a warehouse or sports centre.The problem involves three load-cases, the first involving only vertical gravity loading (represented here by a midspan vertical load), the second also involving wind type loading (represented here by the addition of a left to right horizontal point load), and the third with the direction of the horizontal load reversed.
The structure obtained following layout and geometry optimization, Fig. 18b, is clearly quite complex.However, Fig. 18c shows that the Heaviside simplification method can be used to provide a much simpler alternative, with a volume only 7.9% higher in this case.

Multi-storey building
The example shown in Fig. 19 shows a simplified representation of a multi-storey building structure.Initially, the design domain is restricted to a rectangular region, with forces applied in three load-cases, to points lying on the outer envelope of the building as shown in Fig. 19a.As with the portal frame example, the first load-case involves only vertical gravity loading (represented here by vertical loads applied at each storey), the second also involves wind type loading (represented here by the addition of left to right horizontal point loads applied at each storey), and the third load-case is the same but with the directions of the horizontal loads reversed.
Figure 19b shows the outcome of performing layout optimization (only) -a standard cross braced design.However, when geometry optimization is also undertaken, the structure shown in Fig. 19c is obtained.This closely resembles the alternative optimized bracing form identified in previous studies (e.g.Stromberg et al. 2012).
If the design domain is expanded then a slightly lower volume structure involving the use of outrigger members lying outside the envelope of the main building can be obtained (Fig. 19d,e); in this case the load locations and magnitudes have not been changed and the solution shown is after both layout and geometry optimization steps have been performed.

Bridge structure
Figure 20 shows an example of a simplified bridge type problem.The problem is statically indeterminate and therefore, as previously discussed, the optimal form will vary based on the specified limiting stress in tension and compression.Solutions for a range of limiting stress values are shown in Fig. 20b-f.These solutions display similarities with the results obtained by Pichugin et al. (2015), though in that work a problem involving an infinite number of spans was considered.It is evident that when the limiting compressive stress is larger than the limiting tensile stress, arch type solutions are produced.Conversely, when the limiting tensile stress is much higher, cable stayed forms are produced.
Even a small permitted volume increase at the simplification stage can make the optimized structures obtained clearer.For example in the case of the structures shown in Fig. 20e and f, regions of isotropic strain (so-called Maxwell regions or type S regions) are evident.In these regions, every possible all-tensile set of members is equally optimal, and thus the unsimplified solutions typically comprise multiple, redundant sets of members.However, specifying even an infinitesimal volume increase in the simplification stage allows redundant paths to be eliminated.

Conclusions
A new interactive truss layout optimization web-app has been developed for educational use.The web-app first uses layout and geometry optimization methods in sequence to rapidly find optimized truss layouts.However, since the resulting structures can be rather complex in form, a means of reducing their complexity has also been developed.This simplification step involves the use of smooth Heaviside representations of member existence variables, with the user able to manage the trade-off between complexity and structural volume.
In designing the web-app priority has been given to speed and ease of use.Thus no plugins need to be downloaded or installed to use the web-app and the web based interface developed is compatible with a wide range of computing devices (e.g.phones, tablets and desktop PCs).Also, to ensure scaleability and responsiveness, advantage has been taken of modern serverless cloud computing resources.
Finally, the utility of the web-app has been demonstrated via application to a wide range of educational and more practical example problems.

Appendix. Web links for example problems
Table 1 provides web links corresponding to the problems presented in this paper.For cases where several similar problems are presented in one figure, only a single link is given; the related problems may be obtained by altering the parameters as specified in the relevant figure.The links by default show the saved optimal layout; pausing and re-starting solving allows the solution process to be viewed.holder.To view a copy of this licence, visit http://creativecommons. org/licenses/by/4.0/.

Fig. 1 Fig. 2
Fig. 1 LayOpt web-app user interface as viewed on (a) a desktop computer; (b) a tablet; and (c) a mobile phone

Fig. 7
Fig. 7 Form of Heaviside function (5) employed by the simplification procedure minimize

Fig. 8
Fig.8Simple two load-case problem: problem definition and initial unsimplified solution (left and right hand point loads active only in load-cases 1 and 2 respectively; here and henceforth grey lines represent members that are required to carry both tensile and compressive forces, dependant upon load-case)

Fig. 9
Fig. 9Simple two load-case problem: effect of varying the allowable volume increase limit.Shaded regions indicate when the same solution is obtained across a range of allowable volume increase values

Fig.
Fig. Midspan point load problem: influence of varying support conditions (a), (b) and (c) on form of optimized structures (20 × 5 unit design domain; nodal grid spacing = 0.5; unit applied load and limiting stresses)

Fig. 13
Fig.13Cantilever problem: influence of hole size on form of optimized structures (unit applied load and limiting stresses; unit nodal grid spacing with dimensions of design domain shown in first column)

Fig. 17
Fig. 17 Two loads problem: simplified form of structure shown in Fig. 16d, which resembles a Warren truss (20% permitted volume increase)

Fig. 18
Fig. 18 Portal structure: (a) problem definition, showing design domain and force locations (nodal grid spacing = 0.5 units), (b) optimized structure generated via layout and geometry optimization, (c) simplified structure obtained with a 20% permitted volume increase (three load-cases: vert.only, vert.+ left horiz., vert.+ right horiz.; all loads have unit magnitude; grey lines represent members carrying both tensile and compressive forces in different load-cases.)