summaryrefslogtreecommitdiff
path: root/764/CH4/EX4.20.b/solution4_20.sce
blob: ddfa0d549ef3c69180c93342dde7632f280dc74f (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

//Obtain path of solution file
path = get_absolute_file_path('solution4_20.sce')
//Obtain path of data file
datapath = path + filesep() + 'data4_20.sci'
//Clear all
clc
//Execute the data file
exec(datapath)
//Calculate the permissible stresses for steel parts sigmat (N/mm2)
sigmat = Syt/fs
//Assume the diameter of the link to be 1mm D
D = 1
R = 4 * D
Ri = (4 * D)-(0.5 * D)
Ro = (4 * D)+(0.5 * D) 
Rn = ((sqrt(Ro) + sqrt(Ri))^2)/4
//Calculate the eccentricity e (mm)
e = R - Rn
hi = Rn - Ri
A = (%pi/4)*(D^2)
//Calculate the bending moment Mb (N-mm)
Mb = (P * 1000)*(4 * D)
//Calculate the bending stress B (N/mm2)
B = (Mb * hi)/(A * e * Ri)
//Calculate the direct tensile stress T (N/mm2)
T = (P * 1000)/A
//Calculate the true diameter of the link D (mm)
D = ((B + T)/sigmat)^(1/2)
//Print results
printf('\nThe diameter of the link(D) = %f mm\n',D)