Documente Academic
Documente Profesional
Documente Cultură
Assignment # 01
Submitted To:
Dr. Riaz A Mufti
Submitted By:
Imran Sajid Shahid Ghumman
(From HITEC University)
Date:
29/02/2015
Question#1
Given Data:
Unknown:
20=?
Solution:
U=253.89; VI=92;
G = solve(
0.8353*Y^2 + 14.67*Y - 216 -L == 0,...
0.1684*Y^2 + 11.85*Y - 97 -H == 0,...
(100*L-100*U)/(L-H) == VI,L,H,Y);
H_g=eval(G.H(1)); L_g=eval(G.L(1)); Y_g=eval(G.Y(1));
VI_i = ((G.L(1)-U)/(G.L(1)-G.H(1)))*100;
VI_i=eval(VI_i);
Error_Sq=(VI-VI_i)^2;
visc_ref100 = Y;
visc_ref40_VI0 = L;
visc_ref40_VI100 = H;
visc_ref40_VI92 = U;
% slope of oil to be investigated; m = y2-y1 / x2-x1
m = (Y_g-U) / (100-40);
% Extrapolate to find viscosity at 20deg C
visc20 = U-(m*(40-20));
% Plotting
X=[100,40,100,40,100,40,20];
Y=[Y_g,L_g,Y_g,H_g,Y_g,U,visc20];
X40=[40,40];
Y40=[0,L_g+200]
plot(X(1:2),Y(1:2)); hold on;plot(X(3:4),Y(3:4)); hold on;
plot(X(5:6),Y(5:6)); hold on;plot(X(6:7),Y(6:7)); hold on;
plot(X40,Y40); hold on;
fprintf('Viscosity of
= U = %f \n',VI,U)
fprintf('Viscosity of
\n',L_g)
fprintf('Viscosity of
\n',H_g)
fprintf('Viscosity of
\n',Y_g)
fprintf('Error squred
\n',VI,Error_Sq)
fprintf('Viscosity of
\n',visc20)
= L = %f
= Y = %f
in VI(%d) value is %d
Oil being considered at 20degC %f
= L = 481.497561
= Y = 21.420333