Home /
Expert Answers /
Computer Science /
hw7p4-18-points-the-redlich-kwong-equation-to-find-the-pressure-of-a-gas-is-as-follows-where-p-i-pa523
(Solved):
HW7P4 (18 points) The Redlich-Kwong equation to find the pressure of a gas is as follows where P i ...
HW7P4 (18 points) The Redlich-Kwong equation to find the pressure of a gas is as follows where P is the pressure [bar], n is the amount of gas [kmol], Ru?=0.08314 kmbi K2harr?m3?V is volume [m3 ], and T is the temperature [K]. The constants c and d for air are 15.989 and 0.02541 , respectively. P=nV??dRu?T??nV?(nV?+d)T21?c? The temperature can be determined from the equation as T=Ru?P(nV??d)?+nV?(nV?+d)T21?Rs?c?(nV??d)? Since T cannot be isolated, the temperature can, instead, be iteratively determined using the following fixed-point iteration algorithm. Select an initial guess for the temperature, T1?=300(N=1) Update the guess for temperature as (N=2)T2?=Ru?P(nV??d)?+nV?(nV?+d)T121??Ru?c?(nV??d)? While ?Ti?Ti+1??Ti???>10?10 and N<50 Update the guess for temperature as Ti+1?=Ru?P(nV??d)?+nV?(nV?+d)Ti21??Rn?c?(nV??d)? Write a function file [T,N]= Redlich_Kwong (P,v,n) - Input arguments: the pressure, P, volume, V, and amount of gas, n as scalars with corresponding units. - Output arguments: the estimated temperature, T, and the number of guesses/iterations, N, it took to estimate the temperature starting at 1.