Pratt Truss Optimization Using
Genetic Algorithm
By :- Harish Kant Soni
Roll No:- 12CE31004
Use of Pratt truss
Fig :- Gatton Railway Bridge, Queensland, Australia
Image Source :- https://commons.wikimedia.org/wiki/File:Gatton_Railway_Bridge.JPG
Forces in Pratt truss
Image source :-http://www.slideshare.net/sheikhjunaidyawar/trusses-28955458
F
18 m
7 m
Loading
Train’s engine has highest weight as compared to other coaches
Indian locomotive class
WAP-5
• Length = 18.16 m
• Weight = 79251.7 kg
Source :- https://en.wikipedia.org/wiki/Indian_locomotive_class_WAP-5
18 m
7 m
18 m
7 m
Dead Load = 150 kN/ meter/ side
Total dead load = 150 x 18 = 2700 KN
Live load = 800 KN
550 KN
550 KN
550 KN 550 KN 550 KN
1
2 3 4 5 6 7
12 11 10 9 8
Objective Function:-
min. total Area = min
A(1)+A(2)+A(3)+A(4)+A(5)+A(6)+A(7)+A(8)
+A(9)+A(10)+A(11)+A(12)+A(13)+A(14)+A(15)+
+A(16)+A(17)+A(18)+A(19)+A(20)+A(21)+A(22)
Constraints :-
min. Area = 0.0010 m^2 = 10 cm^2
disp at any node < 50 mm
clc; clear all;
% initial cromosome having area in the range 0.002 to 0.02 m^2-
C = 2e-3*[1 2 4 10 3 9 10 7 1 5 1 1 2 4 10 3 9 10 7 1 5 2;
9 3 7 9 4 7 5 2 4 9 1 9 3 7 9 4 7 5 2 4 9 3;
7 3 4 1 1 7 3 2 4 9 8 7 3 4 1 1 7 3 2 4 9 4;
1 5 7 9 4 9 5 2 4 9 6 1 5 7 9 4 9 5 2 4 9 5;
4 10 6 2 2 2 3 2 4 1 9 4 10 6 2 2 2 3 2 4 1 6;
9 3 5 9 5 7 5 1 4 9 1 9 3 5 9 5 7 5 1 4 9 7;
9 9 4 1 4 3 1 2 4 9 8 9 9 4 1 4 3 1 2 4 9 8;
1 3 7 9 1 7 5 5 4 4 1 1 3 7 9 1 7 5 5 4 4 9;
9 8 3 1 2 4 2 2 4 9 6 9 8 3 1 2 4 2 2 4 9 10;
2 3 7 9 3 7 5 9 4 3 1 2 3 7 9 3 7 5 9 4 3 1;
8 7 2 10 4 5 3 10 4 7 4 8 7 2 10 4 5 3 10 4 7 2;
1 2 4 10 3 9 10 7 1 5 1 1 2 4 10 3 9 10 7 1 5 3;
9 3 7 9 4 7 5 2 4 9 1 9 3 7 9 4 7 5 2 4 9 4;
7 3 4 1 1 7 3 2 4 9 8 7 3 4 1 1 7 3 2 4 9 5;
1 5 7 9 4 9 5 2 4 9 6 1 5 7 9 4 9 5 2 4 9 6;
4 10 6 2 2 2 3 2 4 1 9 4 10 6 2 2 2 3 2 4 1 7;
9 3 5 9 5 7 5 1 4 9 1 9 3 5 9 5 7 5 1 4 9 8;
9 9 4 1 4 3 1 2 4 9 8 9 9 4 1 4 3 1 2 4 9 9;
1 3 7 9 1 7 5 5 4 4 1 1 3 7 9 1 7 5 5 4 4 10;
9 8 3 1 2 4 2 2 4 9 6 9 8 3 1 2 4 2 2 4 9 1;
2 3 7 9 3 7 5 9 4 3 1 2 3 7 9 3 7 5 9 4 3 2;
2 3 7 9 3 7 5 9 4 3 1 2 3 7 9 3 7 5 9 4 3 3];
F_obj= sum(C,2); % return sum of rows in a column matrix of 22 X 1
%% selection
Fitness = zeros(22,1);
for a = 1:22
Fitness(a) = (1/(1+F_obj(a)));
end
S = sum(Fitness);
Prob_of_cromosome = Fitness/S;
roullet = zeros(22,1);
roullet(1) = Prob_of_cromosome(1);
for a = 2:22;
roullet(a) = roullet(a-1) + Prob_of_cromosome(a); %CDF
end
%% new set of cromosome
for a = 1 : 22
r = rand;
if (r <= roullet(1))
new_cromosome_id = 1;
else
for b = 1 : 21
if (r > roullet(b) & r <= roullet(b+1))
new_cromosome_id = b+1;
end
end
end
C(a,:) = C (new_cromosome_id,:);
end
%% Cross Over
C_new = C;
for a= 1:22
r_crossover = rand();
if(r_crossover < 0.7)
r_location = 10*round(rand(),1); % generates random number between 0 to 10. It
selects location for crossover
for b = r_location+1 : 22
if (a==22)
C_new(a,b)= C(1,b);
C_new(1,b) = C(22,b);
else
C_new(a,b)= C(a+1,b);
C_new(a+1,b) = C(a,b);
end
end
end
end
%% Mutation Probability 0.1
for a=1:22
for b=1:22
if(rand < 0.1)
C_new(a,b)= round(((0.02-0.001)*rand+0.001),3);
end
end
end
%% Truss code
coordinate=[0 0 ;3 0 ;6 0;9 0; 12 0; 15 0; 18 0;15 7; 12 7; 9 7; 6 7; 3 7;];
connectivity=[1 2;2 3;3 4;4 5;5 6; 6 7; 7 8;8 9; 9 10;10 11; 11 12;1
12; 2 12;3 12;3 11; 4 11;4 9; 4 10; 5 9; 5 8;6 8; 7 8];
boundary=[1 1 ; 0 0 ; 0 0 ;0 0 ;0 0;0 0; 1 1;0 0; 0 0;0 0;0 0;0 0];
load=[0 0 0 -550e3 0 -550e3 0 -550e3 0 -550e3 0 -550e3 0 0 0 0 0 0
0 0 0 0 0 0];
Elasticity=2.E+11*[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1];
%% Penalty
abs_unknown_displacement = abs(unknown_displacement);
count = 0;
for k = 1 : 22
for l = 1:20
if(abs_unknown_displacement(k,l)-0.050 > 0)
count = count + 1;
end
C_new(k,:)= (1+0.05*count)*C_new(k,:);
end
end
Results
Results
member 1 2 3 4 5 6 7 8 9 10 11
0.019 0.004 0.016 0.015 0.019 0.008 0.005 0.008 0.012 0.014 0.019
0.019 0.015 0.016 0.003 0.009 0.015 0.005 0.008 0.003 0.014 0.003
0.019 0.015 0.016 0.017 0.009 0.008 0.005 0.006 0.01 0.008 0.019
0.019 0.015 0.016 0.003 0.005 0.014 0.005 0.011 0.003 0.014 0.003
0.019 0.004 0.016 0.015 0.019 0.019 0.005 0.006 0.01 0.008 0.015
0.019 0.015 0.016 0.003 0.005 0.016 0.013 0.008 0.003 0.014 0.003
0.019 0.011 0.016 0.003 0.005 0.016 0.009 0.008 0.003 0.014 0.003
0.019 0.004 0.016 0.003 0.005 0.016 0.013 0.017 0.003 0.003 0.003
0.019 0.015 0.016 0.015 0.019 0.008 0.005 0.008 0.012 0.014 0.003
0.019 0.004 0.016 0.019 0.011 0.008 0.005 0.006 0.01 0.008 0.005
0.008 0.015 0.016 0.015 0.019 0.008 0.005 0.008 0.016 0.014 0.003
0.019 0.015 0.016 0.009 0.005 0.016 0.013 0.008 0.003 0.014 0.003
0.006 0.004 0.016 0.015 0.019 0.008 0.005 0.008 0.012 0.014 0.016
0.019 0.015 0.016 0.003 0.005 0.016 0.013 0.008 0.003 0.014 0.016
0.019 0.015 0.016 0.007 0.019 0.014 0.019 0.008 0.019 0.014 0.003
0.019 0.002 0.016 0.015 0.005 0.016 0.013 0.008 0.003 0.014 0.003
0.019 0.004 0.016 0.015 0.019 0.014 0.005 0.008 0.019 0.014 0.003
0.019 0.015 0.016 0.003 0.005 0.015 0.005 0.008 0.003 0.016 0.003
0.019 0.015 0.006 0.003 0.009 0.016 0.013 0.008 0.003 0.014 0.003
0.019 0.015 0.009 0.017 0.009 0.002 0.009 0.009 0.01 0.015 0.016
0.019 0.015 0.016 0.014 0.005 0.016 0.013 0.008 0.003 0.014 0.003
0.019 0.015 0.016 0.003 0.005 0.016 0.013 0.008 0.003 0.014 0.003
value 0.019 0.015 0.016 0.003 0.005 0.015 0.005 0.008 0.003 0.014 0.003
times 20 14 20 9 6 14 10 16 12 17 15
12 13 14 15 16 17 18 19 20 21 22
0.008 0.014 0.016 0.007 0.002 0.018 0.016 0.014 0.01 0.006 0.002
0.008 0.014 0.012 0.007 0.002 0.011 0.016 0.008 0.017 0.006 0.002
0.004 0.014 0.012 0.016 0.002 0.013 0.017 0.003 0.016 0.012 0.006
0.008 0.014 0.012 0.008 0.002 0.018 0.016 0.014 0.01 0.006 0.008
0.008 0.014 0.012 0.007 0.002 0.018 0.016 0.014 0.01 0.006 0.002
0.008 0.014 0.012 0.007 0.002 0.012 0.016 0.014 0.02 0.006 0.002
0.008 0.014 0.019 0.007 0.002 0.018 0.016 0.014 0.01 0.019 0.002
0.008 0.014 0.012 0.007 0.002 0.018 0.016 0.014 0.01 0.006 0.002
0.008 0.014 0.016 0.007 0.002 0.018 0.016 0.014 0.017 0.006 0.002
0.004 0.014 0.012 0.016 0.002 0.012 0.017 0.003 0.016 0.012 0.006
0.008 0.014 0.002 0.007 0.002 0.018 0.016 0.014 0.01 0.006 0.002
0.008 0.02 0.016 0.001 0.002 0.018 0.016 0.014 0.01 0.006 0.002
0.008 0.019 0.017 0.007 0.002 0.018 0.019 0.014 0.01 0.006 0.002
0.008 0.014 0.012 0.007 0.002 0.018 0.016 0.014 0.01 0.006 0.002
0.008 0.001 0.012 0.007 0.002 0.018 0.011 0.014 0.01 0.006 0.002
0.008 0.014 0.012 0.007 0.002 0.018 0.016 0.014 0.01 0.006 0.002
0.008 0.014 0.012 0.007 0.004 0.018 0.016 0.014 0.01 0.006 0.002
0.008 0.014 0.012 0.007 0.002 0.018 0.016 0.008 0.013 0.006 0.002
0.008 0.014 0.012 0.007 0.002 0.018 0.016 0.014 0.01 0.006 0.002
0.008 0.015 0.012 0.016 0.002 0.002 0.017 0.017 0.007 0.012 0.002
0.008 0.014 0.012 0.007 0.014 0.018 0.016 0.014 0.01 0.006 0.002
0.008 0.014 0.012 0.006 0.002 0.004 0.016 0.014 0.01 0.006 0.002
0.008 0.014 0.012 0.007 0.002 0.018 0.016 0.014 0.01 0.006 0.002
20 19 17 18 21 16 20 16 15 18 19

More Related Content

DOCX
Air brakes in BOXNHL wagon
PPTX
Later chalukyas, hoysalas ppt
PPTX
New Delhi History of Architecture
PPTX
Pondicherry presentation
PDF
Indo aryan mode
PPTX
Elements of hindu temple
PPTX
Chalukyan architecture
PDF
Lhb coach documentation
Air brakes in BOXNHL wagon
Later chalukyas, hoysalas ppt
New Delhi History of Architecture
Pondicherry presentation
Indo aryan mode
Elements of hindu temple
Chalukyan architecture
Lhb coach documentation

What's hot (20)

PPTX
Khajuraho temple
PPTX
Mysore City :: Traffic and Transportation
PPTX
Bhopal transport
PPTX
DHARAVI SLUM, MUMBAI
PPS
National building codes 2005 history overview
PPTX
Rahul Mehrotra
PPT
PPTX
Plumbing system
DOC
F.A.R., Ground Coverage and Height Permissible as per Bye Laws
PPTX
Sustainable technology and design in auroville
PPTX
Parking bye law
PPT
Fink truss (w type)
PPTX
Howrah bridge ppt
PDF
Voshan_VisualCV
PPTX
metro station planning ar.ravi sankar alumni(auce architecture)
PPTX
GEOMETRICAL DESIGN PHILOSOPHY OF ANCIENT INDIAN TEMPLE AND ITS CONSTRUCTION M...
PDF
Temple architecture dravidian
PDF
SLUM ANALYSIS
PPTX
HOTEL CASESTUDY - HYATT REGENCY, PUNE
PPTX
B.tech i eg u1 scale
Khajuraho temple
Mysore City :: Traffic and Transportation
Bhopal transport
DHARAVI SLUM, MUMBAI
National building codes 2005 history overview
Rahul Mehrotra
Plumbing system
F.A.R., Ground Coverage and Height Permissible as per Bye Laws
Sustainable technology and design in auroville
Parking bye law
Fink truss (w type)
Howrah bridge ppt
Voshan_VisualCV
metro station planning ar.ravi sankar alumni(auce architecture)
GEOMETRICAL DESIGN PHILOSOPHY OF ANCIENT INDIAN TEMPLE AND ITS CONSTRUCTION M...
Temple architecture dravidian
SLUM ANALYSIS
HOTEL CASESTUDY - HYATT REGENCY, PUNE
B.tech i eg u1 scale
Ad

Viewers also liked (20)

DOCX
Building Structure Project 1 Report
PDF
project report on truss bridge
DOCX
Application of the trusses
PDF
1932 a distortion & noise meter
PDF
Numerical modeling of concrete in Abaqus
PPTX
Integral calculus
PPTX
Human gait simulation using python
PPTX
Shobe trusses
PDF
Building structure project 1 report
PPTX
STUDY ON VARIATION OF JOINT FORCES IN STIFFENING TRUSS OF CABLE-STAYED BRIDGE
PPT
Analysis of Truss
PDF
Truss Bridge Report
PPTX
Trusses and its applications
PDF
Chapter 3
PDF
Steel Roof Truss
DOC
Roof trusses
PPT
Trusses
PPTX
Steel roof trusses
DOC
Types roof trusses
PPTX
PPT OF TRUSSES
Building Structure Project 1 Report
project report on truss bridge
Application of the trusses
1932 a distortion & noise meter
Numerical modeling of concrete in Abaqus
Integral calculus
Human gait simulation using python
Shobe trusses
Building structure project 1 report
STUDY ON VARIATION OF JOINT FORCES IN STIFFENING TRUSS OF CABLE-STAYED BRIDGE
Analysis of Truss
Truss Bridge Report
Trusses and its applications
Chapter 3
Steel Roof Truss
Roof trusses
Trusses
Steel roof trusses
Types roof trusses
PPT OF TRUSSES
Ad

Similar to Pratt truss optimization using (20)

PDF
Analysis update for GENEVA meeting 2011
 
PDF
Evolutionary Algorithms and their Applications in Civil Engineering - 1
XLS
Naca 4 digit-delta
PDF
Thesis-presentation: Tuenti Engineering
PPT
Factorial design
PPT
Unit ii-2-tp
PDF
PDF
Problema 6.2 método newton raphson
PDF
Tablas estadísticas
DOCX
USEFUL FORMULAS Measures of risk Expected returns .docx
PDF
Como se utiliza la tabla t de student (formulas)
PDF
Como se utiliza la tabla t de student (formulas)
PDF
Final Year Presentation in EWU
DOCX
Tabla para determinar los valores de yn y k
DOCX
Rajnifile
PDF
Como se utiliza la tabla t de student
PPTX
Bat algorithm explained. slides ppt pptx
PDF
PDF
P3 training and_life_as_a_postdoc_(felix_klein)
PDF
درجة كل طالب في الإختبار
Analysis update for GENEVA meeting 2011
 
Evolutionary Algorithms and their Applications in Civil Engineering - 1
Naca 4 digit-delta
Thesis-presentation: Tuenti Engineering
Factorial design
Unit ii-2-tp
Problema 6.2 método newton raphson
Tablas estadísticas
USEFUL FORMULAS Measures of risk Expected returns .docx
Como se utiliza la tabla t de student (formulas)
Como se utiliza la tabla t de student (formulas)
Final Year Presentation in EWU
Tabla para determinar los valores de yn y k
Rajnifile
Como se utiliza la tabla t de student
Bat algorithm explained. slides ppt pptx
P3 training and_life_as_a_postdoc_(felix_klein)
درجة كل طالب في الإختبار

Recently uploaded (20)

PDF
Water Industry Process Automation & Control Monthly - September 2025
PPTX
240409 Data Center Training Programs by Uptime Institute (Drafting).pptx
PPTX
Cloud Security and Privacy-Module-2a.pptx
PDF
Project_Mgmt_Institute_- Marc Marc Marc.pdf
PDF
August 2025 Top Read Articles in - Bioscience & Engineering Recent Research T...
PDF
Water Supply and Sanitary Engineering Textbook
PDF
1.-fincantieri-investor-presentation2.pdf
PDF
ForSee by Languify Teardown final product management
PDF
M01-Manage Safety and Environmental Protection 1.pdf
PDF
PhD defense presentation in field of Computer Science
PPTX
Soumya Das post quantum crypot algorithm
PPTX
Retail.pptx internet of things mtech 2 nd sem
PDF
Computer Networks and Internet Protocol Week-1
PDF
Application of smart robotics in the supply chain
PPT
Module_1_Lecture_1_Introduction_To_Automation_In_Production_Systems2023.ppt
PPTX
22ME926Introduction to Business Intelligence and Analytics, Advanced Integrat...
PDF
ITEC 1010 - Information and Organizations Database System and Big data
PPTX
1. Effective HSEW Induction Training - EMCO 2024, O&M.pptx
PDF
Design and Implementation of Low-Cost Electric Vehicles (EVs) Supercharger: A...
PDF
02. INDUSTRIAL REVOLUTION & Cultural, Technical and territorial transformatio...
Water Industry Process Automation & Control Monthly - September 2025
240409 Data Center Training Programs by Uptime Institute (Drafting).pptx
Cloud Security and Privacy-Module-2a.pptx
Project_Mgmt_Institute_- Marc Marc Marc.pdf
August 2025 Top Read Articles in - Bioscience & Engineering Recent Research T...
Water Supply and Sanitary Engineering Textbook
1.-fincantieri-investor-presentation2.pdf
ForSee by Languify Teardown final product management
M01-Manage Safety and Environmental Protection 1.pdf
PhD defense presentation in field of Computer Science
Soumya Das post quantum crypot algorithm
Retail.pptx internet of things mtech 2 nd sem
Computer Networks and Internet Protocol Week-1
Application of smart robotics in the supply chain
Module_1_Lecture_1_Introduction_To_Automation_In_Production_Systems2023.ppt
22ME926Introduction to Business Intelligence and Analytics, Advanced Integrat...
ITEC 1010 - Information and Organizations Database System and Big data
1. Effective HSEW Induction Training - EMCO 2024, O&M.pptx
Design and Implementation of Low-Cost Electric Vehicles (EVs) Supercharger: A...
02. INDUSTRIAL REVOLUTION & Cultural, Technical and territorial transformatio...

Pratt truss optimization using

  • 1. Pratt Truss Optimization Using Genetic Algorithm By :- Harish Kant Soni Roll No:- 12CE31004
  • 2. Use of Pratt truss Fig :- Gatton Railway Bridge, Queensland, Australia Image Source :- https://commons.wikimedia.org/wiki/File:Gatton_Railway_Bridge.JPG
  • 3. Forces in Pratt truss Image source :-http://www.slideshare.net/sheikhjunaidyawar/trusses-28955458 F
  • 5. Loading Train’s engine has highest weight as compared to other coaches Indian locomotive class WAP-5 • Length = 18.16 m • Weight = 79251.7 kg Source :- https://en.wikipedia.org/wiki/Indian_locomotive_class_WAP-5
  • 7. 18 m 7 m Dead Load = 150 kN/ meter/ side Total dead load = 150 x 18 = 2700 KN Live load = 800 KN 550 KN 550 KN 550 KN 550 KN 550 KN 1 2 3 4 5 6 7 12 11 10 9 8
  • 8. Objective Function:- min. total Area = min A(1)+A(2)+A(3)+A(4)+A(5)+A(6)+A(7)+A(8) +A(9)+A(10)+A(11)+A(12)+A(13)+A(14)+A(15)+ +A(16)+A(17)+A(18)+A(19)+A(20)+A(21)+A(22) Constraints :- min. Area = 0.0010 m^2 = 10 cm^2 disp at any node < 50 mm
  • 9. clc; clear all; % initial cromosome having area in the range 0.002 to 0.02 m^2- C = 2e-3*[1 2 4 10 3 9 10 7 1 5 1 1 2 4 10 3 9 10 7 1 5 2; 9 3 7 9 4 7 5 2 4 9 1 9 3 7 9 4 7 5 2 4 9 3; 7 3 4 1 1 7 3 2 4 9 8 7 3 4 1 1 7 3 2 4 9 4; 1 5 7 9 4 9 5 2 4 9 6 1 5 7 9 4 9 5 2 4 9 5; 4 10 6 2 2 2 3 2 4 1 9 4 10 6 2 2 2 3 2 4 1 6; 9 3 5 9 5 7 5 1 4 9 1 9 3 5 9 5 7 5 1 4 9 7; 9 9 4 1 4 3 1 2 4 9 8 9 9 4 1 4 3 1 2 4 9 8; 1 3 7 9 1 7 5 5 4 4 1 1 3 7 9 1 7 5 5 4 4 9; 9 8 3 1 2 4 2 2 4 9 6 9 8 3 1 2 4 2 2 4 9 10; 2 3 7 9 3 7 5 9 4 3 1 2 3 7 9 3 7 5 9 4 3 1; 8 7 2 10 4 5 3 10 4 7 4 8 7 2 10 4 5 3 10 4 7 2; 1 2 4 10 3 9 10 7 1 5 1 1 2 4 10 3 9 10 7 1 5 3; 9 3 7 9 4 7 5 2 4 9 1 9 3 7 9 4 7 5 2 4 9 4; 7 3 4 1 1 7 3 2 4 9 8 7 3 4 1 1 7 3 2 4 9 5; 1 5 7 9 4 9 5 2 4 9 6 1 5 7 9 4 9 5 2 4 9 6; 4 10 6 2 2 2 3 2 4 1 9 4 10 6 2 2 2 3 2 4 1 7; 9 3 5 9 5 7 5 1 4 9 1 9 3 5 9 5 7 5 1 4 9 8; 9 9 4 1 4 3 1 2 4 9 8 9 9 4 1 4 3 1 2 4 9 9; 1 3 7 9 1 7 5 5 4 4 1 1 3 7 9 1 7 5 5 4 4 10; 9 8 3 1 2 4 2 2 4 9 6 9 8 3 1 2 4 2 2 4 9 1; 2 3 7 9 3 7 5 9 4 3 1 2 3 7 9 3 7 5 9 4 3 2; 2 3 7 9 3 7 5 9 4 3 1 2 3 7 9 3 7 5 9 4 3 3];
  • 10. F_obj= sum(C,2); % return sum of rows in a column matrix of 22 X 1 %% selection Fitness = zeros(22,1); for a = 1:22 Fitness(a) = (1/(1+F_obj(a))); end S = sum(Fitness); Prob_of_cromosome = Fitness/S; roullet = zeros(22,1); roullet(1) = Prob_of_cromosome(1); for a = 2:22; roullet(a) = roullet(a-1) + Prob_of_cromosome(a); %CDF end
  • 11. %% new set of cromosome for a = 1 : 22 r = rand; if (r <= roullet(1)) new_cromosome_id = 1; else for b = 1 : 21 if (r > roullet(b) & r <= roullet(b+1)) new_cromosome_id = b+1; end end end C(a,:) = C (new_cromosome_id,:); end
  • 12. %% Cross Over C_new = C; for a= 1:22 r_crossover = rand(); if(r_crossover < 0.7) r_location = 10*round(rand(),1); % generates random number between 0 to 10. It selects location for crossover for b = r_location+1 : 22 if (a==22) C_new(a,b)= C(1,b); C_new(1,b) = C(22,b); else C_new(a,b)= C(a+1,b); C_new(a+1,b) = C(a,b); end end end end
  • 13. %% Mutation Probability 0.1 for a=1:22 for b=1:22 if(rand < 0.1) C_new(a,b)= round(((0.02-0.001)*rand+0.001),3); end end end
  • 14. %% Truss code coordinate=[0 0 ;3 0 ;6 0;9 0; 12 0; 15 0; 18 0;15 7; 12 7; 9 7; 6 7; 3 7;]; connectivity=[1 2;2 3;3 4;4 5;5 6; 6 7; 7 8;8 9; 9 10;10 11; 11 12;1 12; 2 12;3 12;3 11; 4 11;4 9; 4 10; 5 9; 5 8;6 8; 7 8]; boundary=[1 1 ; 0 0 ; 0 0 ;0 0 ;0 0;0 0; 1 1;0 0; 0 0;0 0;0 0;0 0]; load=[0 0 0 -550e3 0 -550e3 0 -550e3 0 -550e3 0 -550e3 0 0 0 0 0 0 0 0 0 0 0 0]; Elasticity=2.E+11*[1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1];
  • 15. %% Penalty abs_unknown_displacement = abs(unknown_displacement); count = 0; for k = 1 : 22 for l = 1:20 if(abs_unknown_displacement(k,l)-0.050 > 0) count = count + 1; end C_new(k,:)= (1+0.05*count)*C_new(k,:); end end
  • 18. member 1 2 3 4 5 6 7 8 9 10 11 0.019 0.004 0.016 0.015 0.019 0.008 0.005 0.008 0.012 0.014 0.019 0.019 0.015 0.016 0.003 0.009 0.015 0.005 0.008 0.003 0.014 0.003 0.019 0.015 0.016 0.017 0.009 0.008 0.005 0.006 0.01 0.008 0.019 0.019 0.015 0.016 0.003 0.005 0.014 0.005 0.011 0.003 0.014 0.003 0.019 0.004 0.016 0.015 0.019 0.019 0.005 0.006 0.01 0.008 0.015 0.019 0.015 0.016 0.003 0.005 0.016 0.013 0.008 0.003 0.014 0.003 0.019 0.011 0.016 0.003 0.005 0.016 0.009 0.008 0.003 0.014 0.003 0.019 0.004 0.016 0.003 0.005 0.016 0.013 0.017 0.003 0.003 0.003 0.019 0.015 0.016 0.015 0.019 0.008 0.005 0.008 0.012 0.014 0.003 0.019 0.004 0.016 0.019 0.011 0.008 0.005 0.006 0.01 0.008 0.005 0.008 0.015 0.016 0.015 0.019 0.008 0.005 0.008 0.016 0.014 0.003 0.019 0.015 0.016 0.009 0.005 0.016 0.013 0.008 0.003 0.014 0.003 0.006 0.004 0.016 0.015 0.019 0.008 0.005 0.008 0.012 0.014 0.016 0.019 0.015 0.016 0.003 0.005 0.016 0.013 0.008 0.003 0.014 0.016 0.019 0.015 0.016 0.007 0.019 0.014 0.019 0.008 0.019 0.014 0.003 0.019 0.002 0.016 0.015 0.005 0.016 0.013 0.008 0.003 0.014 0.003 0.019 0.004 0.016 0.015 0.019 0.014 0.005 0.008 0.019 0.014 0.003 0.019 0.015 0.016 0.003 0.005 0.015 0.005 0.008 0.003 0.016 0.003 0.019 0.015 0.006 0.003 0.009 0.016 0.013 0.008 0.003 0.014 0.003 0.019 0.015 0.009 0.017 0.009 0.002 0.009 0.009 0.01 0.015 0.016 0.019 0.015 0.016 0.014 0.005 0.016 0.013 0.008 0.003 0.014 0.003 0.019 0.015 0.016 0.003 0.005 0.016 0.013 0.008 0.003 0.014 0.003 value 0.019 0.015 0.016 0.003 0.005 0.015 0.005 0.008 0.003 0.014 0.003 times 20 14 20 9 6 14 10 16 12 17 15
  • 19. 12 13 14 15 16 17 18 19 20 21 22 0.008 0.014 0.016 0.007 0.002 0.018 0.016 0.014 0.01 0.006 0.002 0.008 0.014 0.012 0.007 0.002 0.011 0.016 0.008 0.017 0.006 0.002 0.004 0.014 0.012 0.016 0.002 0.013 0.017 0.003 0.016 0.012 0.006 0.008 0.014 0.012 0.008 0.002 0.018 0.016 0.014 0.01 0.006 0.008 0.008 0.014 0.012 0.007 0.002 0.018 0.016 0.014 0.01 0.006 0.002 0.008 0.014 0.012 0.007 0.002 0.012 0.016 0.014 0.02 0.006 0.002 0.008 0.014 0.019 0.007 0.002 0.018 0.016 0.014 0.01 0.019 0.002 0.008 0.014 0.012 0.007 0.002 0.018 0.016 0.014 0.01 0.006 0.002 0.008 0.014 0.016 0.007 0.002 0.018 0.016 0.014 0.017 0.006 0.002 0.004 0.014 0.012 0.016 0.002 0.012 0.017 0.003 0.016 0.012 0.006 0.008 0.014 0.002 0.007 0.002 0.018 0.016 0.014 0.01 0.006 0.002 0.008 0.02 0.016 0.001 0.002 0.018 0.016 0.014 0.01 0.006 0.002 0.008 0.019 0.017 0.007 0.002 0.018 0.019 0.014 0.01 0.006 0.002 0.008 0.014 0.012 0.007 0.002 0.018 0.016 0.014 0.01 0.006 0.002 0.008 0.001 0.012 0.007 0.002 0.018 0.011 0.014 0.01 0.006 0.002 0.008 0.014 0.012 0.007 0.002 0.018 0.016 0.014 0.01 0.006 0.002 0.008 0.014 0.012 0.007 0.004 0.018 0.016 0.014 0.01 0.006 0.002 0.008 0.014 0.012 0.007 0.002 0.018 0.016 0.008 0.013 0.006 0.002 0.008 0.014 0.012 0.007 0.002 0.018 0.016 0.014 0.01 0.006 0.002 0.008 0.015 0.012 0.016 0.002 0.002 0.017 0.017 0.007 0.012 0.002 0.008 0.014 0.012 0.007 0.014 0.018 0.016 0.014 0.01 0.006 0.002 0.008 0.014 0.012 0.006 0.002 0.004 0.016 0.014 0.01 0.006 0.002 0.008 0.014 0.012 0.007 0.002 0.018 0.016 0.014 0.01 0.006 0.002 20 19 17 18 21 16 20 16 15 18 19