Code covered by the BSD License  

Highlights from
Truss Design Optimization Based on Generative Algorithms

image thumbnail
from Truss Design Optimization Based on Generative Algorithms by James Allison
Supplementary material for a WCSMO publication regarding truss design optimization.

D=TrussData(Coord, Con)
%Author: Ashish Khetan (khetan2@illinois.edu)
%Engineering System Design Lab,
%Industrial and Enterprise Systems Engineering, UIUC, IL, USA

% Copyright (c) 2013, Engineering System Design Lab (ESDL)
% All rights reserved.
% 
% Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
% 
% Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
% Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
% Neither the name of the ESDL nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
%AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 
%(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 
%STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

function D=TrussData(Coord, Con) %Function to form structure corresponding to the given topology generated by the cellular division methodology

Re = zeros(size(Coord));  % Saves information whether the node is fixed or not corresponding to the standard ten bar truss
for i = 1:size(Coord,1)
    if((Coord(i,1)==0 && Coord(i,2)==0)||(Coord(i,1)==0 && Coord(i,2)==360))
        Re(i,:) =1;
    end
end
Load=zeros(size(Coord)); % Saves information of load at each node
% Load is applied at the nodes corresponding to the configuration of the
% standard ten bar truss
for i = 1:size(Coord,1)
    if((Coord(i,1)==720 && Coord(i,2)==0)||(Coord(i,1)==360 && Coord(i,2)==0))
        Load(i,:) =[0 -1e5];
    end
end
E=ones(1,size(Con,1))*1e7; % Saves information of Elasticity of the member connecting two nodes
Length = zeros(1,size(Con,1)); % Saves information corresponding to length of each bar member
D=struct('Coord',Coord','Con',Con','Re',Re','Load',Load','E',E','Length',Length);
for i=1:size(D.Con,2) % To calculate length of each bar member
   H=D.Con(:,i);C=D.Coord(:,H(2))-D.Coord(:,H(1));D.Length(i)=norm(C);
end
end

Contact us