diff options
Diffstat (limited to '3012/CH2')
-rwxr-xr-x | 3012/CH2/EX2.1/Ex2_1.sce | 37 | ||||
-rwxr-xr-x | 3012/CH2/EX2.2/Ex2_2.sce | 23 | ||||
-rwxr-xr-x | 3012/CH2/EX2.3/Ex2_3.sce | 32 | ||||
-rwxr-xr-x | 3012/CH2/EX2.4/Ex2_4.sce | 15 | ||||
-rwxr-xr-x | 3012/CH2/EX2.5/Ex2_5.sce | 12 | ||||
-rwxr-xr-x | 3012/CH2/EX2.6/Ex2_6.sce | 42 |
6 files changed, 161 insertions, 0 deletions
diff --git a/3012/CH2/EX2.1/Ex2_1.sce b/3012/CH2/EX2.1/Ex2_1.sce new file mode 100755 index 000000000..40bfbcdb8 --- /dev/null +++ b/3012/CH2/EX2.1/Ex2_1.sce @@ -0,0 +1,37 @@ +// Given:- +p1 = 3*(10**5) // initial pressure of gas in pascal +v1 = 0.1 // initial volumme of gas in meter^3 +v2 = 0.2 // final volume of gas in meter^3 + +// calculations +// Part (a) i.e. n=1.5 +//constant = p1*(v1**n) // p*(v^n) = constant +constant1 = p1*(v1**1.5) +constant2 = p1*(v1**1) +constant3 = p1*(v1**0) +// function p +function v = p1(v) + v = constant1/(v^1.5) +endfunction + +function v = p2(v) + v = constant2/(v^1) +endfunction + +function v = p3(v) + v = constant3/(v^0) +endfunction + +work1 = intg(v1,v2,p1) // integrating pdv from initial to final volume +w1 = work1(1)/1000 // divided by 1000 to convert to KJ +printf( 'The work done for n=1.5 in KJ is %.2f',w1) + +//part(b) i.e. n = 1 +work2 = intg(v1,v2,p2) +w2 = work2(1)/1000 +printf( 'The work done for n=1 in KJ is %.2f',w2) + +//part(c) i.e. n=0 +work3 = intg(v1,v2,p3) +w3 = work3(1)/1000 +printf( 'The work done for n=0 in KJ is %.2f',w3) diff --git a/3012/CH2/EX2.2/Ex2_2.sce b/3012/CH2/EX2.2/Ex2_2.sce new file mode 100755 index 000000000..4915ec069 --- /dev/null +++ b/3012/CH2/EX2.2/Ex2_2.sce @@ -0,0 +1,23 @@ +// Given:- +p1 = 3*(10**5) // initial pressure in pascal +v1 = 0.1 // initial volume in m3 +v2 = 0.2 // final volume +m = 4.0 // mass of the gas in kg +deltau = -4.6 // change in specific internal energy in KJ/Kg + +// Calculations + +constant = p1*(v1**1.5) // p*(v^n) = constant + +function v = p(v) + v = constant/(v**1.5) // expressing pressure as function of volume +endfunction + +work = intg(v1,v2,p) // integrating pdv from initial to final volume +w=work(1)/1000 // divided by 1000 to convert to KJ + +deltaU = m*deltau // change in internal energy in KJ +Q = deltaU + w // neglecting kinetic and potential energy changes + +// Result +printf( 'net heat transfer for the process in KJ %.2f',Q) diff --git a/3012/CH2/EX2.3/Ex2_3.sce b/3012/CH2/EX2.3/Ex2_3.sce new file mode 100755 index 000000000..b338e7196 --- /dev/null +++ b/3012/CH2/EX2.3/Ex2_3.sce @@ -0,0 +1,32 @@ +// Given:- +clc; +patm = 10**5 // atmospheric pressure in pascal. +mp = 45.0 // mass of piston in Kg +A = 0.09 // face area of piston in m2 +deltaV = 0.045 // increment of the volume of air in m3 +m = 0.27 // mass of air in kg +deltau = 42.0 // specific internal energy increase of air in kJ/kg +g = 9.81 // local acceleration of gravity + + +// Part (a) i.e. air is system +// Calculations +p = (mp*g)/A + patm // constant pressure of air obtained from equilibrium of piston +w = (p*deltaV)/1000 // work done in KJ +deltaU = m*deltau // internal energy change of air in KJ +Q = w + deltaU // applying first with air as system +// Result +printf( '\nheat transfer from resistor to air in KJ for air alone as system is: %.2f',Q) + +// The answer given in book is incorrect. deltaU is incorrect in book. + +// Part(b) i.e. (air+piston) is system +// Calculations +wd = (patm*deltaV)/1000 // work done in KJ +deltaz = (deltaV)/A // change in elevation of piston +deltaPE = (mp*g*deltaz)/1000 // change in potential energy of piston in KJ +Qt = wd + deltaPE + deltaU // applying first law with air plus piston as system +// Result +printf( '\nheat transfer from resistor to air in KJ for air + piston as system is: %.2f',Qt) + +// note : The answer given in book is incorrect.They have miscalculated deltaU. diff --git a/3012/CH2/EX2.4/Ex2_4.sce b/3012/CH2/EX2.4/Ex2_4.sce new file mode 100755 index 000000000..2b7ea36c7 --- /dev/null +++ b/3012/CH2/EX2.4/Ex2_4.sce @@ -0,0 +1,15 @@ +// Given:- +w1dot = -60.0 // input work rate in KW +h = 0.171 // heat transfer coefficient,unit in KW/m2 .K +A = 1.0 // outer surface area of gearbox, unit in m2 +Tb = 300.0 // outer surface temperature in kelvin +Tf = 293.0 // temperature of the sorrounding + +// Calculations +Qdot = -h*A*(Tb-Tf); // rate of energy transfer by heat +wdot = Qdot; // steady state energy equation +w2dot = wdot-w1dot; + +// Results +printf( 'The heat transfer rate in KW is:\n\tQdot = %f',Qdot) +printf( 'The power delivered through output shaft in KW is: = %f',w2dot); diff --git a/3012/CH2/EX2.5/Ex2_5.sce b/3012/CH2/EX2.5/Ex2_5.sce new file mode 100755 index 000000000..e4eed3466 --- /dev/null +++ b/3012/CH2/EX2.5/Ex2_5.sce @@ -0,0 +1,12 @@ +// Given:- +s=5*(10**-3) // measurement on a side in meter +wdot = -0.225 // power input in watt +Tf = 293.0 // coolant temprature in kelvin +h = 150.0 // heat transfer coefficient in w/m2 k +A = s**2 // surface area + +// Calculation +Tb = ((-wdot/(h*A)) + Tf - 273) // surface temperature in degree + +// Result +printf( 'The surface temperature of the chip in degree celcius is: %f ',Tb); diff --git a/3012/CH2/EX2.6/Ex2_6.sce b/3012/CH2/EX2.6/Ex2_6.sce new file mode 100755 index 000000000..bc96d913a --- /dev/null +++ b/3012/CH2/EX2.6/Ex2_6.sce @@ -0,0 +1,42 @@ +// Given:- +omega = 100.0 //motor rotation speed in rad/s +tau = 18.0 //torque applied by shaft in N.m +Welecdot = -2.0 //electric power input in KW + +Wshaftdot = (tau*omega)/1000 //shaft work rate in KW +Wdot = Welecdot + Wshaftdot //net work rate in KW + +//function [Qdot]=f(t) +//Qdot = (-0.2)* [1-2**(-0.05*t)] + + +//function [Edot]=f1(t) //function for rate of change of energy +//Edot = (-0.2)*[1-2**(-0.05*t)] - Wdot + +//function [deltaE] =f2(t) //function for change in energy + +t = linspace(0,120,100); +for i = 1:100 + Qd(i) = i + Wd(i) = i + dltaE(i) = i + Qd(i) = (-0.2*(1-%e^(-0.05*t(i)))) + Wd(i) = Wdot + dltaE(i) = 4*(1 - %e^(-0.05*t(i))) +end + +subplot(2,2,1) +plot(t,Qd) +xlabel("Time (s)") +ylabel("Qdot (KW)") + +subplot(2,2,2) +plot(t,Wd) +xlabel("Time (s)") +ylabel("Wdot (KW)") + +subplot(2,2,3) +plot(t,dltaE) +xlabel("Time (s)") +ylabel("deltaE (KJ)") + |