Professional Documents
Culture Documents
(return)
(end)
function total_eff=eff(x,y,z)
x=input('Boiler efficiency in fraction');
y=input('turbine efficiency in fraction');
z=input('generator efficiency in fraction');
total_eff=x*y*z;
end
function Efficiency=ottocycle(d,S,VC)
% d is bore diameter ENTER IN mm
% S is stroke ENTER IN mm
%VC is clearance volume ENTER IN mm3
VS=(pi*d^2*S/4)*(1/1000) ;% conversion to cm
disp(VS);
r=(VC+VS)/VC; % no difference in unit as units are
same
disp(r);
efficiency=(1- (1/(r^0.4)))*100;
end
2. Steam is flowing at the rate of 2000 kg/h in a 3 NB, 40 schedule pipe at 440
kPa absolute and 453 K. Calculate the velocity of the steam in the pipeline
3. Corrosion rate are normally reported in miles per year (mpy) in the chemical
process industry. For the measurement of the rate, a corrosion test coupon is
inserted in the process stream for a definite period. The loss of weight is
measured during the period of insertion. In a particular test, a coupon of
carbon steel was kept in a cooling water circuit. The dimensions of the coupon
were measured to be 7.5 cm × 1.3 cm × 0.15 cm. Weight of the coupon before
insertion in the circuit and after exposure for 50 days were measured to be 15
g and 14.6 g respectively. Calculate the rate of corrosion. Take the density of
the carbon steel = 7.754 g/cm3. Note: 1 mpy = 0.001 in per year. [Ans. 5.3
mpy].
a= 1.3;
b = .2;
clear abc
c = 30; x = 1;
parabola = @(x) a*x.^2 + b*x + c; y = parabola(x)
Solution
clear;
clc;
t=0:0.1:10*pi;
x=t;
y=t.*cos(t);
z=exp(0.2*t);
plot3(x,y,z)
title('Plot 3 Dimensional figure');
xlabel('x axis');
ylabel('y axis');
zlabel('z axis');
grid on
x=0:0.1:2;
y=exp(-x)*sin(x);
stem(x,y);
bar(x,y);
title(‘stem and bar Plot’);
xaxis(‘x coordinate’)
yaxis(‘function’);
t = datetime(2014,6,28) +calweeks(0:9);
y = rand(1,10);
plot(t,y);
t = datetime('today') + caldays(1:100);
y = linspace(10,40,100) + 10*rand(1,100);
scatter(t,y)
contour(Z) draws a contour plot of matrix Z in the x-y plane, with the x-coordinates of the vertices corresponding
to column indices of Z and the y-coordinates corresponding to row indices of Z. The
contour levels are chosen automatically.
x = -2:0.2:2;
y = -2:0.2:3;
[X,Y] = meshgrid(x,y);
Z = X.*exp(-X.^2-Y.^2); f
figure
contour(X,Y,Z,'ShowText','on')