Acetic acid (CH3COOH) reacts with ethanol (C2H5OH) to make ethyl acetate (CH3COOC2H5) and water in an organic solvent. The reaction is:
Acetic acid + ethanol <==> Ethyl acetate + Water
Say the equilibrium constant K= [Ethyl acetate].[Water]/([Ethanol].[Acetic acid]) where the [] brackets mean molar (mole/l) concentrations. Say the Equilibrium constant K is 100 (a made-up number).
Write a matlab program that calculates how much ethyl acetate (Z g/L) is produced in g/L starting from X g/L of ethanol and 5 g/L of acetic acid. Your program should produce a plot of Z vs X.