end - Springer Static Content Server

advertisement
Reliability Assessment of 3-D Space Frame Structures
Applying Stochastic Finite Element Analysis
Finite Element for 3-D Beam Elements List:
clear
%%%%% DO NOT CHANGE THIS PART
%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%
IKM=2;
% No. of nodes per element.
NODOF=6;
% No. of Degree of freedom per Node.
IDOF = IKM*NODOF;
format short e
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%
NXE = 3; % No of elements.
N = 12; % Total no of degree of freedom excluding B.Cs ones.
NN = 3; % No of nodes in the mesh
NR = 2; % No of restrained B.C.
NODE(:,1) = [0; 5; 5; 5]; % X-coord of each node.
NODE(:,2) = [5; 5; 5; 0]; % Y-coord of each node.
NODE(:,3) = [5; 5; 0; 0]; % Z-coord of each node.
EL_table = [ 1 1 2 ;
2 23;
3 3 4 ] ; % EL_table = [ Element No., First Node No., Second Node No.]
for i = 1:NXE
STOREC(i,1:6) = [ NODE(EL_table(i,2),:) NODE(EL_table(i,3),:)];
end
EA = [4e6; 4e6; 4e6]; % Modulus of elasticity * Cross scetion Area.
EIY = [1e6; 1e6; 1e6]; % Modulus of elasticity * Inertia-Y.
EIZ = [0.3e6; 0.3e6; 0.3e6]; % Modulus of elasticity * Inertia-Z.
GJ = [0.3e6; 0.3e6; 0.3e6]; % Modulus of rigidity * polar moment of inertia.
Alphe =[ 0; 0; 0];
% Alpha (rotation of each element @ element local x-axis)
KV2(1:N,1:N) = 0 ;
NF(1:NN,1:NODOF) = 1;
G(1:IKM*NODOF) = 0;
% Define Node B.C.
NF(1,:) =[0,0,0,0,0,0];
NF(4,:) =[0,0,0,0,0,0];
%Define Loads
NL = 1 ; % no of loaded degree of freedom
LOADS(1:N) = 0;
LOADS(2) = -100;
Main Program Body
% INPUT SECTION C
clear
input3d;
% NODE FREEDOM DATA
NF = READNF(NN,NODOF,NR,NF) ;
% GLOBAL STIFFNESS MATRIX ASSEMBLY
for IP=1:NXE
KM = BMCOL3(EA,EIY,EIZ,GJ,Alphe,IP,STOREC);
G = GSTRNG(EL_table,IP,NODOF,NF) ;
STOREG(IP,:) = G;
[KV2] = FORMKV(KV2,KM,IKM,G,N,NR,IDOF);
end
KV2
Disp2 = inv(KV2)*LOADS';
Disp2
%RETRIEVE ELEMENT END FORCES AND MOMENTS
for IP=1:NXE
[KM] = BMCOL3(EA,EIY,EIZ,GJ,Alphe,IP,STOREC);
for i=1:IDOF
if (STOREG(IP,i)==0)
Edisp(i)=0;
else
Edisp(i) = Disp2(STOREG(IP,i));
end
end
Efor = KM*Edisp';
Eforce(IP,1:IDOF) = Efor';
end
Eforce
function [G1] =GSTRNG(EL_table,IP,NODOF,NF)
Node(1) = IP;
Node(2) = IP + 1;
L1=0;
for i1=1:2
for j1= 1:NODOF
L1 = L1+1
EL_table(L1) = NF(Node(i1),j1)
end
end
Subroutine to Calculate Element Stiffness Matrix
function [KMF] = BMCOL3(EA1,EIY1,EIZ1,GJ1,Alphe1,IP,COORD)
%THIS SUBROUTINE FORMS THE STIFFNESS MATRIX OF AN INCLINED 2-D BEAM-COLUMN ELEMENT
EA = EA1(IP); EIY = EIY1(IP); EIZ = EIZ1(IP); GJ = GJ1(IP); alph = Alphe1(IP)*(pi/180);
X1=COORD(IP,1); Y1=COORD(IP,2); Z1 = COORD(IP,3);
X2=COORD(IP,4); Y2=COORD(IP,5); Z2 = COORD(IP,6);
ELL=sqrt( (Y2-Y1)^2 + (X2-X1)^2 + (Z2-Z1)^2 )
CX = (X2-X1)/ELL; CY = (Y2-Y1)/ELL; CZ = (Z2-Z1)/ELL;
CXZ = sqrt( CX^2 + CZ^2 );
KM(1:12,1:12) = 0;
KM(1,1) = EA/ELL; KM(1,7) = -EA/ELL;
KM(2,2) = 12*EIZ/(ELL^3); KM(2,6) = 6*EIZ/(ELL^2); KM(2,8) = -12*EIZ/(ELL^3); KM(2,12) =
6*EIZ/(ELL^2);
KM(3,3) = 12*EIY/(ELL^3); KM(3,5) = -6*EIY/(ELL^2); KM(3,9) = -12*EIY/(ELL^3); KM(3,11) = 6*EIY/(ELL^2);
KM(4,4) = GJ/ELL; KM(4,10) = -GJ/ELL;
KM(5,3) = KM(3,5); KM(5,5) = 4*EIY/(ELL); KM(5,9) = 6*EIY/(ELL^2); KM(5,11) = 2*EIY/(ELL);
KM(6,2) = KM(2,6); KM(6,6) = 4*EIZ/(ELL); KM(6,8) = -6*EIZ/(ELL^2); KM(6,12) = 2*EIZ/(ELL);
KM(7,1) = KM(1,7); KM(7,7) = EA/ELL;
KM(8,2) = KM(2,8); KM(8,6) = KM(6,8); KM(8,8) = 12*EIZ/(ELL^3); KM(8,12) = -6*EIZ/(ELL^2);
KM(9,3) = KM(3,9); KM(9,5) = KM(5,9); KM(9,9) = 12*EIY/(ELL^3); KM(9,11) = 6*EIY/(ELL^2);
KM(10,4) = KM(4,10); KM(10,10) = GJ/ELL;
KM(11,3) = KM(3,11); KM(11,5) = KM(5,11); KM(11,9) = KM(9,11); KM(11,11) = 4*EIY/(ELL);
KM(12,2) = KM(2,12); KM(12,6) = KM(6,12); KM(12,8) = KM(8,12); KM(12,12) = 4*EIZ/(ELL);
if CXZ==0
Alph = [ 0
CY
0;
-CY*cos(alph) 0 sin(alph);
CY*sin(alph) 0 cos(alph) ];
else
Alph = [ CX
CY
(-CX*CY*cos(alph)-CZ*sin(alph))/CXZ
CY*CZ*cos(alph)+CX*sin(alph))/CXZ;
(CX*CY*sin(alph)-CZ*cos(alph))/CXZ
];
CXZ*cos(alph)
-CXZ*sin(alph)
CZ;
((CY*CZ*sin(alph)+CX*cos(alph))/CXZ
end
GAMM (1:12,1:12) = 0;
GAMM(1:3,1:3) = Alph;
GAMM(4:6,4:6) = Alph;
GAMM(7:9,7:9) = Alph;
GAMM(10:12,10:12) = Alph;
KM1 = GAMM'*KM;
KMF = KM1*GAMM;
Subroutine to Calculate Global Stiffness Matrix
function [BK2] = FORMKV(BK2,KM,IKM,G,N,NR,IDOF)
% C C THIS SUBROUTINE FORMS THE GLOBAL STIFFNESS MATRIX C STORING THE UPPER TRIANGLE AS A
VECTOR BK(N*(IW+l))
for I =1:IDOF
if (G(I) == 0) ,continue ,end
for J =1:IDOF
if (G(J) == 0) ,continue ,end
BK2(G(I),G(J)) = BK2(G(I),G(J)) + KM(I,J);
end
end
Subroutine to extract ANSYS file to MATLAB
echo off
%
ext56uxuyuz.m
extraction of ux, uy and uz dof's only
%
10-13-00
clear all;
%
bring up a window with the file names of defined extension to choose from
filename=uigetfile('*.lis','Select ELEMENT Input file from list - ELIST')
fid = fopen(filename,'rt'); %% Open in read mode as text.
if fid == -1
error('Error opening the file')
end
ic=1;
while 1
nextline = fgetl(fid);
%
read a line
%
end of the file
if nextline == -1, break, end
if ext56chk(nextline, ' ELEM') & ext56chk(nextline, 'MAT')
emp = 0;
while 1
nextline = fgetl(fid);
c = sscanf(nextline,' %f');
if isempty(c),
emp = emp+1;
if emp > 1, break, end;
continue;
end
array(ic,:) = c';
ic = ic + 1;
end
end
end
fclose(fid);
filename=uigetfile('*.lis','Select NODES Input file from list - NLIST')
fid = fopen(filename,'rt'); %% Open in read mode as text.
if fid == -1
error('Error opening the file')
end
ic = 1;
while 1
nextline = fgetl(fid);
read a line
if nextline == -1, break, end;
end of the file
if ext56chk(nextline, ' X') & ext56chk(nextline, ' Y')
emp=0;
while 1
nextline = fgetl(fid);
c2 = sscanf(nextline,' %f');
%
if isempty(c2),
emp = emp+1;
if emp > 0, break, end;
continue;
end
%
array2(ic,:) = c2';
ic = ic + 1;
end
end
end
fclose(fid);
NE = size(array(:,1));
filename=uigetfile('*.lis','Select TEMP Input file from list - BFLIST')
fid = fopen(filename,'rt'); %% Open in read mode as text.
TEMP = [];
if fid == -1
error('Error opening the file')
end
ipe=1;
while 1
nextline = fgetl(fid);
%
read a line
if ~isstr(nextline), break, end;
end of the file
%
if ext56chk(nextline, ' ELEMENT=') & ext56chk(nextline, ' TEMPERATURES')
disp(nextline);
EL(ipe) = sscanf(nextline, ' ELEMENT=
%f ');
nextline = fgetl(fid);
c3 = sscanf(nextline,' %f');
TEMP(ipe,:) = [EL(ipe) c3(1,1)];
ipe = ipe+1;
%if ip > NE, break,end;
end
end
fclose(fid);
filename=uigetfile('*.lis','Select NODES FORCES Input file from list - FLIST')
fid = fopen(filename,'rt'); %% Open in read mode as text.
FORC_E = [];
if fid == -1
error('Error opening the file')
end
while 1
nextline = fgetl(fid);
%
read a line
if ~isstr(nextline), break, end
end of the file
if ext56chk(nextline, ' NODE') & ext56chk(nextline, ' IMAG')
%
ic2=1;
while 1
nextline = fgetl(fid);
fc = sscanf(nextline,'
%i %s %f')
if isempty(fc), break, end;
FORC_E(ic2,1:6) = [fc(1) fc(2) fc(3) fc(4) fc(5) fc(6)];
ic2 = ic2 + 1;
end
end
end
fclose(fid);
Subroutine to Input Parameters (mean and covariance)
%%% Verify with ANSYS file 'beam4.db' with no Temp. - 'beam3.db' with Temp
%%%%%%%%%%%%%%%%%%%%
extract;
%pack;
format short e
%%%%%%% DO NOT CHANGE THIS PART
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%5
IKM =2; % No. of nodes in each Element
NODOF=6; % No. of Degree of Freedom at each node.
IDOF= IKM*NODOF; % No. of Degree of Freedom for each element.
% X - Axis = is Horizontal and from left to right.
% Y - Axis = is Vertical and from down to up.
% Theta_Z = is counter clockwise.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%
%%%%%%% Define FE Mesh %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
a11 = size(array(:,1)); NXE = a11(1); % No of elements.
a22 = size(array2(:,1)); NN = a22(1); % No of nodes in the mesh
NF(1:NN,1:NODOF) = -1;
G(1:IKM*NODOF) = 0;
%%%%%%%%%%%%%%%%%% Enter Node (x1,y1) Location & Element Node Numbering
NODE(:,1:4) = array2(:,1:4); % [ Node No., X, Y, Z] location of each node.
%%%%%% EL_table = [Element No., First Node No., Second Node No., Real_Constants No,
Material_Constants No. ]
EL_table(:,1) = array(:,1); EL_table(:,2:3) = array(:,7:8); EL_table(:,4) = array(:,4); EL_table(:,5) =
array(:,2);
%%%%%%%%%%%%%%%%%%%%% Define Real constants of the cross section properties of the 2-D
BEAMS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %% You can define any No. of Real_Constants Sets according to your problem
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Enter Dist. Type of each variable %%%%%%%%%%%%%%%%%%%%%%
% 0 = Normal.
% 1 = Lognormal.
% 2 = Type-I.
% Real_Constants[Set No.] = [Ty_mean,Ty_COV, Tz_mean,Tz_COV, Dist_ty, Dist_tz, Alphe]
NREAL = 6; % No. of real constants sets
Real_Constants(1,1:7) = [ 25 0.05 15 0.05 1 1 0];
Real_Constants(2,1:7) = [ 20 0.05 12 0.05 1 1 0];
Real_Constants(3,1:7) = [ 15 0.05 10 0.05 1 1 0];
Real_Constants(4,1:7) = [ 12 0.05 6 0.05 1 1 0];
Real_Constants(5,1:7) = [ 11 0.05 5 0.05 1 1 0];
Real_Constants(6,1:7) = [ 10 0.05 5 0.05 1 1 0];
% You can define any No. of Real_Constants Sets
%%%%%%%%%%%%%%%% Define Sets of Material Properties
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%
% Material_Properties[Set. no.] = [E_mean, E_COV, Fy_mean, Fy_COV, Density_mean, Density_cov,
Thermal-exp_mean, Thermal-exp_cov, Dist_E, Dist_Fy,
%
Dist_density, Dist_thermal_exp]
NM = 1; % No of Material Properties Sets.
Material_Properties(1,1:12) = [ 72e6 0.06 150e3 0.11 2.63e-6 0 23e-6 0 1 1 1 1];
T_ref = 20;
%Material_Properties(1,1:9) = [ 29e3 0.06 39.6 0.11 0 0 0 0 0];
%Material_Properties(2,1:9) = [ 39e3 0 30 0 0 0 0 0 0];
%%%%%%%%%%% DO NOT CHANGE THIS PART %%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%
for i = 1:NXE
STOREC(i,1:NODOF) = [ NODE(EL_table(i,2),2:4) NODE(EL_table(i,3),2:4)];
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Define Node B.C. , 0 = fixed , 1 = free
NF(78,:) =[0,0,0,0,0,0];
NF(79,:) =[0,0,0,0,0,0];
NF(80,:) =[0,0,0,0,0,0];
NF(81,:) =[0,0,0,0,0,0];
NR = 4; % No of restrained B.C.
N = (NN - NR)*6; % Total no of degree of freedom excluding B.Cs ones.
%%%%%%% Define Loads Sets
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%
% Loads_Set[Set No.] = [Key, Value_mean, Value_COV, Distribution Type, Dir-X, Dir_Y, Dir_Z, Node No.(if
%concentrated load) OR No. of Element(NE)
% (Thermal Load), Element No. OR Element No.1 (Thermal Load) , Angle between Load and the Beam OR
%Element No.2 (thermal load), Element No. 3, .... % ......., Elemnt no. NE ];
%[Dir-X, Dir-Y, Dir-Z] = for distributed load, define the plane of working load, i.e. x-y plane = [ 1 1 0]; i.e.
%x-z plane = [0 1 1]; x-y-z are
%the element coord. system
%[Dir-X, Dir-Y, Dir-Z] = for concentrated load are the Global Coord. system
% Key = 0 - Concentrated Load.
% Key = 1 - Distributed Load.
% Key = 2 - Thermal Load.
% Key = 3 - Acceleration.
% Enter Dist. Type of each variable %%%%%%%%%%%%%%%%%%%%%%
% 0 = Normal.
% 1 = Lognormal.
% 2 = Type-I.
NLS = 1;
% No. of Load Sets.
Loads_Set(1,1:10) = [ 3 10e4 0.1 2 0 1 0 0 0 0];
if ~isempty(FORC_E)
a22 = size(FORC_E(:,1)); n3 = a22(1);
for i3 = 1:n3
NLS = NLS + 1;
Loads_Set(NLS,1) = 0;
Loads_Set(NLS,2) = FORC_E(i3,4);
Loads_Set(NLS,3) = 0.1;
% Coefficient of Variation
Loads_Set(NLS,8) = FORC_E(i3,1);
if FORC_E(i3,3) == 88
Loads_Set(NLS,5:7) = [1 0 0];
elseif FORC_E(i3,3) == 89
Loads_Set(NLS,5:7) = [0 1 0];
elseif FORC_E(i3,3) == 90
Loads_Set(NLS,5:7) = [0 0 1];
end
end
end
if ~isempty(TEMP)
[TEMP2,I2] = sort(TEMP(:,2)); ik=1;
while 1
NLS = NLS + 1; ik2=1;
while 1
Loads_Set(NLS,1) = 2; % Key for Thermal Load
Loads_Set(NLS,2) = TEMP2(ik); Loads_Set(NLS,3) = 0.05;
Loads_Set(NLS,9+(ik2-1)) = I2(ik);
Loads_Set(NLS,8) = ik2;
ik2 = ik2+1;
if ik < (ipe-1)
if TEMP2(ik+1) ~= TEMP2(ik)
ik = ik+1;
break;
end
end
ik = ik + 1;
if ik > (ipe-1) , break, end;
end
if ik > (ipe-1), break, end;
end
end
%Loads_Set(2,1:11) = [ 2
%Loads_Set(3,1:11) = [ 2
%Loads_Set(4,1:11) = [ 2
%Loads_Set(2,1:10) = [ 3
50 0.1 2
40 0.1 2
-10 0.1 2
20e4 0.1 2
0 0 0 3 1 2 3 ];
0 0 0 3 4 5 6 ];
0 0 0 3 7 8 9 ];
0 1 0 0 3 0];
%%%%%%%%%%%%%%%%%%% DO NOT change this part %%%%%%%%%%%%%%%%%%%%%%%
DVn = 0;
for iL=1:NLS % No of Load sets
if Loads_Set(iL,3) ~= 0
DVn = DVn + 1; dist(DVn) = Loads_Set(iL,4);
Xs(1,DVn) = Loads_Set(iL,2); % Mean value
Xs(2,DVn) = Loads_Set(iL,3); % COV value
end
end
for ir = 1:NREAL
if Real_Constants(ir,2)~= 0
DVn = DVn + 1; dist(DVn) = Real_Constants(ir,5);
Xs(1,DVn) = Real_Constants(ir,1); % Mean value
Xs(2,DVn) = Real_Constants(ir,2); % COV value
end
if Real_Constants(ir,4)~= 0
DVn = DVn + 1; dist(DVn) = Real_Constants(ir,6);
Xs(1,DVn) = Real_Constants(ir,3); % Mean value
Xs(2,DVn) = Real_Constants(ir,4); % COV value
end
end
for im = 1:NM
if Material_Properties(im,2)~= 0
DVn = DVn + 1; dist(DVn) = Material_Properties(im,9);
Xs(1,DVn) = Material_Properties(im,1); % Mean value
Xs(2,DVn) = Material_Properties(im,2); % COV value
end
if Material_Properties(im,4)~= 0
DVn = DVn + 1; dist(DVn) = Material_Properties(im,10);
Xs(1,DVn) = Material_Properties(im,3); % Mean value
Xs(2,DVn) = Material_Properties(im,4); % COV value
end
if Material_Properties(im,6)~= 0
DVn = DVn + 1; dist(DVn) = Material_Properties(im,11);
Xs(1,DVn) = Material_Properties(im,5); % Mean value
Xs(2,DVn) = Material_Properties(im,6); % COV value
end
if Material_Properties(im,8)~= 0
DVn = DVn + 1; dist(DVn) = Material_Properties(im,12);
Xs(1,DVn) = Material_Properties(im,7); % Mean value
Xs(2,DVn) = Material_Properties(im,8); % COV value
end
end
DVn
Xs
Subroutine to Calculate Displacement and Forces in Frame Structure
function [Disp2,Eforce,STOREG,NF] =
Beam3D(IKM,IDOF,NODOF,NXE,N,NN,NR,E,Iy,Iz,A,Alphr,STOREC,NF,EL_table,LOADS,T_ref,Loads_Set,Alp
ha_T,NLS)
% NODE FREEDOM DATA
T_t(1:NXE) = T_ref;
NF = READNF(NODOF,NXE,EL_table,NF);
%%%%% IW = subtract minimum DOF from maximum DOF for each element, then take the largest
number among all elements.
for i= 1:NXE
G = GSTRNG(EL_table,i,NODOF,NF);
STOREG(i,:) = G;
if ( min(STOREG(i,:)) == 0), continue, end;
%IW_array(i) = max(STOREG(i,:)) - min(STOREG(i,:));
end
%IW = max(IW_array);
%IW
%KV2(1:N*(IW+1))=0;
KV2(1:N,1:N) = 0;
% GLOBAL STIFFNESS MATRIX ASSEMBLY
for IP=1:NXE
[KM,KMe,Gam] = BMCOL3(E,A,Iy,Iz,Alphr,IP,STOREC); % Ke is the KM-without rotation
G = STOREG(IP,:);
[KV2] = FORMKV(KV2,KM,IKM,G,N,NR,IDOF);
% [KV2] = FORMKV2(KV2,KM,IKM,G,N,NR,IDOF);
end
%[KV2] = BANRED(KV2,N,IW);
%[Disp2] = BACSUB(KV2,LOADS,N,IW);
Disp2 = inv(KV2)*LOADS';
%RETRIEVE ELEMENT END FORCES AND MOMENTS
for IP=1:NXE
[KM,KMe,Gam] = BMCOL3(E,A,Iy,Iz,Alphr,IP,STOREC); % Calcluate Orginal KM-element
for i=1:IDOF
if (STOREG(IP,i)==0)
Edisp(i)=0;
else
Edisp(i) = Disp2(STOREG(IP,i)); % Displacement of element nodes in Global-Coord
end
end
X1=STOREC(IP,1); Y1=STOREC(IP,2); Z1 = STOREC(IP,3);
X2=STOREC(IP,4); Y2=STOREC(IP,5); Z2 = STOREC(IP,6); alph = Alphr(IP)*(pi/180);
ELL=sqrt( (Y2-Y1)^2 + (X2-X1)^2 + (Z2-Z1)^2 );
CX = (X2-X1)/ELL; CY = (Y2-Y1)/ELL; CZ = (Z2-Z1)/ELL;
CXZ = sqrt( CX^2 + CZ^2 );
if CXZ==0
Alph = [ 0
CY
0;
-CY*cos(alph) 0 sin(alph);
CY*sin(alph) 0 cos(alph) ];
else
Alph = [ CX
CY
CZ;
(-CX*CY*cos(alph)-CZ*sin(alph))/CXZ
CY*CZ*cos(alph)+CX*sin(alph))/CXZ;
(CX*CY*sin(alph)-CZ*cos(alph))/CXZ
];
CXZ*cos(alph)
(-
-CXZ*sin(alph)
(CY*CZ*sin(alph)+CX*cos(alph))/CXZ
end
Pm(1:12,1:12) = 0;
Pm(1:3,1:3) = Alph;
Pm(4:6,4:6) = Alph;
Pm(7:9,7:9) = Alph;
Pm(10:12,10:12) = Alph;
%%%% Define each element Temperature from Load Sets
for IL=1:NLS
ch = Loads_Set(IL,1);
if ch == 2
NE = Loads_Set(IL,8);
for IT = 1:NE
IE = Loads_Set(IL,9+(IT-1));
T_t(IE) = Loads_Set(IL,2);
end
end
end
LTe = E(IP)*A(IP)*Alpha_T(IP)*(T_t(IP)-T_ref)*[-1;0;0;0;0;0;1;0;0;0;0;0];
Edispe = Pm*Edisp';
Efor = KMe*Edispe - LTe;
Eforce(IP,1:IDOF) = Efor';
end
Subroutine to Apply FORM Method for 3-D Frames
% FORM Method-2
% Step-1: Define Random variables parameters [mean - std - distribution
% type & FE Mesh
clear all
format short e
Input3R
% Step-2: Define initial design point xo
xm0(1:DVn) = Xs(1,1:DVn); cov0(1:DVn) = Xs(2,1:DVn);
for i1=1:DVn
std0(i1) = cov0(i1) * xm0(i1);
end
xstar(1:DVn) = xm0(1:DVn);
Beta_old=0;
for k=1:100
% Calculate response parameters and g-value for the current random variables.
[No_r,No_m,Ty,Tz,A,Iy,Iz,Alphe,E,Fy,Density,Alpha_T] =
Properties(NXE,EL_table,Real_Constants,Material_Properties);
for j1=1:1e4 % Loop to increase value of Load to make 'g( ) < 0.7' for convergence reason. done for
the first loop only.
[LOADS,DLOADS] =
LOADS1(IDOF,NN,NR,N,NXE,NLS,DVn,NODOF,EL_table,NF,Loads_Set,Alphe,STOREC,E,A,Alpha_T,T_ref,D
ensity);
[Disp2,Eforce,STOREG,NF] =
Beam3D(IKM,IDOF,NODOF,NXE,N,NN,NR,E,Iy,Iz,A,Alphe,STOREC,NF,EL_table,LOADS,T_ref,Loads_Set,Alp
ha_T,NLS);
[S,Rel_E_N,Stress,S_DIR] = Smatrix(Eforce,EL_table,NXE,A,Iy,Iz,Ty,Tz);
[gvalue] = performance_function(S,xstar,Rel_E_N,STOREC,Fy);
gvalue
if (abs(gvalue) < 0.75) | (k > 1) , break, end;
DVnL=0;
for iL=1:NLS % No of Load sets
if Loads_Set(iL,3) ~= 0
DVnL = DVnL + 1;
Loads_Set(DVnL,2) = 1.25*Loads_Set(DVnL,2); % Mean value
xm0(DVnL) = Loads_Set(DVnL,2); std0(DVnL) = cov0(DVnL) * xm0(DVnL);
xstar(DVnL) = xm0(DVnL);
end
end
end
S
Rel_E_N
gvalue
% Step-3: Define mean and std of the equivalent normal dist. And evaluate
% the equivalent normal variables
[xm,std] = meanstd(DVn,xstar,xm0,std0,dist);
Bmatrix(1:DVn,1:DVn) = 0;
for i2=1:DVn
Bmatrix(i2,i2) = 1/std(i2);
end
for i=1:DVn
xstar_dash(i) = (xstar(i) - xm(i))/std(i);
end
% Step-4: Compute partial derivative at design point x_star
%[dgdx] =
Dperformance_function(IKM,IDOF,NODOF,NXE,N,NR,STOREG,S,xstar,Disp2,DLOADS,Rel_E_N,EL_table,S
TOREC,E,Iy,Iz,A,Zy,Zz,Fy,Alphe,NLS,NREAL,NM,Loads_Set,Real_Constants,Material_Properties);
for i3=1:DVn
Xv = xstar;
dx = std0(i3)/10;
Xv(i3) = xstar(i3) + dx;
[Loads_Set,Real_Constants,Material_Properties] =
Convert(NLS,NREAL,NM,Xv,Loads_Set,Real_Constants,Material_Properties);
[No_r,No_m,Ty,Tz,A,Iy,Iz,Alphe,E,Fy,Density,Alpha_T] =
Properties(NXE,EL_table,Real_Constants,Material_Properties);
[LOADS,DLOADS] =
LOADS1(IDOF,NN,NR,N,NXE,NLS,DVn,NODOF,EL_table,NF,Loads_Set,Alphe,STOREC,E,A,Alpha_T,T_ref,D
ensity);
[Disp2,Eforce,STOREG] =
Beam3D(IKM,IDOF,NODOF,NXE,N,NN,NR,E,Iy,Iz,A,Alphe,STOREC,NF,EL_table,LOADS,T_ref,Loads_Set,Alp
ha_T,NLS);
[S2,Rel_E_N] = Smatrix(Eforce,EL_table,NXE,A,Iy,Iz,Ty,Tz);
[gvalue2] = performance_function(S2,xstar,Rel_E_N,STOREC,Fy);
dgdx(i3) = (gvalue2-gvalue)/dx;
[Loads_Set,Real_Constants,Material_Properties] =
Convert(NLS,NREAL,NM,xstar,Loads_Set,Real_Constants,Material_Properties);
end
dgdx
[NLS]=sensitivity(NLS,NREAL,NM,Xs,Loads_Set,Real_Constants,Material_Properties,dgdx)
% Step-5: Compute partial derivative in the equivalent normal space
dgdxstar_dash = [inv(Bmatrix)] * dgdx';
alpha1 = dgdxstar_dash/norm(dgdxstar_dash)
% Step-6: Evaluate coordinates of the new design point in the equivalent
% normal space using eqn 3.48
xstar_dash_new = (1/norm(dgdxstar_dash))^2 * ( DOT(dgdxstar_dash,xstar_dash) - gvalue
)*dgdxstar_dash;
% Step-7: Evaluate Beta - distance to the new design values
Beta = norm(xstar_dash_new);
delta_Beta = abs(Beta - Beta_old);
Beta_old = Beta;
% Step-8: Evaluate new design values in the orginal space
for i=1:DVn
xstar(i) = xm(i) + std(i)*xstar_dash_new(i);
end
[Loads_Set,Real_Constants,Material_Properties] =
Convert(NLS,NREAL,NM,xstar,Loads_Set,Real_Constants,Material_Properties);
xstar_dash_k(:,k) = xstar_dash';
xstar_dash_new_k(:,k) = xstar_dash_new;
xm_k(:,k) = xm';
std_k(:,k) = std';
dgdx_k(:,k) = dgdx';
dgdxstar_dash_k(:,k) = dgdxstar_dash;
gvalue_k(k) = gvalue;
Beta_k(k) = Beta;
xstar_k(:,k) = xstar';
if (abs(gvalue) < 0.0001) & (delta_Beta < 0.001)
break
end
end
Subroutine to Assemble Load Vector
function [LV2] = FORMLV(LV2,LM,G,N,IDOF)
% C C THIS SUBROUTINE FORMS THE GLOBAL STIFFNESS MATRIX
for J =1:IDOF
if (G(J) == 0) ,continue ,end
LV2(G(J)) = LV2(G(J)) + LM(J);
end
Subroutine to Calculate Performance function
function [gv] = performance_function(S,X,Rel_E_N,COORD,Fy)
IP = Rel_E_N(1);
X1=COORD(IP,1); Y1=COORD(IP,2); Z1 = COORD(IP,3);
X2=COORD(IP,4); Y2=COORD(IP,5); Z2 = COORD(IP,6);
L=sqrt( (Y2-Y1)^2 + (X2-X1)^2 + (Z2-Z1)^2 );
gv = 1 - (S / Fy(IP));
Subroutine to Calculate extract Statistical Parameters from Input File
function [Loads_Set,Real_Constants,Material_Properties] =
Convert(NLS,NREAL,NM,Xs,Loads_Set,Real_Constants,Material_Properties)
DVn=0;
for iL=1:NLS % No of Load sets
if Loads_Set(iL,3) ~= 0
DVn = DVn + 1;
Loads_Set(iL,2)=Xs(DVn); % Mean value
end
end
for ir = 1:NREAL
if Real_Constants(ir,2)~= 0
DVn = DVn + 1;
Real_Constants(ir,1)=Xs(DVn); % Mean value
end
if Real_Constants(ir,4)~= 0
DVn = DVn + 1;
Real_Constants(ir,3)=Xs(DVn); % Mean value
end
end
for im = 1:NM
if Material_Properties(im,2)~= 0
DVn = DVn + 1;
Material_Properties(im,1)=Xs(DVn); % Mean value
end
if Material_Properties(im,4)~= 0
DVn = DVn + 1;
Material_Properties(im,3)=Xs(DVn); % Mean value
end
if Material_Properties(im,6)~= 0
DVn = DVn + 1;
Material_Properties(im,5)=Xs(DVn); % Mean value
end
if Material_Properties(im,8)~= 0
DVn = DVn + 1;
Material_Properties(im,7)=Xs(DVn); % Mean value
end
end
Subroutine to Calculate sensitivity of performance function to
random variables
function [NLS] = sensitivity(NLS,NREAL,NM,Xs,Loads_Set,Real_Constants,Material_Properties,dgdx)
DVn = 0;
for iL=1:NLS % No of Load sets
if Loads_Set(iL,3) ~= 0
DVn = DVn + 1;
fprintf(1,'Sensitivity of performance function w.r.t Load Set %i = %f \n', iL,dgdx(DVn))
end
end
for ir = 1:NREAL
if Real_Constants(ir,2)~= 0
DVn = DVn + 1;
fprintf(1,'Sensitivity of performance function w.r.t Ty of real constant set %i = %f \n',
ir,dgdx(DVn))
end
if Real_Constants(ir,4)~= 0
DVn = DVn + 1;
fprintf(1,'Sensitivity of performance function w.r.t Tz of real constant set %i = %f \n',
ir,dgdx(DVn))
end
end
for im = 1:NM
if Material_Properties(im,2)~= 0
DVn = DVn + 1;
fprintf(1,'Sensitivity of performance function w.r.t E of Material set %i = %f \n', im,dgdx(DVn))
end
if Material_Properties(im,4)~= 0
DVn = DVn + 1;
fprintf(1,'Sensitivity of performance function w.r.t Fy of Material set %i = %f \n', im,dgdx(DVn))
end
if Material_Properties(im,6)~= 0
DVn = DVn + 1;
fprintf(1,'Sensitivity of performance function w.r.t Density of Material set %i = %f \n',
im,dgdx(DVn))
end
if Material_Properties(im,8)~= 0
DVn = DVn + 1;
fprintf(1,'Sensitivity of performance function w.r.t Thermal_exp_coefficient of Material set %i =
%f \n', im,dgdx(DVn))
end
end
Subroutine to convert between random states to loads, material, and
real constants
function [Loads_Set,Real_Constants,Material_Properties] =
Convert(NLS,NREAL,NM,Xs,Loads_Set,Real_Constants,Material_Properties)
DVn=0;
for iL=1:NLS % No of Load sets
if Loads_Set(iL,3) ~= 0
DVn = DVn + 1;
Loads_Set(iL,2)=Xs(DVn); % Mean value
end
end
for ir = 1:NREAL
if Real_Constants(ir,2)~= 0
DVn = DVn + 1;
Real_Constants(ir,1)=Xs(DVn); % Mean value
end
if Real_Constants(ir,4)~= 0
DVn = DVn + 1;
Real_Constants(ir,3)=Xs(DVn); % Mean value
end
end
for im = 1:NM
if Material_Properties(im,2)~= 0
DVn = DVn + 1;
Material_Properties(im,1)=Xs(DVn); % Mean value
end
if Material_Properties(im,4)~= 0
DVn = DVn + 1;
Material_Properties(im,3)=Xs(DVn); % Mean value
end
if Material_Properties(im,6)~= 0
DVn = DVn + 1;
Material_Properties(im,5)=Xs(DVn); % Mean value
end
if Material_Properties(im,8)~= 0
DVn = DVn + 1;
Material_Properties(im,7)=Xs(DVn); % Mean value
end
end
Download