summaryrefslogtreecommitdiff
path: root/764/CH4/EX4.18.b/solution4_18.sce
blob: aecb236f931d4874a60b14932012c485a301ab38 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81

//Function to round-up a value such that it is divisible by 5
function[v] = round_five(w)
    v = ceil(w)
    rem = pmodulo(v,5)
    if (rem ~= 0) then
    v = v + (5 - rem)
    end
endfunction

//Obtain path of solution file
path = get_absolute_file_path('solution4_18.sce')
//Obtain path of data file
datapath = path + filesep() + 'data4_18.sci'
//Clear all
clc
//Execute the data file
exec(datapath)
//Calculate permissible stresses
//Permissible tensile stress sigmat (N/mm2)
sigmat = Syt/fs
//Calculate the yield strength in shear Ssy (N/mm2)
Ssy = (50/100)*Syt
//Calculate the permissible stress in shear tau (N/mm2)
tau = Ssy/fs
//Maximum force required to shear the bar Ps (N)
Ps = (%pi/4)*(D^2)*Sus
//Calculate the force acting on each pin P1 (N)
P1 = (Ps * l2)/l4
//Calculate reaction at pinA RA (N)
RA = Ps - P1
//Calculate the force applied at lever P (N)
P = (P1 * l2)/l3
//Calculate reaction at pinD RD (N)
RD = P1 - P
//Calculate the diameter of pins d1 (mm)
d1 = (P1/(p * r1))^(1/2)
d1 = round_five(d1)
//Calculate the length of pin l1 (mm)
l1 = r1 * d1
l1 = round_five(l1)
//Calculate the shear stress in pin tau1 (N/mm2)
tau1 = (P1 * 4)/(2 * %pi * (d1^2))
//Calculate the diameter of the link d (mm)
d = ((P1 * 4)/(%pi * sigmat))^(1/2)
d = round_five(d)
//Calculate the maximum bending moment on lever Mb (N-mm)
Mb = P * (l3 - l2)
//Assume the thickness of the cross-section to be 1mm b
b = 1
//Calculate the width of the cross-section h (mm)
h = r2 * b
//Calculate the value of y (mm)
y = h/2
//Calculate the second moment of area I (mm4)
I = (b * ((r2 * b)^3))/12
//Calculate the true value of b (mm)
b = ((Mb * y)/(sigmat * I))^(1/3)
b = round_five(b)
//Calculate the true value of h (mm)
h = r2 * b
//Calculate the inner diameter of the boss di (mm)
di = d1 + (2 * t)
//Calculate the outer diameter of the boss d0 (mm)
d0 = 2 * di
//Calculate the second moment of area I1 (mm4)
I1 = ((l1 * (d0^3)) - (l1 * (di^3)))/12
//Calculate y1 (mm)
y1 = d0/2
//Calculate the bending stress B (N/mm2)
B = (Mb * y1)/I1
//Print results
printf('\nDiameter of pins(d1) = %f mm\n',d1)
printf('\nLength of pins(l1) = %f mm\n',l1)
printf('\nDiameter of link(d) = %f mm\n',d)
printf('\nWidth of lever cross-section(h) = %f mm\n',h)
printf('\nThickness of lever cross-section(b) = %f mm\n',b)
//Chech design
if((tau1 < tau) & (B - sigmat)<2)
    printf('\nThe design is safe\n')
end