Question

NOTE: IN THIS MATLAB PROGRAMMING EXERCISE, WRITE THE PROGRAM FIRST BY HAND, ON PAPER. THEN KEY YOUR PROGRAM INTO MATLAB, AND RUN IT TO PRODUCE OUTPUT. WORK FOR THIS EXERCISE WILL CONSIST OF YOUR HANDWRITTEN PROGRAM AND A SCREENSHOT OF YOUR PROGRAM IN MATLAB AS WELL AS THE OUTPUT YOUR PROGRAM PRODUCES MATLAB PROGRAMMING EXERCISE 8 (From physical chemistry; 4 pts.) Using the Redlich-Kwong equation of state for a real gas, we can calculate the work produced by that gas when the gas undergoes a reversible, isothermal expansion at temperature T, from initial molar volume Vi to final molar volume V2. That expression for reversible, isothermal work is: work-_RTIn where: R 0.082057; V1 = 0.5; V2 = 1.0; Calculate the work produced by each of the following gases, at T 693: GAS WORK PRODUCED Neon 1.4439 0.012049 Methane 31.784 0.029850 Carbon Dioxide 63.752 0.029677 Ammonia 86.660 0.026232

0 0
Add a comment Improve this question Transcribed image text
Answer #1

If you like the code, give it a thumbs up. Incase you need any clarifications let me know in comments.

Code starts below this line

%Initialize constants
R=0.082057;
V1=0.5;
V2=1.0;
T=693;

%Create vector for Gas, A and B values
Gas={'Neon','Methane','Carbon dioxide','Ammonia'};
A=[1.4439, 31.784, 63.752, 86.660];
B=[0.012049, 0.029850, 0.029677, 0.026232];

%Caculate work for each of the possible combinations
for i=1:length(A)
work(i)=-R*T*log((V2-B(i))/(V1-B(i)))-((A(i)/(B(i)*sqrt(T)))*log(((V2+B(i))*V1)/((V1+B(i))*V2)));
end

%Display the output where last bracket contains the work produced values
fprintf('Gas \t\t\t A \t\t B \t\t Work Produced\n');
for i=1:length(A)
fprintf('%s \t %f \t %f \t %f\n',cell2mat(Gas(i)),A(i),B(i),work(i));
end

Add a comment
Know the answer?
Add Answer to:
NOTE: IN THIS MATLAB PROGRAMMING EXERCISE, WRITE THE PROGRAM FIRST BY HAND, ON PAPER. THEN KEY...
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
  • ICEOZA: Solving an couation using MATLAB - (isine Vester inputs) Using the Van der Waals equation...

    ICEOZA: Solving an couation using MATLAB - (isine Vester inputs) Using the Van der Waals equation of state for a real gas, we can calculate the work produced by a quantity of gas when that gas undergoes a reversible, isothermal expansion at temperature T. from initial volume V, to final volume V. That expression for reversible, isothermal work is as follows: work = ==RTI ( - ) ** ( ) where: R 0.082057; V, -1.25 V - 3.0; n10: T-800:10:...

  • 1. The Redlich-Kwong equation of state is given by P=_RT___ A _ _ V-RI2,, - 0.0866 - where 4-0.42748RT - B - P (The R-K...

    1. The Redlich-Kwong equation of state is given by P=_RT___ A _ _ V-RI2,, - 0.0866 - where 4-0.42748RT - B - P (The R-K constants can be calculated from the critical temperature and pressure of the gas.) This EOS was introduced in 1949 and is adequate for calculations of gas phase properties when P, </2 T, a) Derive an expression for the work associated with an isothermal reversible volume change of a R-K gas between two volumes V, and...

  • Need help with this Matlab program %% Exercise 1 % NOTE: Please suppress output--i.e., use a...

    Need help with this Matlab program %% Exercise 1 % NOTE: Please suppress output--i.e., use a semicolon ';' at the end of any % commands for which the output is not necessary to answer the question. % Delete these notes before turning in. % Define input variable theta as discretized row vector (i.e., array). theta = ??; % Define radius. r = ??; % Define x and y in terms of theta and r. x = ??; y = ??;...

  • Nay programming languge is fine (MatLab, Octave, etc.) This is the whole document this last picture...

    Nay programming languge is fine (MatLab, Octave, etc.) This is the whole document this last picture i sent is the first page 5. Write and save a function Sphere Area that accepts Radius as input argument, and returns SurfaceArea (4 tt r) as output argument. Paste the function code below. Paste code here 6. Validate your Sphere Area function from the command line, checking the results against hand calculations. Paste the command line code and results below. 7. Design an...

  • Using C programming language Question 1 a) through m) Exercise #1: Write a C program that...

    Using C programming language Question 1 a) through m) Exercise #1: Write a C program that contains the following steps (make sure all variables are int). Read carefully each step as they are not only programming steps but also learning topics that explain how functions in C really work. a. Ask the user for a number between 10 and 99. Write an input validation loop to make sure it is within the prescribed range and ask again if not. b....

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