Code covered by the BSD License  

Highlights from
London Kings Cross Western Concourse Genetic Algorithm

image thumbnail

London Kings Cross Western Concourse Genetic Algorithm

by

 

13 Mar 2013 (Updated )

A simple genetic algorithm is applied to a model of the London Kings Cross Western Concourse.

D=MSAdata(x,y,z,nodNo,memSel,radSel,dim_prop_rhs,dim_prop_chs,mass,popSize,segNo)
function D=MSAdata(x,y,z,nodNo,memSel,radSel,dim_prop_rhs,dim_prop_chs,mass,popSize,segNo)
for popNo=1:popSize
    n=nodNo(popNo,1);
    m=2*n-3;
    Coord=[x{popNo,1}' y{popNo,1}' z{popNo,1}'];
    Con=zeros(4,2*n-3)';
    for k = 2:n
        Con(k-1,:) = [k-1 k 0 0];
    end
    for k = 2:(n+1)/2
        Con(n-2+k,:) = [2*k-3 2*k-1 1 1];
    end
    for k = 2:(n-1)/2
        Con((3*n+2*k-5)/2,:) = [2*k-2 2*k 1 1];
    end
    
    %BOUNDARY CONDITIONS
    Re=zeros(n,6);
    for node=[1, 2, n-1, n]
        Re(node,:)=[1 1 1 1 1 1];
    end
    %SELF WEIGHT & SNOW LOAD
    Load=zeros(n,6);
    snowX=[x{popNo,1}(1);x{popNo,1}(2);x{popNo,1}(n-1);x{popNo,1}(n)];
    snowY=[y{popNo,1}(1);y{popNo,1}(2);y{popNo,1}(n-1);y{popNo,1}(n)];
    snowArea=polyarea(snowX,snowY);
    snowLoad=250*snowArea*10;
    for node=3:n-2
        selfweightLoad=-(mass(popNo,1)*10)/(segNo(popNo,1)*(n-4));
        snowNodeLoad=-(snowLoad/(n-4));
        Load(node,3)=selfweightLoad+snowNodeLoad;
    end
    %     snowPer=zeros(m,1);
    %     for k=1:m
    %         snowMem(1,:)=Coord(Con(k,1),:);
    %         snowMem(2,:)=Coord(Con(k,2),:);
    %         snowPer(k,1)=sqrt(sum((snowMem(2,:)-snowMem(1,:)).^2));
    %     end
    %     snowTotPer=sum(snowPer);
    w=zeros(m,3);
    %w(:,3)=-snowLoad/snowTotPer;
    %SECTION PROPERTIES
    E=210e9*ones(1,m);
    G=80e9*ones(1,m);
    for nel=1:n-1
        A(:,nel)=dim_prop_chs(memSel(popNo,1),4);
        Iy(:,nel)=dim_prop_chs(memSel(popNo,1),6);
        Iz(:,nel)=dim_prop_chs(memSel(popNo,1),6);
        J(:,nel)=dim_prop_chs(memSel(popNo,1),11);
    end
    for nel=n:m
        A(:,nel)=dim_prop_rhs(radSel(popNo,1),5);
        Iy(:,nel)=dim_prop_rhs(radSel(popNo,1),8);
        Iz(:,nel)=dim_prop_rhs(radSel(popNo,1),9);
        J(:,nel)=dim_prop_rhs(radSel(popNo,1),17);
    end
    St=zeros(n,6);
    be=zeros(1,m);
    D{popNo,1}=struct('m',m,'n',n,'Coord',Coord','Con',Con','Re',Re','Load',Load','w',w','E',E','G',G','A',A','Iz',Iz','Iy',Iy','J',J','St',St','be',be');
end

Contact us