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
|
clc
//Example 2.9
//Stresses at a section
//------------------------------------------------------------------------------
//Given Data:
//Loads
//Load acting vertically downward
Py=-2000//N (compressive)
//Load acting horizontally
Px=1000//N
//Dimensions
//Diameter
d=0.05//m
//length of neck region
a=0.125//m
//distance between midpoint of section and line of action of vertical load
b=0.2//m
//distance between midpoint of section and line of horizontal load
c=0.25//m
//Moment of inertia
I=(%pi/64)*(d^4)
//Polar moment of inertia
J=(%pi/32)*(d^4)
//Area of cross section
A=(%pi/4)*(d^2)
//------------------------------------------------------------------------------
//Printing steps and result file to .txt
res9=mopen(TMPDIR+'9_stresses_at_section.txt','wt')
//Bending moment due to horizontal load about midpoint
Mx=Px*c
mfprintf(res9,"Bending moment due to horizontal load about midpoint Mx= %0.2f Nm\n",Mx)
//Bending moment due to vertical load about midpoint
My=Py*b
mfprintf(res9,"Bending moment due to vertical load about midpoint My= %0.2f Nm\n",My)
//Total bending moment
M=sqrt((Mx^2)+(My^2))
mfprintf(res9,"The total bending moment:\n\tM=sqrt((Mx^2)+(My^2))\n")
mfprintf(res9,"The total bending moment M = %0.2f Nm\n\n",M)
//Normal stress in X direction
Sx=Py/A-((M*(d/2))/I)
mfprintf(res9,"The normal stress is given by\n\tSx=Py/A-((M*(d/2))/I)\n")
mfprintf(res9,"Normal stress acting at the section is %0.2f MN/m^2\n\n",Sx*(10^-6))
//Couple moment due to horizontal load about midpoint
T=Px*b
//Shear stress
Txy=(T*(d/2))/J
mfprintf(res9,"The shear stress is given by\n\tTxy=(T*(d/2))/J\n")
mfprintf(res9,"Normal stress acting at the section is %0.2f MN/m^2\n\n",Txy*(10^-6))
//------------------------------------------------------------------------------
//Extreme streeses:
//Maximum normal stress
Sn_max=(Sx/2)+sqrt(((Sx/2)^2)+(Txy^2))
mfprintf(res9,"Maximum normal stress is %0.2f MN/m^2\n",Sn_max*(10^-6))
//Minimum normal stress
Sn_min=(Sx/2)-sqrt(((Sx/2)^2)+(Txy^2))
mfprintf(res9,"Minimum normal stress is %0.2f MN/m^2\n\n",Sn_min*(10^-6))
S=max((abs(Sn_max)),(abs(Sn_min)))
mfprintf(res9,"The maximum numerical normal stress is %0.2f MN/m^2",S*(10^-6))
//Maximum shear stress
T_max=sqrt(((Sx/2)^2)+(Txy^2))
mfprintf(res9,"\nThe maximum shear stress is %f MN/m^2",T_max*(10^-6))
mclose(res9)
editor(TMPDIR+'9_stresses_at_section.txt')
//------------------------------------------------------------------------------
//-----------------------------End of program-----------------------------------
|