0% found this document useful (0 votes)
52 views5 pages

Circular Mesh: %................ 2nd Ring Element Nodes Pointing Downword

The document describes the generation of a circular mesh using MATLAB code. It initializes a 54x10 matrix 'a' and populates it using loops to assign node coordinates and element connectivity values based on trigonometric functions of increasing angles. Nodes and elements are assigned in concentric rings with inward and outward facing elements.

Uploaded by

Umar Yaqoob
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views5 pages

Circular Mesh: %................ 2nd Ring Element Nodes Pointing Downword

The document describes the generation of a circular mesh using MATLAB code. It initializes a 54x10 matrix 'a' and populates it using loops to assign node coordinates and element connectivity values based on trigonometric functions of increasing angles. Nodes and elements are assigned in concentric rings with inward and outward facing elements.

Uploaded by

Umar Yaqoob
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

CIRCULAR MESH

a(54,10)=0;
x=1;
for m=1:1:54;
a(x,1)=m;
x=x+1;
end
x=1;
y=2;
for m=1:1:6;
a(x,y+1)=m+1;
a(x,y+2)=m+2;
a(x,y)=1;
c=((m-1)*3.14)/3;
d=(m*3.14)/3;
a(x,7)=.333*cos(c);
a(x,8)=.333*sin(c);
a(x,9)=.333*cos(d);
a(x,10)=.333*sin(d);
a(x,5)=0;
a(x,6)=0;
x=x+1;
end
a(6,4)=2;
%................2nd ring Element nodes pointing downword
x=7;
y=2;
for m=7:1:18;
a(x,y+1)=m+1;
a(x,y+2)=m+2;
x=x+1;
end
a(18,4)=8;
a(18,2)=2;
x=8;
for m=3:1:7;
a(x,2)=m;
a(x+1,2)=m;
x=x+2;
end
a(7,2)=2;
%..........3rd ring elements nodes pointing downword
x=21;
y=2;
for m=10:2:18;
a(x,y)=m;
a(x+1,y)=m;
x=x+3;
end
x=20;
y=2;
for m=9:2:19;
a(x,y)=m;
x=x+3;
end
a(19,2)=8;
a(36,2)=8;
x=19;
y=3;
for m=19:1:36;
a(x,y)=m+1;
a(x,y+1)=m+2;
x=x+1;
end
a(36,4)=20;
%..........Up-right elements nodes in 2nd ring
x=37;
y=2;
for m=3:1:8;
a(x,y)=m;
a(x,y+1)=m-1;
x=x+1;
end
a(42,2)=2;
x=37;
for m=9:2:19;
a(x,4)=m;

CIRCULAR MESH
x=x+1;
end
%............Up-right elements nodes in the 3rd ring
x=43;
y=2;
for m=9:1:20;
a(x,y)=m;
a(x,y+1)=m-1;
x=x+1;
end
a(54,2)=8;
x=43;
for m=21:3:36;
a(x,4)=m;
a(x+1,4)=m+1;
x=x+2;
end
%..................COORDINATES...............
% ................ I values for 2nd row down elements from 7-18.........
a(7,5)=0.333;
a(7,6)=0;
x=8;
for i=2:1:6;
c=((i-1)*3.14)/3;
a(x,5)=0.333*cos(c);
a(x,6)=0.333*sin(c);
a(x+1,5)=0.333*cos(c);
a(x+1,6)=0.333*sin(c);
x=x+2;
end
a(18,5)=0.333;
a(18,6)=0;
%..............I va;ues for 3rd row down elements from 19-36........
x=20;
for i=2:2:12;
c=((i-1)*3.14)/6;
a(x,5)=0.666*cos(c);
a(x,6)=0.666*sin(c);
d=(i*3.14)/6;
a(x+1,5)=0.666*cos(d);
a(x+1,6)=0.666*sin(d);
a(x+2,5)=0.666*cos(d);
a(x+2,6)=0.666*sin(d);
x=x+3;
end
a(37,5)=0;
a(37,6)=0;
a(19,5)=0.666;
a(19,6)=0;
a(36,5)=0.666;
a(36,6)=0;
%...............K values for 2nd row upward elements from37-42........
x=37;
for i=2:2:12;
c=((i-1)*3.14)/6;
a(x,9)=0.666*cos(c);
a(x,10)=0.666*sin(c);
x=x+1;
end
%...............K values for the 3rd row upward elements from 43-54.
x=43;
for i=2:3:18;
c=((i-1)*3.14)/9;
d=((i*3.14)/9);
a(x,9)=cos(c);
a(x,10)=sin(c);
a(x+1,9)=cos(d);
a(x+1,10)=sin(d);
x=x+2;
end
%.....J and K values for 2nd row downward elements from 7-18....
x=8;
for i=2:2:10;
c=(i*3.14)/6;
d=((i+1)*3.14)/6;
e=((i-1)*3.14)/6;
a(x,9)=0.666*cos(c);

CIRCULAR MESH
a(x,10)=0.666*sin(c);
a(x+1,7)=0.666*cos(c);
a(x+1,8)=0.666*sin(c);
a(x+1,9)=0.666*cos(d);
a(x+1,10)=0.666*sin(d);
a(x,7)=0.666*cos(e);
a(x,8)=0.666*sin(e);
x=x+2;
end
a(7,9)=0.666*cos(3.14/6);
a(7,10)=0.666*sin(3.14/6);
a(18,7)=0.666*cos((11*3.14)/6);
a(18,8)=0.666*sin((11*3.14)/6);
a(18,9)=0.666;
a(7,7)=0.666;
a(18,10)=0;
a(7,8)=0;
%.....J and K valus for 3rd row downward elements from 19-36..
x=20;
for i=3:3:17;
c=((i-1)*3.14)/9;
d=(i*3.14)/9;
e=((i+1)*3.14)/9;
a(x,9)=cos(c);
a(x,10)=sin(c);
a(x+1,7)=cos(c);
a(x+1,8)=sin(c);
a(x+1,9)=cos(d);
a(x+1,10)=sin(d);
a(x+2,7)=cos(d);
a(x+2,8)=sin(d);
a(x+2,9)=cos(e);
a(x+2,10)=sin(e);
a(x+3,7)=cos(e);
a(x+3,8)=sin(e);
x=x+3;
end
a(20,7)=cos(3.14/9);
a(20,8)=sin(3.14/9);
a(35,9)=cos((17*3.14)/9);
a(35,10)=sin((17*3.14)/9);
a(19,7)=1;
a(19,8)=0;
a(19,9)=cos(3.14/9);
a(19,10)=sin(3.14/9);
a(36,9)=1;
a(36,10)=0;
a(36,7)=cos((17*3.14)/9);
a(36,8)=sin((17*3.14)/9);
%.......I and J values for upward 2nd row elements fron 37-42..
x=37;
for i=1:1:6;
c=((i-1)*3.14)/3;
d=(i*3.14)/3;
a(x,5)=0.333*cos(d);
a(x,6)=0.333*sin(d);
a(x,7)=0.333*cos(c);
a(x,8)=0.333*sin(c);
x=x+1;
end
a(42,5)=0.333;
a(42,6)=0;
%....I and J values for upward elements 3rd row from 43-54...
x=43;
for i=2:1:12;
c=((i-1)*3.14)/6;
d=((i-2)*3.14)/6;
a(x,5)=0.666*cos(c);
a(x,6)=0.666*sin(c);
a(x,7)=0.666*cos(d);
a(x,8)=0.666*sin(d);
x=x+1;
end
a(54,5)=0.666;
a(54,6)=0;
a(54,7)=0.666*cos((11*3.14)/6);

CIRCULAR MESH
a(54,8)=0.666*sin((11*3.14)/6);
%..........................gplot
for i=1:1:54;
A=[0 1 0;0 0 1;1 0 0];
x=[a(i,5) a(i,6);a(i,7) a(i,8);a(i,9) a(i,10)];
hold on
gplot(A,x);
end

>> a
a=
1.0000
2.0000
3.0000
4.0000
5.0000
6.0000
7.0000
8.0000
9.0000
10.0000
11.0000
12.0000
13.0000
14.0000
15.0000
16.0000
17.0000
18.0000
19.0000
20.0000
21.0000
22.0000
23.0000
24.0000
25.0000
26.0000
27.0000
28.0000
29.0000
30.0000
31.0000
32.0000
33.0000
34.0000
35.0000
36.0000
37.0000
38.0000
39.0000
40.0000
41.0000
42.0000
43.0000
44.0000
45.0000
46.0000

1.0000 2.0000 3.0000


0
0 0.3330
0 0.1667 0.2883
1.0000 3.0000 4.0000
0
0 0.1667 0.2883 -0.1662 0.2886
1.0000 4.0000 5.0000
0
0 -0.1662 0.2886 -0.3330 0.0005
1.0000 5.0000 6.0000
0
0 -0.3330 0.0005 -0.1671 -0.2880
1.0000 6.0000 7.0000
0
0 -0.1671 -0.2880 0.1657 -0.2888
1.0000 7.0000 2.0000
0
0 0.1657 -0.2888 0.3330 -0.0011
2.0000 8.0000 9.0000 0.3330
0 0.6660
0 0.5769 0.3328
3.0000 9.0000 10.0000 0.1667 0.2883 0.5769 0.3328 0.3333 0.5766
3.0000 10.0000 11.0000 0.1667 0.2883 0.3333 0.5766 0.0005 0.6660
4.0000 11.0000 12.0000 -0.1662 0.2886 0.0005 0.6660 -0.3324 0.5771
4.0000 12.0000 13.0000 -0.1662 0.2886 -0.3324 0.5771 -0.5763 0.3338
5.0000 13.0000 14.0000 -0.3330 0.0005 -0.5763 0.3338 -0.6660 0.0011
5.0000 14.0000 15.0000 -0.3330 0.0005 -0.6660 0.0011 -0.5774 -0.3319
6.0000 15.0000 16.0000 -0.1671 -0.2880 -0.5774 -0.3319 -0.3342 -0.5761
6.0000 16.0000 17.0000 -0.1671 -0.2880 -0.3342 -0.5761 -0.0016 -0.6660
7.0000 17.0000 18.0000 0.1657 -0.2888 -0.0016 -0.6660 0.3315 -0.5777
7.0000 18.0000 19.0000 0.1657 -0.2888 0.3315 -0.5777 0.5758 -0.3347
2.0000 19.0000 8.0000 0.3330
0 0.5758 -0.3347 0.6660
0
8.0000 20.0000 21.0000 0.6660
0 1.0000
0 0.9398 0.3419
9.0000 21.0000 22.0000 0.5769 0.3328 0.9398 0.3419 0.7663 0.6425
10.0000 22.0000 23.0000 0.3333 0.5766 0.7663 0.6425 0.5005 0.8658
10.0000 23.0000 24.0000 0.3333 0.5766 0.5005 0.8658 0.1743 0.9847
11.0000 24.0000 25.0000 0.0005 0.6660 0.1743 0.9847 -0.1728 0.9850
12.0000 25.0000 26.0000 -0.3324 0.5771 -0.1728 0.9850 -0.4991 0.8666
12.0000 26.0000 27.0000 -0.3324 0.5771 -0.4991 0.8666 -0.7652 0.6437
13.0000 27.0000 28.0000 -0.5763 0.3338 -0.7652 0.6437 -0.9392 0.3434
14.0000 28.0000 29.0000 -0.6660 0.0011 -0.9392 0.3434 -1.0000 0.0016
14.0000 29.0000 30.0000 -0.6660 0.0011 -1.0000 0.0016 -0.9403 -0.3404
15.0000 30.0000 31.0000 -0.5774 -0.3319 -0.9403 -0.3404 -0.7673 -0.6413
16.0000 31.0000 32.0000 -0.3342 -0.5761 -0.7673 -0.6413 -0.5018 -0.8650
16.0000 32.0000 33.0000 -0.3342 -0.5761 -0.5018 -0.8650 -0.1759 -0.9844
17.0000 33.0000 34.0000 -0.0016 -0.6660 -0.1759 -0.9844 0.1712 -0.9852
18.0000 34.0000 35.0000 0.3315 -0.5777 0.1712 -0.9852 0.4977 -0.8673
18.0000 35.0000 36.0000 0.3315 -0.5777 0.4977 -0.8673 0.7642 -0.6450
19.0000 36.0000 37.0000 0.5758 -0.3347 0.7642 -0.6450 0.9387 -0.3448
8.0000 37.0000 20.0000 0.6660
0 0.9387 -0.3448 1.0000
0
3.0000 2.0000 9.0000 0.1667 0.2883 0.3330
0 0.5769 0.3328
4.0000 3.0000 11.0000 -0.1662 0.2886 0.1667 0.2883 0.0005 0.6660
5.0000 4.0000 13.0000 -0.3330 0.0005 -0.1662 0.2886 -0.5763 0.3338
6.0000 5.0000 15.0000 -0.1671 -0.2880 -0.3330 0.0005 -0.5774 -0.3319
7.0000 6.0000 17.0000 0.1657 -0.2888 -0.1671 -0.2880 -0.0016 -0.6660
2.0000 7.0000 19.0000 0.3330
0 0.1657 -0.2888 0.5758 -0.3347
9.0000 8.0000 21.0000 0.5769 0.3328 0.6660
0 0.9398 0.3419
10.0000 9.0000 22.0000 0.3333 0.5766 0.5769 0.3328 0.7663 0.6425
11.0000 10.0000 24.0000 0.0005 0.6660 0.3333 0.5766 0.1743 0.9847
12.0000 11.0000 25.0000 -0.3324 0.5771 0.0005 0.6660 -0.1728 0.9850

CIRCULAR MESH
47.0000
48.0000
49.0000
50.0000
51.0000
52.0000
53.0000
54.0000

13.0000
14.0000
15.0000
16.0000
17.0000
18.0000
19.0000
8.0000

12.0000
13.0000
14.0000
15.0000
16.0000
17.0000
18.0000
19.0000

27.0000
28.0000
30.0000
31.0000
33.0000
34.0000
36.0000
37.0000

-0.8

-0.6

-0.5763
-0.6660
-0.5774
-0.3342
-0.0016
0.3315
0.5758
0.6660

0.3338 -0.3324 0.5771 -0.7652 0.6437


0.0011 -0.5763 0.3338 -0.9392 0.3434
-0.3319 -0.6660 0.0011 -0.9403 -0.3404
-0.5761 -0.5774 -0.3319 -0.7673 -0.6413
-0.6660 -0.3342 -0.5761 -0.1759 -0.9844
-0.5777 -0.0016 -0.6660 0.1712 -0.9852
-0.3347 0.3315 -0.5777 0.7642 -0.6450
0 0.5758 -0.3347 0.9387 -0.3448

1
0.8
0.6
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
-1

-0.4

-0.2

0.2

0.4

0.6

0.8

You might also like