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%)