project for numerical methods

profilemalak22
TermProject-20183.pptx

Exam-1 Solution and Comments

Your class ID is used for sorting only, your grades are entered under

your name, not class ID.

If grade is assigned today, more than 90 students will get an A.

Request for regrading Exam-1 must be submitted with a memo before

18:00 pm on March 19, 2018.

After Exam-1 Feedbacks

In-class feedback right now (15 minutes).

Term Projects

1a 1b 1c 1d 1e 2a 2b 2c 3 E-1 Total
Average 0.9 1 1.9 1.7 1 1 2.7 2.3 5.4 17.6 24.4
87.9% 87.3%

After Exam-1 Feedbacks

What most helps you learn in this class? Why?

What least helps you learn in this class and why? What changes would you suggest as a result?

What are you doing that most helps you learn in this class? What could you do differently to learn more?

 Overall, I give this class the grade of (A, B, C, D, or F)

 

Overall, I give my own effort in this class the grade of (A, B, C, D, or F)

 

On average, I spend minutes per class preparing for this class.

Aniline is being removed from water by solvent extraction using toluene. Aqueous and organic phases will form after adding the organic solvent into the water phase. The extraction is carried out in a 10-stage countercurrent tower, shown in the following figure. The equilibrium relationship valid at each stage is, to a first approximation:

where:

Yi = (lb of aniline in the toluene phase)/(lb of toluene in the toluene phase)

Xi = (lb of aniline in the water phase)/(lb of water in the water phase)

(a) The solution to this problem is a set of 10 simultaneous equations. Derive these equations from material balances around each stage. Present these equations using compact notation. (15%)

(b) Solve the above set of equations to find the concentration in both the aqueous and organic phases leaving each stage of the system (Xi and Yi). (25%)

(c) If the slope of the equilibrium relationship is replaced by the expression m = 8 +20 Xi, the solution becomes a set of simultaneous nonlinear equations. Describe a procedure which would solve this problem. (15%)

(d) Solve the problem described in (c) above. (25%)

(e) Prepare a report to summarize the mathematical modeling and numerical solution procedures. Make sure to attach all MATLAB or excel codes used in this project. (20%)

Aniline is an organic compound with the formula C6H5NH2. Consisting of a phenyl group attached to an amino group, aniline is the prototypical aromatic amine. Its main use is in the manufacture of precursors to polyurethane and other industrial chemicals. Like most volatile amines, it has the odor of rotten fish. Aniline is toxic by inhalation of the vapor, ingestion, or percutaneous absorption. It is listed as Group 3 pollutant (not classifiable as to its carcinogenicity to humans) due to the limited and contradictory data available.

Mass balance at the feed stage:

Feed Stage (stage f)

W, Xf-1

F, YF

W, Xf

S, Yf+1

, Yf

F + S =

Solvent flow:

Water flow:

W = W

Mass balance on aniline above the feed stage:

Stage i (i<f)

W, Xi-1

W, Xi

, Yi

Aniline flow in = Aniline flow out

WXi-1 + Yi+1 = WXi +Yi (i= 1, 2, …, f-1)

, Yi+1

Mass balance on aniline around the feed stage:

Aniline flow in = Aniline flow out

Feed Stage (stage f)

W, Xf-1

F, YF

W, Xf

S, Yf+1

, Yf

WXf-1 +SYf+1 +FYF = WXf +Yf

Mass balance on aniline below the feed stage:

Stage i (i<f)

W, Xi-1

W, Xi

S, Yi+1

S, Yi

Aniline flow in = Aniline flow out

WXi-1 + Yi+1 = WXi +SYi (i= f+1, f+2, …, N)

The equilibrium relationship: Yi = mXi

WXi-1 + Yi+1 = WXi +Yi (i= 1, 2, …, f-1)

WXi-1 + (mXi+1) = WXi +(mXi) (i= 1, 2, …, f-1)

-WXi-1 + (W+)Xi Xi+1=0 (i= 1, 2, …, f-1)

When i=0

(W+m)X1 X2= WX0

The equilibrium relationship: Yi = mXi

-WXf-1 + (W+)Xf Xf+1=FYF

WXf-1 +SYf+1 +FYF = WXf +Yf

The equilibrium relationship: Yi = mXi

WXi-1 + S(mXi+1) = WXi +(mXi) (i= f+1, f+2, …, N)

When i=N

-WXN-1 + (W+m)XN =0

WXi-1 + Yi+1 = WXi +SYi (i= f+1, f+2, …, N)

-WXi-1 + (W+m)Xi Xi+1=0 (i= f+1, f+2, …, N)

(W+m)X1 X2= WX0

-WXi-1 + (W+)Xi Xi+1=0 (i= 2, …, f-1)

-WXf-1 + (W+)Xf Xf+1=FYF

-WXi-1 + (W+m)Xi Xi+1=0 (i=f+1, f+2, …, N-1)

-WXN-1 + (W+m)XN =0

The mass balance equations generate a tridiagonal set of simultaneous linear algebraic equations that can be solved by the matrix inversion method.

Solution Procedure for Part (b) (Method 1)

1. Derive all 10 equations

2. Convert them into [A][X]=[C]

3. Solve [X]=[A]\[C]

Solution Procedure for Part (b) (Method 2)

1. Solve [A][X]=[C]

2. Develop a MATLAB script or function m-file to create both coefficient and constant matrices [A] and [C]. This is helpful when N is very large (>20).

3. Solve [X]=[A]\[C]

The equilibrium relationship: Yi = p+qXi

WXi-1 + Yi+1 = WXi +Yi (i= 1, 2, …, f-1)

WXi-1 – (W+p)Xi + pXi+1-qXi2+qXi+12=0 (i= 1, 2, …, f-1)

When i=0

WX0 – (W+p)X1 + pX2-qX12+qX22=0

The equilibrium relationship: Yi = p+qXi

WXi-1 + Yi+1 = WXi +Yi (i= 1, 2, …, f-1)

-WXf-1 + (W+)Xf Xf+1=WYF (i= f)

WYF -WXf-1 + (W+p)Xf - pSXf+1+Xf2 =0

The equilibrium relationship: Yi = p+qXi

-WXi-1 + (W+())Xi Xi+1=0 (i=f+1, f+2, …, N)

WXi-1 + Yi+1 = WXi +SYi (i= f+1, f+2, …, N)

When i=N

-WXi-1 + (W+pS)Xi – pSXi+1+ = 0

-WXN-1 + (W+pS)XN + = 0

The mass balance equations generate a set of non-linear algebraic equations that can be solved by the Newton’s method or MATLAB solve fsolve. Excel solve can also

be used, but probably very tedious to input all the equations.

Solution Procedure for Part (d)

1. Create a function m-file to store all the equations generated from the mass balance.

2. Using the results from Part (b) as the initial values for X.

3. Solve X using Newton.m, newtmult.m or fsolve.