Proplib
Proplib
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
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