A Selection of Physical Chemistry Problems Solved using Mathematica Housam BINOUS National Institute of Applied Sciences and Technology

Slides:



Advertisements
Similar presentations
APPLICATIONS Applications of Raoult’s law
Advertisements

A Selection of Chemical Engineering Problems Solved using Mathematica
Modelling & Simulation of Chemical Engineering Systems
VAPOR LIQUID EQUILIBRUIM
Advanced Thermodynamics Note 11 Solution Thermodynamics: Applications
Kinetic and Thermodynamic Studies in Batch Reactor
Goal 1: Design a flash drum
Vapor and Liquid Equilibrium
© 2014 Carl Lund, all rights reserved A First Course on Kinetics and Reaction Engineering Class 15.
Composition of Methanol- Water Batch Distillation Prepared by: Jason Hixson Don Scott Michael Hickey September 20, 2005.
Pharmaceutical API Process Development and Design
Chapter 12 Gas-Liquid Equilibrium
© 2014 Carl Lund, all rights reserved A First Course on Kinetics and Reaction Engineering Class 3.
Chemistry Thermodynamics Lecture 12 : Kinetic coefficients and Linear response Lecture 13 : Non Ideal Solutions and Activity Lecture 14: Chemical.
Modeling of Coupled Non linear Reactor Separator Systems Prof S.Pushpavanam Chemical Engineering Department Indian Institute of Technology Madras Chennai.
Chapter 14-Part VII Applications of VLLE.
Chapter 14: Phase Equilibria Applications
Distillation Underlying Principles of Distillation
Solution Thermodynamics: Applications
Liquid Phase Properties from VLE Data SVNA 12.1
Bubble Point and dew point Calculations
Solution Thermodynamic:
An Integrated Educational Thermodynamics Software Program
Advanced Thermodynamics Note 9 Vapor/Liquid Equilibrium: Introduction
© 2015 Carl Lund, all rights reserved A First Course on Kinetics and Reaction Engineering Class 32.
Dicky Dermawan ITK-234 Termodinamika Teknik Kimia II Nonideal Behavior Dicky Dermawan
Vapor pressure and liquids Vapor : A gas that exists below its critical point Gas : gas that exists above its critical point ِNote : A gas can not condense.
A First Course on Kinetics and Reaction Engineering
31.1 Thermodynamics of Mixing of Ideal Solutions For the process where solute and solvent are mixed to form an ideal solution at constant temperature and.
© 2014 Carl Lund, all rights reserved A First Course on Kinetics and Reaction Engineering Class 23.
Dr Saad Al-ShahraniChE 334: Separation Processes  Nonideal Liquid Solutions  If a molecule contains a hydrogen atom attached to a donor atom (O, N, F,
Vapor-Liquid Equilibrium (VLE) at Low Pressures
L8-1 Slides courtesy of Prof M L Kraft, Chemical & Biomolecular Engr Dept, University of Illinois, Urbana-Champaign. Review: Pressure Drop in PBRs A →
© 2015 Carl Lund, all rights reserved A First Course on Kinetics and Reaction Engineering Class 31.
© 2014 Carl Lund, all rights reserved A First Course on Kinetics and Reaction Engineering Class 19.
Dr Saad Al-ShahraniChE 334: Separation Processes Absorption of Dilute Mixtures  Graphical Equilibrium Stage Method for Trayed Tower  Consider the countercurrent-flow,
© 2014 Carl Lund, all rights reserved A First Course on Kinetics and Reaction Engineering Class 26.
Collection and Analysis of Rate Data
Distillation ... A Separation Method.
© 2014 Carl Lund, all rights reserved A First Course on Kinetics and Reaction Engineering Class 23.
THERMODYNAMICS OF SEPARATION OPERATIONS
© 2014 Carl Lund, all rights reserved A First Course on Kinetics and Reaction Engineering Class 30.
© 2014 Pearson Education, Inc. Chapter 11 Gases Partial Pressures Learning Goal Use Dalton’s Law of partial pressures to calculate the total pressure.
Thermodynamics of Separation Operations
Tips for Homework set 4 The homework is designed to practice main principles that we discussed in the classroom. As in other chemical engineering classes,
THERMODYNAMICS OF SEPARATION OPERATIONS
Review Of Statistical Mechanics Continued
APPLICATIONS Applications of Raoult’s law
Introduction to phase equilibrium
Ideal and Dilute Solutions 2/21/2016. Master Thermodynamics Equations.
Chapter 7: Equilibrium and Stability in One-Component Systems
1. Write down the vapor-liquid equilibrium (VLE) equations for a binary system assuming that the vapor phase is ideal and the liquid phase follows Raoult’s.
© 2015 Carl Lund, all rights reserved A First Course on Kinetics and Reaction Engineering Class 37.
Liquid – Liquid, Liquid – Solid, Gas – Solid Equilibrium
Determination of Amine Volatility for CO 2 Capture Thu Nguyen January 10, 2008 The University of Texas at Austin Professor Gary Rochelle.
SAL COLLEGE OF ENGINEERING Department of Chemical Engineering ALA CHEMICAL ENGINEERING THERMODYNAMICS -II ( ) TOPIC : SIMPLE MODELS FOR VAPOUR/LIQUID.
Solution Thermodynamics: Applications Chapter 12-Part IV.
Chapter 14: Phase Equilibria Applications Part II.
Reactor Design. تحت شعار العيد فرحة : الجمهور : طبعا النهاردة نص يوم علشان العيد خلص امبارح؟ أنا : لأ الجمهور : يعني النهاردة هناخد سكشن؟ أنا : ونص الجمهور.
Vapor – Liquid Equilibrium
ChE 402: Chemical Reaction Engineering
Prepared By Hitesh N. Panchal Assistant Professor
ChE 402: Chemical Reaction Engineering
A First Course on Kinetics and Reaction Engineering
A First Course on Kinetics and Reaction Engineering
A First Course on Kinetics and Reaction Engineering
Phase Equilibrium.
Liquid-Liquid Phase Equilibrium
Enthalpy vs. Composition – Ponchon-Savarit Plot
Chemical Reaction Engineering
Presentation transcript:

A Selection of Physical Chemistry Problems Solved using Mathematica Housam BINOUS National Institute of Applied Sciences and Technology 1- Applied Thermodynamics 2- Chemical Kinetics

Azeotropes for Ternary Systems Case of Acetone - Chloroform - Methanol System Gas Constant and Total Pressure : Vapor Pressure Using Antoine Equation : R=1.987;P=760; A1= ;B1= ;C1= ; A2= ;B2= ;C2= ; A3= ;B3= ;C3= ; PS1=10^(A1-B1/(C1+T)); PS2=10^(A2-B2/(C2+T)); PS3=10^(A3-B3/(C3+T));

Liquid phase activity coefficients from Wilson model : l12= ;l21= ;l13= ; l31= ;l23= ;l32= ; V1=74.05;V2=80.67;V3=40.73; X3=1.-X1-X2; A12=V2/V1 Exp[-l12/(R*( T))]; A13=V3/V1 Exp[-l13/(R*( T))]; A32=V2/V3 Exp[-l32/(R*( T))]; A21=V1/V2 Exp[-l21/(R*( T))]; A31=V1/V3 Exp[-l31/(R*( T))]; A23=V3/V2 Exp[-l23/(R*( T))]; GAM1=Exp[-Log[X1+X2*A12+X3*A13]+1-(X1/(X1+X2*A12+X3*A13)+ X2*A21/(X1*A21+X2+X3*A23)+X3*A31/(X1*A31+X2*A32+X3))]; GAM2=Exp[-Log[X1*A21+X2+X3*A23]+1-(X1*A12/(X1+X2*A12+X3*A13)+ X2/(X1*A21+X2+X3*A23)+X3*A32/(X1*A31+X2*A32+X3))]; GAM3=Exp[-Log[X1*A31+X2*A32+X3]+1-(X1*A13/(X1+X2*A12+X3*A13)+ X2*A23/(X1*A21+X2+X3*A23)+X3/(X1*A31+X2*A32+X3))];

Modified Raoult’s law : Using the Mathematica’s function FindRoot to solve a system of nonlinear equations using different initial guesses : Y1=X1*PS1*GAM1/P; Y2=X2*PS2*GAM2/P; Y3=X3*PS3*GAM3/P; In[25]:=FindRoot[{Y1==X1,Y2==X2, P==X1*PS1*GAM1+X2*PS2*GAM2+X3*PS3*GAM3},{X1,0.3},{X2,0.4},{T,40}] Out[25]={X1-> ,X2-> ,T-> } In[26]:=FindRoot[{Y1==X1,Y2==X2, P==X1*PS1*GAM1+X2*PS2*GAM2+X3*PS3*GAM3},{X1,0},{X2,0.4},{T,57}] Out[26]={X1 -> ^-27, X2 -> , T -> } In[27]:=FindRoot[{Y1==X1,Y2==X2, P==X1*PS1*GAM1+X2*PS2*GAM2+X3*PS3*GAM3},{X1,0.3},{X2,0},{T,57}] Out[27]={X1 -> , X2 -> ^-31, T -> } In[28]:=FindRoot[{Y1==X1,Y2==X2, P==X1*PS1*GAM1+X2*PS2*GAM2+X3*PS3*GAM3},{X1,0.3},{X2,0.6},{T,63}] Out[28]={X1-> ,X2-> ,T-> }

Calculation of Binary Interaction Parameters for Wilson Model Case of Methanol-Water binary system Gas Constant and Total Pressure : Modified Raoult’s law with Wilson’s model: P=760;R=1.987; A12[T_]:=18.07/40.73 Exp[-d1/(R (T ))]; A21[T_]:=40.73/18.07 Exp[-d2/(R (T ))]; y[x_,T_]:=x 10^(Aa-Ba/(T+Ca)) Exp[-Log[x+A12[T] (1-x)] +(1-x) (A12[T]/(x+A12[T] (1-x))-A21[T]/(A21[T] x+1-x))]/P Aa= ;Ba= ;Ca= ;

Use Mathematica’s function FindMinimum to determine the binary interaction coefficients : Experimental data : {Methanol liquid mole fraction, Temperature, Methanol Vapor Mole fraction} from P. C. Wankat, Equilibruim Staged Separations, Prentice Hall 1988 mydata={{0,100,0},{0.02,96.4,0.134},{0.04,93.5,0.23}, {0.06,91.2,0.304},{0.08,89.3,0.365},{0.1,87.7,0.418}, {0.15,84.4,0.517},{0.2,81.7,0.579},{0.3,78,0.665},{0.4,75.3,0.729}, {0.5,73.1,0.779},{0.6,71.2,0.825},{0.7,69.3,0.87},{0.8,67.6,0.915}, {0.9,66,0.958},{0.95,65,0.979},{1,64.5,1}}; sumOfSquares[data_]:= Apply[Plus,Apply[Plus,Map[{(y[#[[1]],#[[2]]] - #[[3]])^2}&, data]]] param1=FindMinimum[sumOfSquares[mydata], {d1,0.1,90},{d2,.01,1000},MaxIterations->300] { ,{d1-> ,d2-> }}

Isobar Vapor-Liquid Equilibrium Calculations Case of Ethanol-Water System at 760 mmHg Vapor Pressure Using Antoine Equation : Activity coefficients using the Van Laar Model : A1= ;B1= ;C1= ; A2= ;B2= ;C2= ; PS2=10^(A1-B1/(C1+T)); PS1=10^(A2-B2/(C2+T)); G1[i_]:=Exp[A12 (A21 (1-x[i])/(A12 x[i]+A21 (1-x[i])))^2] G2[i_]:=Exp[A21 (A12 x[i]/(A12 x[i]+A21 (1-x[i])))^2] A12=1.6798;A21=0.9227;

Compute T and y for given x using a While loop and Mathematica’s function FindRoot : Create tables using Mathematica’s command Table : i=0;P=760;T=. While[i<101,{x[i]=i 0.01, T[i]=FindRoot[P== PS1 G1[i] x[i]+PS2 G2[i] (1-x[i]),{T,80}][[1,2]], y[i]=PS1 G1[i] x[i]/P/.T-> T[i],i++}] tb=Table[{x[i],y[i]},{i,0,100}]; tb2=Table[{x[i],T[i]},{i,0,100}]; tb3=Table[{y[i],T[i]},{i,0,100}];

Mathematica’s commands ListPlot and Show are used to plot Bubble point and dew point temperatures on the same figure : x,y T plt1=ListPlot[tb2,PlotStyle->RGBColor[1,0,0],PlotJoined-> True, PlotRange->All] plt2=ListPlot[tb3,PlotStyle->RGBColor[0,0,1],PlotJoined-> True, PlotRange->All]

Mathematica’s commands ListPlot, Line and Epilog are used to plot the VLE data and the y=x line : x y plt1=ListPlot[tb,PlotStyle->RGBColor[1,0,0],PlotJoined-> True, Epilog-> {RGBColor[0,1,0],Line[{{0,0},{1,1}}]}]

Isotherm Vapor-Liquid Equilibrium Calculations Case of Ethanol-Ethyl acetate System at 70°C Vapor Pressure Using Antoine Equation : Partial pressure using Raoult’s law : A1= ;B1= ;C1= ; A2= ;B2= ;C2= ; PS1=10^(A1-B1/(C1+T)); PS2=10^(A2-B2/(C2+T)); T=70; P1[x_]:=PS1 x;P2[x_]:=PS2 (1-x); plt3=Plot[{P1[x],P2[x]},{x,0,1}, PlotStyle->{RGBColor[1,0,1],RGBColor[0,1,0]}]

Liquid activity coefficients using the Margules Model : Expect positive deviation from ideality because activity coefficients are greater than 1 : x ii A12=0.8557;A21=0.7476; G3=Exp[(A12+2 (A21-A12) x) (1-x)^2] G4=Exp[(A21+2 (A12-A21) (1-x)) x^2] plt8=Plot[{G3,G4},{x,0,1}, PlotStyle->{RGBColor[0,0,1],RGBColor[0,0,1]}]

Partial pressure using Modified Raoult’s law : x PiPi P1[x_]:=G3 PS1 x;P2[x_]:=G4 PS2 (1-x); plt5=Plot[{P1[x],P2[x]},{x,0,1}, PlotStyle->{RGBColor[0,0,1],RGBColor[0,0,1]}] Show[plt3,plt5]

x,y P Plotting P versus x and y to get the isotherm VLE diagram : P[x_]:=G3 x PS1+G4 (1-x) PS2 plt10=Plot[P[x],{x,0,1},PlotStyle->RGBColor[1,0,1]] tbl=Table[{x G3 PS1/(G3 x PS1+G4 (1-x) PS2), G3 x PS1+G4 (1-x) PS2},{x,0,1,0.01}]; plt11=ListPlot[tbl,PlotStyle->RGBColor[1,0,1], PlotJoined->True] Show[plt10,plt11]

Wei-Prater mechanism 3-reactant triangle network : A1=A2=A3=A1 with rate constants k12, k21, k23, k32, k31, k13. Steady state solution obtained using Mathematica’s function Solve : Rate constants are not independent : k32=k23 (k12/k21) (k31/k13) k12=.5;k21=0.7;k13=.1;k31=.2;k23=.9;k32=k23 (k12/k21) (k31/k13) A1o=.7;A2o=0;A3o=.3;tf=10; sequil=Solve[{0==-(k12 +k13) A1+k21 A2+k31 A3, 0==k12 A1 -(k21 +k23)A2+k32 A3,A3==A1o+A2o+A3o-A1-A2}, {A1,A2,A3}]//Simplify {A1+A2+A3,A2/A1,k12/k21,A3/A1,k13/k31,A3/A2,k23/k32}/.sequil {{A1-> ,A2-> ,A3-> }} {{1., , ,0.5,0.5,0.7,0.7}}

transient solution obtained using Mathematica’s function NDSolve : Plotting the solution using Mathematica’s functions Plot and ParametricPlot : solWP=NDSolve[{A1'[t]==-(k12 +k13) A1[t]+k21 A2[t]+ k31 (A1o+A2o+A3o-A1[t]-A2[t]), A2'[t]==k12 A1[t] -(k21 +k23)A2[t]+ k32 (A1o+A2o+A3o-A1[t]-A2[t]), A1[0]==A1o,A2[0]==A2o},{A1[t],A2[t]},{t,0,tf}]; ({A1[t],A2[t],A1o+A2o+A3o-A1[t]-A2[t]})/.solWP/.t->tf {{ , , }} Plot[Evaluate[Table[{A1[t],A2[t],A1o+A2o+A3o-A1[t]-A2[t]}/.solWP]],{t,0,tf}, Frame->True,DefaultFont->{"Symbol-Bold",14}, FrameLabel->{"t","A1, A2, A3"},PlotRange->{{0,tf},{0,1}}, PlotStyle->{RGBColor[1,0,0],RGBColor[0,1,0],RGBColor[0,0,1]}]; ParametricPlot[Evaluate[Table[{A2[t],A1[t]}/.solWP]],{t,0,tf},Frame->True, DefaultFont->{"Symbol-Bold",14},FrameLabel->{"A2","A1"}, PlotRange->{{0,1},{0,1}}];

Transient solution of Wei-Prater problem :

Consecutive reactions : A1=A2=A3=A4=A5 with rate constants k12, k21, k23, k32, k31, k13... transient solution obtained using Mathematica’s function NDSolve : Plotting the transient solution using Mathematica’s functions Plot : k12=k23=k34=k45=1;k21=k32=k43=k54=.1;A1o=1;tf=10; sol5=NDSolve[{A1'[t]==-k12 A1[t]+k21 A2[t], A2'[t]==k12 A1[t] -(k21 +k23)A2[t]+k32 A3[t], A3'[t]==k23 A2[t] -(k32 +k34)A3[t]+k43 A4[t], A4'[t]==k34 A3[t] -(k43 +k45)A4[t]+k54 (A1o-A1[t]-A2[t]-A3[t]-A4[t]), A1[0]==A1o,A2[0]==0,A3[0]==0,A4[0]==0}, {A1[t],A2[t],A3[t],A4[t]},{t,0,tf}]; Plot[Evaluate[Table[{A1[t],A2[t],A3[t],A4[t],A1o-A1[t]-A2[t]-A3[t]-A4[t]} /.sol5]],{t,0,tf},Frame->True,DefaultFont->{"Symbol-Bold",14}, FrameLabel->{"t","A1, A2, A3, A4, A5"},PlotRange->{{0,tf},{0,1}}, PlotStyle->{RGBColor[1,0,0],RGBColor[0,1,0],RGBColor[0,0,1], RGBColor[1,1,0],RGBColor[0,1,1]}];

Steady state solution obtained using Mathematica’s function Solve : Plotting the steady state solution using Mathematica’s functions ListPlot : soleq=Solve[{0==-k12 A1+k21 A2, 0==k12 A1-(k21 +k23)A2+k32 A3, 0==k23 A2 -(k32 +k34)A3+k43 A4, 0==k34 A3 -(k43 +k45)A4+k54 (A1o-A1-A2-A3-A4)},{A1,A2,A3,A4}] A5=(A1o-A1-A2-A3-A4)/.soleq ListPlot[Flatten[{A1,A2,A3,A4,(A1o-A1-A2-A3-A4)}/.soleq], PlotStyle->{PointSize[0.015],RGBColor[1,0,0]}]

transient solution : Steady state solution :

Lotka-Volterra Mechanism Foxes and rabbits interactions : Governing equations :

NDSolve finds the solutions to the ODEs and Plot gives the figure with typical oscillationsfor the case A=3.7, k1=1.2, k2=1.5 and k3=1.2 : t x,y A =3.7;k1=1.2;k2=1.5;k3=1.2; LV=NDSolve[{X'[t]==k1 A X[t]-k2 X[t] Y[t],Y'[t]==k2 X[t] Y[t] - k3 Y[t],X[0]==.85,Y[0]==3.2},{X[t],Y[t]},{t,0,10}]; Plot[Evaluate[Table[{X[t],Y[t]}/.LV]],{t,0,10}, PlotStyle->{RGBColor[1,0,0],RGBColor[0,0,1]}]

Oregonator model of the BZ reaction Main chemical reactions taking places : Governing equations :

NDSolve finds the solutions to the ODEs for the case s=100, f=1.1, q=10 -6 and w=3.835 : Plotting the solution using Mathematica’s functions Plot and ParametricPlot : s=100;f=1.1;q=10^-6;w=3.835; sol1=NDSolve[{x'[t]==s (x[t]+y[t]-x[t] y[t]-q x[t]^2), y'[t]==1/s (-y[t]-x[t] y[t]+f z[t]), z'[t]==w (x[t]-z[t]), x[0]==1,y[0]==1,z[0]==1},{x,y,z},{t,0,5000}, WorkingPrecision->25,AccuracyGoal->10, PrecisionGoal->10,MaxSteps->Infinity] pl1=Plot[Evaluate[x[t]/.sol1],{t,0,1000},PlotRange->All, PlotStyle->RGBColor[0,0,1]] ParametricPlot[Evaluate[{z[t],y[t]}/.sol1],{t,500,1000}, PlotRange->{1,1.20},PlotStyle->RGBColor[0,1,0]]

The solution shows regular oscillations such as those observed in the Belousov-Zhabotinski experiments. Limit cycle are obtained and a lapse of time is necessary before oscillations are observed. u3u3 u2u2 u1u1 t

Lindermann-Hinshelwood Mechanism Quasi steady state approximation : If A large, reaction rate law is first order If A small, reaction rate law is second order Solve[{RA==k1 A^2-k2 A Ac, 0==k1 A^2-k2 A Ac-k3 Ac},{RA,Ac}]//Simplify

Continuous-Stirred Tank Reactor A in, B in A, B, C V d

t 10 3 C NDSolve and Plot are used to get the concentration profile of the product : k1=1;k2=10^-2;k0=d/V;V=10;d=0.6; sol=NDSolve[{ c'[t]==k1 a[t] b[t]-k2 c[t]-k0 c[t], a'[t]==-k1 a[t] b[t]+k2 c[t]+k0 (0.01-a[t]), b'[t]==-k1 a[t] b[t]+k2 c[t]+k0 (0.02-b[t]), a[0]==10^-2,b[0]==2 10^-2,c[0]==0},{a,b,c},{t,0,300}] Plot[Evaluate[1000 c[t]/.sol],{t,0,300},PlotRange->{0,8}, PlotStyle->RGBColor[1,0,0]]

Conclusion Mathematica’s algebraic, numerical and graphical capabilities can be put into advantage to solve several Physical Chemistry problems such as applied thermodynamics and chemical kinetics.

1/ 2/