案例CS:A1: A Matlab program for a 3D struc
当前位置:以往案例 > >案例CS:A1: A Matlab program for a 3D struc
2019-04-04

project 1: A Matlab program for a 3D structure

Please refer the attached 2D frame program (Appendix A) with line-by-line explanations to develop a Matlab program for a 3D Frame, whose nodal and elemental information are shown in Appendix B. The shape of three types of cross section is given in Appendix C. The loading and boundary conditions are shown in Appendix D. Appendix E shows a schematic of frame element in 3D, the local stiffness matrix and material properties for the 3D structure. Noted that the gravity is not considered. In Appendix F, a sample Transmission tower is plotted and your program can be used directly for this complex structure. In Appendix G, analysis of 3D frame in Matlab is given via two examples.



The project should:


1) Write in terms of https://emedia.rmit.edu.au/learninglab/content/reports-0. A sample report is in Appendix B (10 point)

2) Introduce the theory of Finite Element Analysis for 3D frame. (10 point)

3) Plot the flow chart of the program. (10 point)

4) The structure is composed of 3 types of members. (15 point)

5) Plot the 3D Frame before deformation in a 3D view. The type of different members should be clearly seen in the figure. (15 point)

6) List the deformation of all nodes in a table. (20 point)

7) Write your understanding in Finite Element Analysis through this program. (10 point)

8) Please submit the report, Matlab program, input files (node.txt, elem.txt and etc.). (10 point)


Please upload the project to the blackboard before 00:00 19 Aug 2018. Late submissions will attract a penalty of 5% per day.



APPENDIX A

Finite element analysis for a 2D Frame in Matlab


Line

Code

explanation

1

clc;

Clear command window.

2

clear;

removes all variables from the workspace.

3

close all;

closes all the open figure windows.

4

% blank line

5

N = textread('node.txt');

Read x and y coordinate for the node and assign

their values to N

6

E = textread('elem.txt');

Read the near and far end for the beam and

assign

7

% blank line

8

NN = length(N);

Get the number of node

9

NE = length(E);

Get the number of element

10

% blank line

11

E0 = 2.1e6;

Set Young’s modulus

12

A0 = 22.8;

Set the area of cross section

13

I0 = 935;

Set the second moment of inertia

14

% blank line


15


hold on;

holds the current plot and all axis properties so that subsequent graphing commands add to the

existing graph.

16

for i=1:NE

Begin an iteration in which i begins from 1 to NE


17

plot([N(E(i,1),1),N(E(i,2),1)],[N(E(i,1),2),N(

E(i,2),2)],'k','linewidth',2);

Plot a line starts from the near end to the far end of an element in black with the linewidth of

2.


18

text((N(E(i,1),1)+N(E(i,2),1))/2,(N(E(i,1),2)+

N(E(i,2),2))/2,num2str(i),'color','b','fontsiz e',12);

Plot the element number at its middle in blue and 12 font size.

19

end

End the iteration

20

% blank line

21

for i=1:NN

Begin an iteration in which i begins from 1 to NN

22

if i<3

If i<3

23

plot(N(i,1),N(i,2),'rs','markersize',12,'mark

erfacecolor','r');

Plot a red square marker at the node i with the

size of 12 and red marker face color.

24

else

Else

25

plot(N(i,1),N(i,2),'ko','markersize',8,'mark

erfacecolor','k');

Plot a black circle marker at the node i with the

size of 8 and black marker face color.

26

end

End if

27

text(N(i,1),N(i,2),num2str(i),'color','g','font

size',12);

Plot a green node number at the node i with the

size of 12.

28

end

End the iteration

29

% blank line

30

F=zeros(3*NN,1);

Create the force vector and all members are

zero.

31

FN = [11 12 17 18 23 24];

Set the node number at which a load is applied

32

F(3*FN-2) = -20;

The x component of the load is -20

33

F(3*FN-1) = -10;

The y component of the load is -10



34

% blank line

35

scale = 20;

Set the scaling factor

36

for i=1:length(FN)

Begin an iteration in which i begins from 1 to the

number of loads


37

plot( N(FN(i),1),N(FN(i),2),'b*','markersize'

,10,'markerfacecolor','b');

Plot a blue star with the size of 10 and blue

marker face color at the node where a load is applied.


38

plot([N(FN(i),1),N(FN(i),1)-

100*sin(20/180*pi)],[N(FN(i),2),N(FN(i),2)

-100*cos(20/180*pi)],'-

>r','linewidth',2,'markerfacecolor','r');

Plot red “>” symbols to show the applied load in 20 degree angle with line width of 2 and red marker face color

39

% blank line

40

ang=-1.5*pi:0.5:-.5*pi;

41

xp=scale*cos(ang);

42

yp=scale*sin(ang);


43

plot(N(FN(i),1)+xp,N(FN(i),2)+yp,'–

r>','linewidth',2,'markerfacecolor','r');

Plot 7 red “>” symbols to show the applied moment with line width of 2 and red marker

face color

44

end

End the iteration

45

% blank line

46

title('A schematic of the power

tower','fontsize',12);

Plot the title of this figure with 12 font size

47

set(gca,'fontsize',12);

Set the font size of current axis as 12


在线提交订单