Wednesday, July 28, 2021

Roots Finding: Open Methods

Problem 6.14.

In a chemical engineering process, water vapor (H2O) is heated to sufficiently high temperatures that a significant portion of water dissociates, or splits apart, to form oxygen and hydrogen:

H2O⇆H2+1/2O2 

If it is assumed that this is the only reaction involved, the mole fraction x of H2O that dissociates can be represented by

 Eq.(6.14(a))

where K is the reaction's equilibrium constant and pt is the total pressure of the mixture. If pt = 3 atm and K = 0.05, determine the value of x that satisfies Eq.(6.14(a)).

Solution:


Firstly, rearrange and substitute the value of pt and K to form a single function in terms of x. 
Therefore, the solution x can be obtained by finding the root of the function. We can use any open-root locating method to solve for x. Before that, we can check the root location by using graphical method. 

Graphical method:
>> x = linspace(0,0.1);
>> fx = x./(1-x).*sqrt(6./(2+x))-0.05;
>> plot(x,fx),grid,xlabel('x'),ylabel('f(x)')
From the graph, the root lies between 0.02 and 0.03. The root estimate is roughly about 0.028

Fixed-point iteration:
Fixed-point iteration can be applied by using an initial guess of x0 = 0.02 and stopping criterion of 0.01%. Thus, rearrange the equation:
Starting with an initial guess of x0 = 0.02, the above iterative equation can be applied to compute:
Hence, after four iterations, the root estimate (x) is 0.02825

We can also use MATLAB fzero function to find the root. 
>> format long
>> fx =@(x) x./(1-x).*sqrt(6./(2+x))-0.05;
>> x = fzero(fx,0.02)

x =

   0.028249441148471

No comments:

Post a Comment

Numerical Integration Formulas

Here are the M-files to implement composite trapezoidal rule for equally spaced data and unequally spaced data.  Composite Trapezoidal Rule ...