summaryrefslogtreecommitdiff
path: root/764/CH7/EX7.2.b/solution7_2.sce
blob: 7079dc7c84235a2f70617892f95e96895e48bf4f (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

//Function to standardise the given bolt-size
function[v] = standard(w)
    v = ceil(w)
    rem = pmodulo(v,10)
    if (rem ~= 0) then
    v = v + (10 - rem)
    end
endfunction

//Obtain path of solution file
path = get_absolute_file_path('solution7_2.sce')
//Obtain path of data file
datapath = path + filesep() + 'data7_2.sci'
//Clear all
clc
//Execute the data file
exec(datapath)
//Calculate the yield shear strength Ssy (N/mm2)
Ssy = (50/100)*Syt
//Calculate the permissible shear stress tau (N/mm2)
tau = Ssy/fs
//Shear load acting on one bolt P (kN)
P = Pt/2
//Calculate the diameter of the bolt shank d (mm)
d = ((4 * P * 1000)/(%pi * tau))^(1/2)
//Standardise the bolt size from Table 7.1
d = standard(d)
//Print results
printf('\nThe standard size of the bolt is M%d\n',d)