Sei sulla pagina 1di 11

APPLICATION OF SIMPLE FIXED-POINT ITERATION METHOD IN REDLICH-KWONG

EQUATION OF STATE USING MATLAB®

In Partial Fulfilment of the Requirements for the Course

Advanced Engineering Mathematics for Chemical Engineering

Submitted By:

MAMBA, RHEA D.

Submitted To:

ENGR. CAESAR P. LLAPITAN

MAY 2017
Table of Contents
Abstract

I. Introduction .................................................................................................................. 1
II. Theoretical Background ............................................................................................ 1-3
III. Numerical Analysis in MATLAB® ..........................................................................3-5
A. General Algorithm ............................................................................................ 3
B. General Flowchart ............................................................................................ 4
C. General M-file .................................................................................................. 5
IV. Case Analysis ............................................................................................................5-8
A. Model Formulation ........................................................................................... 5
B. Algorithm ......................................................................................................... 5
C. Flowchart .......................................................................................................... 6
D. M-file ................................................................................................................ 7
E. Output ............................................................................................................... 8
V. Conclusion .................................................................................................................... 9
VI. References ................................................................................................................... 9
APPLICATION OF SIMPLE FIXED-POINT ITERATION METHOD IN REDLICH-KWONG
EQUATION OF STATE USING MATLAB®

Abstract: The applicability of finding roots can be employed in solving different equations of
state problems. Simple fixed-point iteration method is used in finding the root of a Redlich-
Kwong equation of state using the computer application MATBAL® and gives an output of
0.0028 m3/kg with a true percent relative error of 0.0029%.

I. Introduction
Many problems in engineering and science require the solution of nonlinear
equations. In thermodynamics, the pressure-volume-temperature relationship of real gases is
described by the equations of state such as the Redlich-Kwong equation of state. The
Redlich-Kwong is a cubic equation of state based on the van der Waals equation. It can be
applied to mixtures by using mixing rules to the equation of state parameters. It improved the
Van der Waals equation with a better description of the attractive term. Redlich and Kwong
introduced an adjustment to the van der Waal’s attractive pressure term which improved the
prediction the prediction vapour phase physical properties. The Redlich-Kwong equation is
relatively simple and can predict component or mixture behaviour based on little data. Its
limitation is that it cannot be used liquid-liquid and vapour liquid equilibrium prediction but
gases only.
Simple fixed-point iteration method is used to solve for a Redlich-Kwong equation of
state problem. This method belongs to the iterative method under the open method. An initial
estimate for the solution is assumed and the initial guess should be as close to the actual
solution

II. Theoretical Background


Open methods require only a single starting value or two starting values that do not
necessarily bracket the root. As such, they sometimes diverge or move away from the true
root as the computation progresses. However, when the open methods converge they usually
do so much more quickly than the bracketing methods. We will begin our discussion of open
techniques with a simple approach that is useful for illustrating their general form.

1
Iteration method, also known as the fixed point iteration method, is one of the most
popular approaches to find the real roots of a nonlinear function. It requires just one initial
guess and has a fast rate of convergence which is linear.
Open methods are used to employ a formula to predict the root. Such a formula can be
developed for simple fixed-point iteration by rearranging the function f ( x )  0 so that x is on
the left-hand side of the equation:
x  g(x ) (1A.1)
This transformation can be accomplished either by algebraic manipulation or by simply
adding x to both sides of the original equation. The utility of Eq. 1A.1 is that it provides a
formula to predict a new value of x as a function of an old value of x. Thus, given an initial

guess at the root xi , Eq. 1A.1 can be used to compute a new estimate xi 1 as expressed by
the iterative formula:
x i 1  g(x i ) (1A.2)
As with many other iterative formulas, the approximate error for this equation can be
determined using the error estimator:
x i 1  x i
a   100%
x i 1
(1A.3)
Introduced in 1949 the Redlich–Kwong equation of state was a considerable
improvement over other equations of the time. It is still of interest primarily due to its
relatively simple form. While superior to the van der Waals equation of state, it performs
poorly with respect to the liquid phase and thus cannot be used for accurately calculating
vapor-liquid equilibria. However, it can be used in conjunction with separate liquid-phase
correlations for this purpose.
The Redlich-Kwong equation is commonly considered the best of two-parameter
equations of state proposed until now. Redlich–Kwong equation is adequate for calculation of
gas phase properties when the ratio of the pressure to the critical pressure (reduced pressure)
is less than about one-half of the ratio of the temperature to the critical temperature (reduced
temperature). The Redlich-Kwong equation of state is given by the equation
RT a
p  (2A.1)
  b    b  T

2
where:
R = the universal gas constant [ 0.518 kJ (kg K )]
T = absolute temperature (K)

p = absolute pressure (kPa)

 = the volume of a kg of gas (m3/kg).


wherein the constant a and b can be calculated using the formulas
R 2TC2.5
a  0.427 (2A.2)
pC
TC
b  0.0866R (2A.3)
pC
where:
TC = temperature at the critical point, and

PC = pressure at the critical point

III. Numerical Analysis Using MATLAB®


A. General Algorithm:
Step 1.Start
Step 2. Input x(1), n and other given parameters.
*Where, x(1) is the value of initial guess while n is the number of iterations *

Step 3. Compute x  n  1

Step 4. Display a and the root x(n)


Step 5. Stop.

3
B. General Flowchart:

Defines the beginning of the


START program.

Preparation of memory space


n=0 for data processing. It also
x(1) = 0 represents the instructions that
x(n) = 0 will modify the program’s
course execution.

Input x(1), n and other Inputting all the given


parameters and the stopping
parameters
criteria.

The general arithmetic


x(n+1) = f(x(n)) operations of single-fixed point
iteration where f xn  is the
manipulated given function.

Print the n and x(n)


as the solution Display the output.

Defines the end of the


STOP program.

Figure 1.0-General flowchart for Simple Fixed-Point Iteration

4
C. General M-file:
M-file 1A: FixedPtIterMfile.m
%% Matlab m-file for Fixed-Point Iteration %%
%% To find the root of a given function in [0,1] %%
%% Matlab's default is 4 digits after the decimal %%
format short;
%% set initial guess - Matlab requires indices to start at 1 %%
x(1) = 3.5;
for n = 1:3

x(n+1) = %"Enter function"


disp ( ' n x(n+1) ' );
disp ( [ n x(n) ] );
x(n) =(x(n+1));
end

IV. Case Analysis


In this study, simple fixed-point iteration method is used in the Redlich-Kwong
equation of state to determine υ and the mass of methane, a hydrocarbon, contained in a 3-m3
tank. Given are the parameters T = −40oC and p = 65,000 kPa.

A. Model Formulation
The Redlich-Kwong equation of state is given by
RT a
p 
  b    b  T
where:
R = the universal gas constant [ 0.518 kJ (kg K )]
T = absolute temperature (K)

p = absolute pressure (kPa)

 = the volume of a kg of gas (m3/kg).


The parameters a and b are calculated by
R 2TC2.5
a  0.427
pC

TC
b  0.0866 R
pC
Therefore solving for  gives the equation

5
RT a (v  b)
  1/ 2 b
P T ( (  b))  P
B. Algorithm:
Step 1.Start
Step 2. Input x(1), n and other given parameters (P, T, R, Tc, Pc, a, b)
*Where, x(1) is the value of initial guess while n is the number of iterations *
2.5
R 2TC TC
Step 3. Compute a  0.427 and b  0.0866 R
PC PC

Step 4. Compute x  n  1

Step 5. Display a and the root x(n)


Step 6. Stop.

C. Flowchart:
Defines the beginning of the
START program.

Preparation of memory space


n=0 P=0
x(1) = 0 T=0 for data processing. It also
x(n) = 0 Tc = 0 represents the instructions that
Pc = 0 will modify the program’s
course execution.

Inputting all the given


Input x(1), n and other
parameters parameters and the stopping
criteria.

a = 0.427*R2TC2.5/pc
The general equation for
b = 0.0866R*TC/pC solving a and b for Redlich-
Kwong equation of state
The general arithmetic
x(n+1) = f(x(n)) operations of single-fixed point
iteration where f xn  is the
manipulated given function.
Print the n and x(n)
as the solution
Display the output.

STOP Defines the end of the


program.

Figure 2.0-Flowchart for the given problem

6
D. M-File:
M-file 2A: FixedIter.m
%% Matlab m-file for Fixed-Point Iteration %%
% This program solves the problem posed in Problem 6.16
% It calculates the real gas specific volume from the
% Redlich-Kwong equation of state using the simple fixed-point
% for calculating the roots of a polynomial.
format short;
clear
clc
clf
%Input data
P = input(' Input pressure (kPa) = ');
T = input(' Input temperature (K) = ');
Pc = input(' Critical pressure (kPa) = ');
Tc = input(' Critical temperature (K) = ');
R = 0.518; % Gas constant (kJ/kg.K)
% Constants of Redlich-Kwong equation of state
a = 0.427 * ((R^2 * Tc^2.5 )/ Pc);
b = 0.0866 * (R * Tc / Pc);
x(1) = 0.003;
for n = 1:4
x(n+1) = (R*T/P)-((a*(x(n)-b))/T^0.5*x(n)*(x(n)+b)*P)+b;
disp ( ' n x(n+1) ' );
disp ( [ n x(n) ] );
x(n) =(x(n+1));
end

7
E. Output:

Figure 3.0-Problem output using MATLAB®

The above figure (Figure 3.0) shows the output of the given program. It can be seen
that after 2nd iteration the same value with 1st iteration was obtain, therefore the root is
0.0028. The true relative error can be calculated by

xcalculated  xtheoretical
t   100
xcalculated

0.0028  0.00280840865703
t  100
0.00280840865703

 t  0.0029%

Applying this output in solving the mass of methane gives

V
m

3
m
0.0028

m  1071.43 kg

8
V. Conclusion
Using the simple fixed-point method, after the third iteration, a value of 0.0028 is
calculated with a true percent relative error of 0.0029%. The obtained mass of the tank is
1071.43 kg. As compared to the different methods used in finding the roots, the simple-fixed
point iteration method gives a little difference in percentage error. It can be assumed that
simple fixed-point iteration method is more efficient but sometimes does not yield the
solution.

VI. References
Chapra, S. C. (2012). Applied Numerical Methods with MATLAB® for Engineers and
Scientists. In Open Methods (Third ed., pp. 151-181). McGraw-Hill Companies,Inc.
Chapra, S. C. (2012). Applied Numerical Methods with MATLAB® for Engineers and
Scientists. In Bracketing Method (Third ed., pp. 126-150). McGraw-Hill Companies, Inc.
Chapra, S. C. (2012). Applied Numerical Methods with MATLAB® for Engineers and
Scientists. In Roots and Optimization (Third ed., pp. 123-125). McGraw-Hill Companies, Inc.
Kreysig, E. (2011). Avanced Engineering Mathematics. In Solutions of Equations by
Iteration (Tenth ed., pp. 798-807). RR Donnelley and Sons Company.
Steven C. Chapra and Raymond Canale. (2002). Numerical Methods for Engineers. McGraw-
Hill Companies, Inc.

Potrebbero piacerti anche