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

//Obtain path of solution file
path = get_absolute_file_path('solution4_7.sce')
//Obtain path of data file
datapath = path + filesep() + 'data4_7.sci'
//Clear all
clc
//Execute the data file
exec(datapath)
//Calculate permissible tensile stress sigmat (N/mm2)
sigmat = Syt/fs
//Assume the wudth of the cross-section to be 1mm t
t = 1
//Calculate direct compressive stress sigmac (N/mm2)
sigmac = P/(t * (ratio * t))
//Calculate maximum bending moment Mb (N-mm)
Mb = P * l
//Calculate y
y = 1.5 * t
//Calculate the second moment of area I (mm4)
I = (t * ((ratio * t)^3))/12
//Calculate tensile bending stress at the lower fibre sigmab(N/mm2)
sigmab = (Mb * y)/I
//Finding the real value of width t (mm)
//On superimposing the stress values, a cubic equation in t is obtained
a = 0
b = (sigmac/sigmat)
c = (-1 * (sigmab/sigmat))
//Define polynomial
p = [1,a,b,c]
//Calculate roots of this polynomial
r = roots(p)
real_part = real(r)
for i = 1:1:3
    if(real_part(i)>0)
        t = real_part(i)
        break
    end
end
//Print results
printf('\nValue of t = %f mm\n',t)
printf('\nArea of cross-section = (%f x %f) mm2\n',t,(ratio * t))