Question

In: Civil Engineering

Can you provide a sample programming for 2D plane frame in MATLAB ?

Can you provide a sample programming for 2D plane frame in MATLAB ?

Solutions

Expert Solution

clear all

clc

format short

E=210e6;

I=9*10^-5;

A=1*10^-2;

L1=[sqrt(13),5,sqrt(13)];

theta=[atand(3/2) 0 360-atand(3/2)];

ndcon=[1 2;2 3;3 4];

rsdof=[1 2 3 10 11 12];

nelem = size(ndcon,1);

nodes = 4;

ndofn = 3;

nnode = 2;

tdofs = 12;

K=zeros(tdofs);

gstif=zeros(12,12);

for ielem = 1:nelem

    gbdof=[];

    a=A*E/L1(ielem);

    b=12*E*I/(L1(ielem))^3;

    c=b*L1(ielem)/2;

    d=(b*L1(ielem)^2)/3;

    e=d/2;

    C=cosd(theta(ielem));

    S=sind(theta(ielem));

    estif=[a 0 0 -a 0 0;

           0 b c 0 -b c;

           0 c d 0 -c e;

          -a 0 0 a 0 0;

           0 -b -c 0 b -c;

           0 c e 0 -c d];

       T=[C S 0 0 0 0;

           -S C 0 0 0 0;

           0 0 1 0 0 0;

           0 0 0 C S 0;

           0 0 0 -S C 0;

           0 0 0 0 0 1];

    elcon=ndcon(ielem,:);

for inode = 1:nnode

for idofn = 1:ndofn

            eldof = (elcon(inode)-1)*ndofn+idofn;

            gbdof= [gbdof, eldof];

end

end

    gstif(gbdof,gbdof) = gstif(gbdof,gbdof)+T'*estif*T;

end

gstif

w=5;

Ft=[20 (-w*5/2) -(w*25/12) 0 (-w*5/2) (w*25/12)];

force=[0 0 0 20 (-w*5/2) -(w*25/12) 0 (-w*5/2) (w*25/12) 0 0 0]';

activ = setdiff(1:tdofs,rsdof);

u=gstif(activ,activ)\force(activ);

U=[0;0;0;u;0;0;0]

F=gstif*U-[0 0 0 Ft 0 0 0]';

f=zeros(6,3);

for ielem = 1:nelem

    gbdof=[]; %global DOF

    a=A*E/L1(ielem);

    b=12*E*I/(L1(ielem))^3;

    c=b*L1(ielem)/2;

    d=(b*L1(ielem)^2)/3;

    e=d/2;

    C=cosd(theta(ielem));

    S=sind(theta(ielem));

    elcon=ndcon(ielem,:);

    estif=[a 0 0 -a 0 0;

           0 b c 0 -b c;

           0 c d 0 -c e;

          -a 0 0 a 0 0;

           0 -b -c 0 b -c;

           0 c e 0 -c d];

       T=[C S 0 0 0 0;

           -S C 0 0 0 0;

           0 0 1 0 0 0;

           0 0 0 C S 0;

           0 0 0 -S C 0;

           0 0 0 0 0 1];

for inode = 1:nnode

for idofn = 1:ndofn

            eldof = (elcon(inode)-1)*ndofn+idofn;

            gbdof= [gbdof, eldof];

end

end

       f(:,ielem)=estif*T*U(gbdof);

end

for ielem=1:nelem

x=[0,L1(ielem)];

y1=[-f(3,ielem),f(6,ielem)];

y2=[f(2,ielem),-f(5,ielem)];

y3=[-f(1,ielem),f(4,ielem)];

figure

plot(x,y1,x,y2,x,y3)

legend('BM','SF','AF')

title('member')

end

%OUTPUT

% gstif =

%

%    1.0e+05 *

%

%     1.8256    2.6658   -0.0726   -1.8256   -2.6658   -0.0726         0         0         0         0         0         0

%     2.6658    4.0471    0.0484   -2.6658   -4.0471    0.0484         0         0         0         0         0         0

%    -0.0726    0.0484    0.2097    0.0726   -0.0484    0.1048         0         0         0         0         0         0

%    -1.8256   -2.6658    0.0726    6.0256    2.6658    0.0726   -4.2000         0         0         0         0         0

%    -2.6658   -4.0471   -0.0484    2.6658    4.0653   -0.0030         0   -0.0181    0.0454         0         0         0

%    -0.0726    0.0484    0.1048    0.0726   -0.0030    0.3609         0   -0.0454    0.0756         0         0         0

%          0         0         0   -4.2000         0         0    6.0256   -2.6658    0.0726   -1.8256    2.6658   0.0726

%          0         0         0         0   -0.0181   -0.0454   -2.6658    4.0653    0.0030    2.6658   -4.0471    0.0484

%          0         0         0         0    0.0454    0.0756    0.0726    0.0030    0.3609   -0.0726   -0.0484    0.1048

%          0         0         0         0         0         0   -1.8256    2.6658   -0.0726    1.8256   -2.6658   -0.0726

%          0         0         0         0         0         0    2.6658   -4.0471   -0.0484   -2.6658    4.0471   -0.0484

%          0         0         0         0         0         0    0.0726    0.0484    0.1048   -0.0726   -0.0484    0.2097

%

% U =

%          0

%          0

%          0

%     0.0013

%    -0.0009

%    -0.0005

%     0.0012

%     0.0008

%     0.0003

%          0

%          0

%          0


Related Solutions

Develop a general computer program using MATLAB for the analysis of plane (2D) frames. You can...
Develop a general computer program using MATLAB for the analysis of plane (2D) frames. You can use Chapter 6 as a reference. The program should be able to: a. Analyze a frame subjected to different load types, such as joint load, member load, and support displacement; b. Analyze frames with different boundary conditions: pin, roller, and fixed support; c. Generate the results including joint displacements, member axial, shear and moment forces, and reactions
Consider a sheet of 2d graphene in the x-y plane. The 2d sheet of graphene i...
Consider a sheet of 2d graphene in the x-y plane. The 2d sheet of graphene i then sut into a ribbon in the x direction. The energy becomes quantizes in the y direction. calcualte the  charge carrier energies E as a function of kx and ky.
creat a Matlab simulation the solves the 2D heat equation.
creat a Matlab simulation the solves the 2D heat equation.
I want the code for the 2D Ising model using Matlab
I want the code for the 2D Ising model using Matlab
32.) In the plane of a square conducting frame with the sides a= 8cm, there is...
32.) In the plane of a square conducting frame with the sides a= 8cm, there is an infinite long wire in a distance b= 0.5cm parallel with one side of the square. The infinite wire carries a current with the time functionI(t) = I0·cos(ωt), where I0= 3A,ω= 2pi·f and the frequency is f= 3MHz. a./ Find the mutual induction coefficient between the wire and the square. b./ Find the amplitude of the induced voltage.c./ Find the maximal magnetic flux in...
Use R programming to resolve this; can you please provide details on the code? A) Create...
Use R programming to resolve this; can you please provide details on the code? A) Create a dataframe – comparativeGenomeSize with the following vectors: > organism<-c("Human","Mouse","Fruit Fly", "Roundworm","Yeast") > genomeSizeBP<-c(3000000000,3000000000,135600000,97000000,12100000) > estGeneCount<-c(30000,30000,13061,19099,6034) B) Print the organism and estGeneCount for Human and fruitfly.(1) C) Add a column to this data frame calculating base pairs per gene. To do this, write a function “genedensity” that takes as arguments the genomesizeBP and estimatedGeneCount information, and calculates from this the estimated bp per gene....
Engineering/ programming in MATLAB and it also involves a physics
Engineering/ programming in MATLAB and it also involves a physics
Using c programming language How do you put data from a text file into a 2d...
Using c programming language How do you put data from a text file into a 2d array For example a text file with names and age: john 65 sam 34 joe 35 sarah 19 jason 18 max 14 kevin 50 pam 17 bailey 38 one 2d array should have all the names from the file and one 2d array should have all the ages and both arrays should be printed out separately and be 3x3
Define the following terms and provide an example for each: 1. Population 2. Sample frame 3....
Define the following terms and provide an example for each: 1. Population 2. Sample frame 3. Sample 4. Representative sample
Create a hot and cold game in Matlab to find a point in an (X,Y) 2D...
Create a hot and cold game in Matlab to find a point in an (X,Y) 2D coordinate plane. The user answers two inputs: x=Input('x') y=Input('y'). THE INPUTS WILL ONLY BE INTEGERS FROM 0 TO 100. This means no negative numbers. You write the program so the computer plays the game. The computer must play the game (comparing distances only) and give the same point as the user inputs. To keep it simple the code will check distances until distance =...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT