Question
Needed ASAP
A Matlab solution is required
please screenshot solution
The following equation is available for the saturation pressure of air as a function of temperature: In (psat/Pc) = C1 x + C2
0 0
Add a comment Improve this question Transcribed image text
Answer #1

21.5 th can find a gC. & 3. Given ear. Tsat To where ㅗ Toat i Pc = 3.77 MPa To= 182.5k Psath Let Itsat Pc Y z = Cat Gn²+ GY (2 c, Zχ + C, Ση+ , ΣΥ - ΣΖ € Σ2 - C, Σ 4. Cα ΣπYς ΣκZ c, Ση + C, Σ + C3 Σκγ = Ση? 2 Σχ Zn² o EY ΣκY Σ7 3 Ση? Σχ Z RZ G2 Ση3Standard enor of estimate se I n-2 Woll [ V: - (a+b+;)] given value fitted value Co-relation coefficient, 8= n-1 (48-5) (9:-5

MATLAB CODE FOR regression fit

leastSqRegression.m

clc;
%MALAB CODE for finding least square regression
% data given Tsat and Psat
T=[76.5 80.4 83.3 85.7 88.1 90.2 92 93.6 95.1 96.5 98.9 101 ...
103 106.3 109.2 111.8 114.2 116.4 118.4 122.9 127];
P=[0.08 0.12 0.16 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.6 ...
0.7 0.8 1 1.2 1.4 1.6 1.8 2 2.5 3];
% Constant values Critical Pressure and Critical Temperature
Pc=3.77;
Tc=132.5;
%define x
x=(1/Tc)-(1./T);
%define Y as ln(Tsat/Tc)
Y=log(T/Tc);
%define Z as ln(Psat/Pc)
Z=log(P/Pc);

% Coefficient Matrix A
A=[sum(x) sum(x.^2) sum(Y);sum(x.^2) sum(x.^3) sum(x.*Y);sum(x.^3) sum(x.^4) sum(x.^2.*Y) ];
B=[sum(Z);sum(x.*Z);sum(x.^2.*Z) ];
phi=A\B;
c1=phi(1);
fprintf('Value of C1 is = %f ',c1);
c2=phi(2);
fprintf('\nValue of C2 is = %f ',c2);
c3=phi(3);
fprintf('\nValue of C3 is = %f ',c3);

% Standard error of estimation
x_1=(1/Tc)-(1./T);
Z_new=c1*x_1+c2*x_1.^2+c3*log(T/Tc);
P_Cal=exp(Z_new)*Pc;
n=length(T);
Se=sqrt(sum((P-P_Cal).^2)/(n-2));
fprintf('\nStandard error of estimate = %f ',Se);

%Corelation coefficient
A=sum((T-mean(T)).*(P_Cal-mean(P_Cal)))/(n-1);
r=A/(std(T)*std(P_Cal));
fprintf('\nCorelation Coeficient = %f ',r);

% Coefficient of Determination
Coe_det=r^2;
fprintf('\nCoeficient of Determination = %f ',Coe_det);
plot(T,P,'dr'); hold on

T_finer=76.5:0.1:127;
x_1=(1/Tc)-(1./T_finer);
Z_new=c1*x_1+c2*x_1.^2+c3*log(T_finer/Tc);
P_finer=exp(Z_new)*Pc;
plot(T_finer,P_finer,'-b','LineWidth',1.5);
legend('Data Points','Regression Fit');
xlabel('Tsat (K)');
ylabel('Psat (MPa)');
title('Psat vs Tsat');

Psat vs Tsat 3.5 Data Points Regression Fit 3 F 2.5 Psat (MPa) 1 0.5 70 80 90 110 120 130 100 Tsat (K)MATLAB R2015a HOME PLOTS APPS EDITOR PUBLISH VIEW EDIT RUN 38 II - Find Files Insert fx Fli Run Section Compare Go To Comment

Add a comment
Know the answer?
Add Answer to:
Needed ASAP A Matlab solution is required please screenshot solution The following equation is available for...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • screenshot MATlab code please The following equation is available for the saturation pressure of air as...

    screenshot MATlab code please The following equation is available for the saturation pressure of air as a function of temperature: In (psat/Pc) = C1 x + C2 x? + C3 In (Tsat/Tc), where x = 1/Tc - 1/Tsat Pc =3.77 MPa is the critical pressure, and Tc = 132.5 K is the critical temperature. The following data are available for the saturation pressure of air as a function of temperature: Tsat (K) psat (MPa) Taat (K) paat (MPa) 76.5 80.4...

  • please screenshot the MATlab code if possible Need ASAP it is for a course that uses...

    please screenshot the MATlab code if possible Need ASAP it is for a course that uses MATlab to solve for missing variables and such. The following equation is available for the saturation pressure of air as a function of temperature: In (psat/Pc) = C1 x + C2 x2 + C3 In (Tsat/Tc), where x = 1/Tc - 1/Tsat Pc =3.77 MPa is the critical pressure, and Tc = 132.5 K is the critical temperature. The following data are available for...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT