0% found this document useful (0 votes)
20 views2 pages

Proplib

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views2 pages

Proplib

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

function prop = proplib(property,prop1,value1,prop2,value2)

assign = struct(prop1,value1,prop2,value2);

if isfield(assign, 'X')==true
X = assign.X;

end

x_p = X*100;

if isfield(assign, 'p')==true
p = assign.p;
T = findTgivenp(X,p);
end

if isfield(assign, 'T')==true
T = assign.T;
end

if isfield(assign, 'h')==true
h = assign.h;
T = findT(X,h);
end

if isfield(assign, 'X')==false
X = findX(p,T);
elseif isfield(assign, 'p')==false
p =findp(T, X);
end

if strcmp(property,'p')==true
prop = p;
end

% Coeffecient definition

A = [5.506219979E+3 5.213228937E+2 7.774930356 -4.575233382E-2 -5.792935726E+2];


B = [1.452749674E+2 -4.984840771E-1 8.836919180E-2 -4.870995781E-4 -2.905161205];
C = [2.648364473E-2 -2.311041091E-3 7.559736620E-6 -3.763934193E-8 1.176240649E-3];
D = [-8.526516950E-6 1.320154794E-6 2.791995438E-11 0 -8.511514931E-7];
E = [-3.840447174E-11 2.625469387E-11];
F = [-5.159906276E+1 1.114573398];
L = [-2.183429482E+3 -1.266985094E+2 -2.364551372 1.389414858E-2 1.583405426E+2];
M = [-2.267095847E+1 2.983764494E-1 -1.259393234E-2 6.849632068E-5 2.767986853E-1];
V = [1.176741611E-3 -1.002511661E-5 -1.695735875E-8 -1.497186905E-6 2.538176345E-8
5.815811591E-11 3.057997846E-9 -5.129589007E-11];
T0 = 220;

line1 = A(1)+A(2)*x_p+A(3)*x_p^2+A(4)*x_p^3+A(5)*x_p^1.1;
line2 = (T^2)*(C(1)+C(2)*x_p+C(3)*x_p^2+C(4)*x_p^3+C(5)*x_p^1.1);
line3 = (2*T^3)*(D(1)+x_p*D(2)+x_p^2*D(3)+x_p^1.1*D(5));
line4_1 = (3*T^4)*(E(1)+E(2)*x_p);
line4_2 = (F(1)+F(2)*x_p)*((1./(T-T0))+(T./((T-T0)^2)));
line5 = p*(V(1)+x_p*V(2)+x_p^2*V(3)-T^2*V(7)-x_p*T^2*V(8));
line6 = (log(T)-1)*(L(1)+L(2)*x_p+L(3)*x_p^2+L(4)*x_p^3+L(5)*x_p^1.1);
line7 = T*(M(1)+M(2)*x_p+M(3)*x_p^2+M(4)*x_p^3+M(5)*x_p^1.1);

h = line1-line2-line3-line4_1+line4_2+line5+line6-line7;

if strcmp(property,'h')==true
prop = h;
end

linee1 = B(1)+B(2)*x_p+B(3)*x_p^2+B(4)*x_p^3+B(5)*x_p^1.1;
linee2 = (2*T)*(C(1)+C(2)*x_p+C(3)*x_p^2+C(4)*x_p^3+C(5)*x_p^1.1);
linee3 = (3*T^2)*(D(1)+x_p*D(2)+x_p^2*D(3)+x_p^1.1*D(5));
linee4_1 = (4*T^3)*(E(1)+E(2)*x_p);
linee4_2 = (F(1)+F(2)*x_p)*((1./((T-T0)^2)));
linee5 = p*(V(4)+x_p*V(5)+x_p^2*V(5)+2*T*V(7)-2*x_p*T*V(8));
linee6 = (1./T)*(L(1)+L(2)*x_p+L(3)*x_p^2+L(4)*x_p^3+L(5)*x_p^1.1);
linee7 = (log(T)+1)*(M(1)+M(2)*x_p+M(3)*x_p^2+M(4)*x_p^3+M(5)*x_p^1.1);

s = -linee1-linee2-linee3-linee4_1+linee4_2-linee5-linee6-linee7;
v = V(1)+V(2)*x_p+(V(3)*x_p^2)+(V(4)*T)+(V(5)*x_p*T)+(V(6)*(x_p^2)*T)+(V(7)*T^2)+
(V(8)*x_p*T^2);

if strcmp(property, 's')==true
prop = s;
end

if strcmp(property, 'p');
prop = p;
end

if strcmp(property, 'v')==true
prop = v;
end
if strcmp(property, 'T')==true
prop = T;
end
if strcmp(property, 'X')==true
prop = X;
end
if strcmp(property, 'T')==true
prop = T;
end
end

You might also like