summaryrefslogtreecommitdiff
path: root/764/CH7/EX7.18.c
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /764/CH7/EX7.18.c
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '764/CH7/EX7.18.c')
-rwxr-xr-x764/CH7/EX7.18.c/functions7_18.sci48
1 files changed, 48 insertions, 0 deletions
diff --git a/764/CH7/EX7.18.c/functions7_18.sci b/764/CH7/EX7.18.c/functions7_18.sci
new file mode 100755
index 000000000..b53d32df5
--- /dev/null
+++ b/764/CH7/EX7.18.c/functions7_18.sci
@@ -0,0 +1,48 @@
+
+//Function generating the values of Ka, Kb and Kc
+function [Ka, Kb, Kc] = fluctuate(s, d, r)
+ //Calculate Ka
+ //Nomenclature:
+ //1 - Ground
+ //2 - Machined or cold drawn
+ //3 - Hot-rolled
+ //4 - Forged
+surface = [1 2 3 4]
+Ksurfa = [1.58 4.51 57.7 272]
+Ksurfb = [-0.085 -0.265 -0.718 -0.995]
+for j = 1:1:4
+ if (s == surface(j))
+ a = Ksurfa(j)
+ b = Ksurfb(j)
+ break
+ end
+end
+//From equation 5.18 on page 157
+Ka = a * (Sut^b)
+if (Ka > 1) then
+ Ka = 1
+end
+
+ //Calculate Kb
+ //d (mm)
+ if (d <= 7.5) then
+ Kb = 1
+ elseif ((d > 7.5) & (d <= 50))
+ Kb = 0.85
+ elseif (d > 50)
+ Kb = 0.75
+ else
+ printf('Error in Kb')
+ end
+
+ //Calculate Kc
+ // r (%)
+rel = [50 90 95 99 99.9 99.99 99.999]
+Krel = [1 0.897 0.868 0.814 0.753 0.702 0.659]
+for i = 1:1:7
+ if (r == rel(i)) then
+ Kc = Krel(i)
+ break
+ end
+end
+endfunction