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



NOTE: IN THIS MATLAB PROGRAMMING EXERCISE, WRITE THE PROGRAM FIRST BY HAND, ON PAPER. THEN KEY...
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 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 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 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 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....