diff options
Diffstat (limited to '698/CH2/EX2.1/P1_factor_of_safety.sce')
-rw-r--r-- | 698/CH2/EX2.1/P1_factor_of_safety.sce | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/698/CH2/EX2.1/P1_factor_of_safety.sce b/698/CH2/EX2.1/P1_factor_of_safety.sce new file mode 100644 index 000000000..682f423a8 --- /dev/null +++ b/698/CH2/EX2.1/P1_factor_of_safety.sce @@ -0,0 +1,35 @@ +clc
+//Example 2.1
+//Factor of safety
+
+//------------------------------------------------------------------------------
+//Given Data:
+//Dimensions
+b=0.04//m
+h=0.05//m
+// the value of h is given 20mm in the problem statement but taken 50mm while solving, therefore we will take 50mm as the value of h
+//Force
+P=200000//N
+
+//------------------------------------------------------------------------------
+//Stress induced
+S=P/(b*h)
+S=S*(10^-6)//To convert units into Mpa
+
+//Yield strength
+Sy=500//Mpa
+
+//Factor of safety
+fos=Sy/S
+
+//------------------------------------------------------------------------------
+//Printing the result file to .txt
+res1=mopen(TMPDIR+'1_factor_of_safety.txt','wt')
+mfprintf(res1,"The stress in the bar is given by:\n")
+mfprintf(res1,"\n\tSx=P/A\n")
+mfprintf(res1,"\n\tFactor of safety=(Yield Strength)/(Induced Strength)\n\n")
+mfprintf(res1,"The factor of safety is %d",fos)
+mclose(res1)
+editor(TMPDIR+'1_factor_of_safety.txt')
+//------------------------------------------------------------------------------
+//-----------------------------End of program-----------------------------------
\ No newline at end of file |