Professional Documents
Culture Documents
Soru 1a
Soru 1a
clc
% Input data
P = input(' Input the vector of pressure range (Pa) = ');
T = input(' Input temperature (K) = ');
R = 8314; % Gas constant (J/kmol.K)
Tc = input(' Critical temperature (K) = ');
Pc = input(' Critical pressure (Pa) = ');
omega = input(' Acentric factor = ');
for k = 1:length(P)
% Defining the polynomial coefficients
coef = [1, -1, A(k)-B(k)-B(k)^2, -A(k)*B(k)];
v0(k) = R * T / P(k); % Ideal gas specific volume
vol(k) = NRpoly(coef , 1) * R * T / P(k); % Finding the
root
end