summaryrefslogtreecommitdiff
path: root/3705/CH14/EX14.2/Ex14_2.sce
blob: 33f4e0e3b28962a91d68d3164e877bef5dc1ac23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41

clear//

//Variable Declaration
R=45 //Radius of the circle in mm
r=20 //Radius of the smaller circle in mm
h=100 //Depth of the straight section in mm

//Calculations
//Part 1

//Triangle
b=2*R //Breadth in mm
A_t=b*h*0.5 //Area in mm^2
Ix_bar_t=b*h**3*36**-1 //Moment of inertia in mm^4
y_bar1=2*3**-1*h //centroidal axis in mm
Ix_t=Ix_bar_t+A_t*y_bar1**2 //moment of inertia in mm^4

//Semi-circle
A_sc=%pi*R**2*0.5 //Area of the semi-circle in mm^2
Ix_bar_sc=0.1098*R**4 //Moment of inertia in mm^4
y_bar2=h+(4*R*(3*%pi)**-1) //Distance of centroid in mm
Ix_sc=Ix_bar_sc+A_sc*y_bar2**2 //Moment of inertia in mm^4

//Circle
A_c=%pi*r**2 //Area of the circle in mm^2
Ix_bar_c=%pi*r**4*4**-1 //Moment of inertia in mm^4
y_bar3=h //Distance of centroid in mm
Ix_c=Ix_bar_c+A_c*y_bar3**2 //Moment of inertia in mm^4

//Composite Area
A=A_t+A_sc-A_c //Total area in mm^2
Ix=Ix_t+Ix_sc-Ix_c //Moment of inertia in mm^4

//Part 2
y_bar=(A_t*y_bar1+A_sc*y_bar2-A_c*y_bar3)/(A) //Location of centroid in mm
Ix_bar=Ix-A*y_bar**2 //Moment of inertia in mm^4

//Result
printf("\n Moment of inertia about x-axis is %0.0f mm^4",Ix)
printf("\n Moment of inertia about the centroidal axis is %0.0f mm^4",Ix_bar)