diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /2510/CH24 | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '2510/CH24')
-rwxr-xr-x | 2510/CH24/EX24.10/Ex24_10.sce | 26 | ||||
-rwxr-xr-x | 2510/CH24/EX24.15/Ex24_15.sce | 13 | ||||
-rwxr-xr-x | 2510/CH24/EX24.4/Ex24_4.sce | 19 | ||||
-rwxr-xr-x | 2510/CH24/EX24.5/Ex24_5.sce | 13 | ||||
-rwxr-xr-x | 2510/CH24/EX24.6/Ex24_6.sce | 9 | ||||
-rwxr-xr-x | 2510/CH24/EX24.7/Ex24_7.sce | 16 | ||||
-rwxr-xr-x | 2510/CH24/EX24.8/Ex24_8.sce | 9 | ||||
-rwxr-xr-x | 2510/CH24/EX24.9/Ex24_9.sce | 13 |
8 files changed, 118 insertions, 0 deletions
diff --git a/2510/CH24/EX24.10/Ex24_10.sce b/2510/CH24/EX24.10/Ex24_10.sce new file mode 100755 index 000000000..256e98437 --- /dev/null +++ b/2510/CH24/EX24.10/Ex24_10.sce @@ -0,0 +1,26 @@ +//variable Declaration: +mTa = [100,100,100,100,100,100,100,100,100,100] //Mean weeks for thermometer failure(A) +mTb = [90,90,90,90,90,90,90,90,90,90] //Mean weeks for thermometer failure(B) +mTc = [80,80,80,80,80,80,80,80,80,80] //Mean weeks for thermometer failure(C) +sTa = 30 //Standard deviation (weeks) for thermometer failure(A) +sTb = 20 //Standard deviation (weeks) for thermometer failure(B) +sTc = 10 //Standard deviation (weeks) for thermometer failure(C) +Ra = [0.52,0.80,0.45,0.68,0.59,0.01,0.50,0.29,0.34,0.46] //Random No corrosponding to A +Rb = [0.77,0.54,0.96,0.02,0.73,0.67,0.31,0.34,0.00,0.48] //Random No corrosponding to B +Rc = [0.14,0.39,0.06,0.86,0.87,0.90,0.28,0.51,0.56,0.82] //Random No corrosponding to B +Za = [0.05,0.84,-0.13,0.47,0.23,-2.33,0.00,-0.55,-0.41,-0.10] //Normal variable corrosponding to random No for A +Zb = [0.74,0.10,1.75,-2.05,0.61,0.44,-0.50,-0.41,-3.90,-0.05] //Normal variable corrosponding to random No for B +Zc = [-1.08,-0.28,-1.56,1.08,1.13,1.28,-0.58,0.03,0.15,0.92] //Normal variable corrosponding to random No for C + +//Calculations: +Ta = mTa+sTa*Za +Tb = mTb+sTb*Zb +Tc = mTc+sTc*Zc +Ts = min(list(Ta,Tb)) +Ts = min(list(Ts,Tc)) +k = sum(Ts)/length(Ts) +m = [k,k,k,k,k,k,k,k,k,k] +s = sqrt(sum((Ts-m)**2)/(length(Ts)-1)) + +//Results: +printf("Standard deviation : %.1f Weeks",s) diff --git a/2510/CH24/EX24.15/Ex24_15.sce b/2510/CH24/EX24.15/Ex24_15.sce new file mode 100755 index 000000000..760db22c0 --- /dev/null +++ b/2510/CH24/EX24.15/Ex24_15.sce @@ -0,0 +1,13 @@ +//Variable declaration: +t = 273 //Standard temperature (K) +v = 0.0224 //Volume of air occupied by 1 gmol of ideal gas (m^3) +V = 1100 //Volume of heat exchanger (m^3) +T = 22+273 //Temperature of heat exchanger (K) +x1 = 0.75 //gmols of hydrocarbon leaking from the exchanger (gmol) + +//Calculation: +n = V*(1/v)*(t/T) //Total number of gmols of air in the room (gmol) +xHC = (x1/(n+x1))*10**6 //The mole fraction of hydrocarbon in the room (ppm) +ans = round((xHC*1000)*10**-1)/10**-1 +//Result: +printf("1. The mole fraction of hydrocarbon in the room is : %f ppb .",ans) diff --git a/2510/CH24/EX24.4/Ex24_4.sce b/2510/CH24/EX24.4/Ex24_4.sce new file mode 100755 index 000000000..eb49afda8 --- /dev/null +++ b/2510/CH24/EX24.4/Ex24_4.sce @@ -0,0 +1,19 @@ +//Variable declaration: +fm = 30/100 //Mole fraction of methane +fe = 50/100 //Mole fraction of ethane +fp = 20/100 //Mole fraction of pentane +LFLm = 0.046 //Lower flammability limit for methane +LFLe = 0.035 //Lower flammability limit for ethane +LFLp = 0.014 //Lower flammability limit for propane +UFLm = 0.142 //Upper flammability limit for methane +UFLe = 0.151 //Upper flammability limit for ethane +UFLp = 0.078 //Upper flammability limit for propane + +//Calculation: +LFLmix = 1/((fm/LFLm)+(fe/LFLe)+(fp/LFLp)) //Lower flammability limit of gas mixture +UFLmix = 1/((fm/UFLm)+(fe/UFLe)+(fp/UFLp)) //Upper flammability limit of gas mixture + +//Result: +printf("The upper flammability limit (UFL) of the gas mixture is : %.2f %%",UFLmix*100) +printf("The lower flammability limit (LFL) of the gas mixture is : %.2f %%",LFLmix*100) +printf("There is a printing mistake in book.") diff --git a/2510/CH24/EX24.5/Ex24_5.sce b/2510/CH24/EX24.5/Ex24_5.sce new file mode 100755 index 000000000..db07b5bae --- /dev/null +++ b/2510/CH24/EX24.5/Ex24_5.sce @@ -0,0 +1,13 @@ +//Variable declaration: +P_A = 10/100 //Probability that the first tube is defective if the first is replaced +P_B = 10/100 //Probability that the second tube is defective if the first is replaced + +//Calculation: +P_AB = P_A*P_B //Probability that the two tubes are defective if the first is replaced +P_B_A = 9/99 //Probability that the second tube is defective if the first tube is not replaced +Pd_AB = P_A*P_B_A //Probability that both tubes are defective if the first tube is not replaced + +//Result: +printf("The probability that both tubes are defective if :") +printf("(a) the first is replaced before the second is drawn is : %f",P_AB) +printf("(b) the first is not replaced before the second is drawn is : %f",Pd_AB) diff --git a/2510/CH24/EX24.6/Ex24_6.sce b/2510/CH24/EX24.6/Ex24_6.sce new file mode 100755 index 000000000..989079e1a --- /dev/null +++ b/2510/CH24/EX24.6/Ex24_6.sce @@ -0,0 +1,9 @@ +//Variable declaration: +syms X //Range of X +Px = 1.7*(exp(-1.7*X)) //Probability distribution function + +//Calculation: +P = eval(integrate(Px, X,2,6)) //Probability that X will have a value between 2 and 6 + +//Result: +printf("The probability that X will have a value between 2 and 6 is : %.4f",P) diff --git a/2510/CH24/EX24.7/Ex24_7.sce b/2510/CH24/EX24.7/Ex24_7.sce new file mode 100755 index 000000000..b69899f04 --- /dev/null +++ b/2510/CH24/EX24.7/Ex24_7.sce @@ -0,0 +1,16 @@ +//Variable Declaration: +n = 20 //Total number of components +p = 0.1 //Probability of success + +//Calculations: +function [ans]= binomial(n,p,x) + P=0 + for x = 0:x-1 + P = P + p**x*(1-p)**(n-x)*factorial(n)/(factorial(x)*factorial(n-x)) + end + disp(P); + ans = P +endfunction + +//Results: +printf("Probability that the sprinkler system fails : %.2f %%",(1-binomial(n,p,4))*100) diff --git a/2510/CH24/EX24.8/Ex24_8.sce b/2510/CH24/EX24.8/Ex24_8.sce new file mode 100755 index 000000000..70492c7e1 --- /dev/null +++ b/2510/CH24/EX24.8/Ex24_8.sce @@ -0,0 +1,9 @@ +//Variable declaration: +a = 1.3*10^-3 //Constant a +B = 0.77 //Constant B +syms t //Time (h) +Ft = a*B*t^(B-1)*(exp(-a*t^B)) //Pdf for heat exchanger tube +Pt = eval(integrate(Ft, "t",0,1000)) //Probability that a heat exchanger will fail within 100 hours + +//Result: +printf("The probability that a tube in a heat exchanger will fail in 1000 hours is : %.2f",Pt) diff --git a/2510/CH24/EX24.9/Ex24_9.sce b/2510/CH24/EX24.9/Ex24_9.sce new file mode 100755 index 000000000..c5ecabac5 --- /dev/null +++ b/2510/CH24/EX24.9/Ex24_9.sce @@ -0,0 +1,13 @@ +//Variable declaration: +m = 0.4008 //Mean(inch) +s = 0.0004 //Standard Deviation(inch) +UL = 0.4000+0.001 //Upper Limit +LL = 0.4000-0.001 //Upper Limit + +//Calculation: +Ps = cdfnor("PQ",UL,m,s)-cdfnor("PQ",LL,m,s)//Probability of meeting specs +Pd = 1-Ps //Probability of defect + +//Results: +printf("Probability of meeting specifications: %.2f %%",Ps*100) +printf("Probability of Defect: %.2f %%",Pd*100) |