MATH564 Homework 6: Biochemistry

Topics

Atomic physics

Electron orbitals

(*
code to fetch the axes ranges for OrbitalModelAxesRanges
*)

(*
AxesRangeTable[graphicsTable_]:=Block[{len,rangeA,rangeB,axesTable},
len=Length[graphicsTable];
axesTable={};
Do[
AppendTo[axesTable,Map[Max,Abs[Ceiling[PlotRange[OrbitalModel[k,1,False]]*10]/10.]]],
{k,1,len}];
axesTable
];

one=Table[OrbitalModel[i,1,False],{i,1,16}];
OrbitalModelAxesRanges=AxesRangeTable[one]*1.05

*)

OrbitalModelAxesRanges={{0.315,0.315,0.315},{0.315,0.315,0.525},{0.525,0.315,0.315},{0.315,0.525,0.315},{0.42,0.42,0.735},{0.525,0.315,0.525},{0.315,0.525,0.525},{0.525,0.525,0.315},{0.63,0.63,0.315},{0.42,0.42,0.84},{0.525,0.315,0.63},{0.315,0.525,0.63},{0.42,0.42,0.42},{0.525,0.525,0.42},{0.63,0.63,0.21},{0.63,0.63,0.21}};

AxesAndLabels[trio_]:=Block[{axes},
axes=Graphics3D[{{Gray,Thick,{Line[{{-trio[[1]],0,0},{trio[[1]],0,0}}],Line[{{0,-trio[[2]],0},{0,trio[[2]],0}}],Line[{{0,0,-trio[[3]]},{0,0,trio[[3]]}}]}},{Text[Style["x",Italic,FontSize->Medium,FontColor->Gray],{trio[[1]]*1.15,0,0}],Text[Style["y",Italic,FontSize->Medium,FontColor->Gray],{0,trio[[2]]*1.15,0}],Text[Style["z",Italic,FontSize->Medium,FontColor->Gray],{0,0,trio[[3]]*1.15}]}}]
];

OrbitalModel[n_,view_, label_] := Module[{pairs, fun, fun1, fun2,fun3,fun4, a, b, l, m, y1, y2, y3,θ, ϕ,pos,orbs1,orbs2},
  pairs = 
   Flatten[Table[{i, j}, {i, 0, 5}, {j, 0, i}], 1];
    fun = {};
    Do[l = pairs[[i, 1]];
      m = pairs[[i, 2]];
      a = SphericalHarmonicY[l,- m, θ, ϕ];
      b = SphericalHarmonicY[l, m, θ,ϕ];
      y1 = b;
      y2 = ExpToTrig[(a -b)/(Sqrt[2])];
      y3 = ExpToTrig[(a + b)/(Sqrt[2])/I];
      If[m == 0, AppendTo[fun, y1], AppendTo[fun, {y2, y3}]];
      fun1 = Flatten[fun, 1], {i, 1, Length[pairs]}];
fun2=Take[fun1,16];
fun3=Table[If[i==4||i==7||i==12||i==14||i==16,-fun2[[i]],fun2[[i]]],{i,1,16}];fun4=Table[If[i==8||i==9||i==13||i==14,fun3[[i]]*I,fun3[[i]]],{i,1,16}];
pos[x_]:=If[x>=0,x,Null];
orbs1=If[view==1,
Show[SphericalPlot3D[{fun4[[n]],-fun4[[n]]},{θ,0,π},{ϕ,0,2 π},PlotRange->All,PlotStyle->Map[Lighter,{Yellow,Yellow}],SphericalRegion->True,ImageSize->{300,300},Axes->False,Boxed->False,MaxRecursion->ControlActive[2,Automatic]]],Show[SphericalPlot3D[{pos[fun4[[n]]],pos[-fun4[[n]]]},{θ,0,π},{ϕ,0,2 π},PlotRange->All,PlotStyle->Map[Lighter,{Red,Blue}],SphericalRegion->True,ImageSize->{300,300},Axes->False,Boxed->False,MaxRecursion->ControlActive[2,Automatic]]]];
If[label,Show[orbs1,AxesAndLabels[OrbitalModelAxesRanges[[n]]]],orbs1,ImageSize->{300,300}]
];

OrbitalDataNames={{"orbital designation",Row[{"|"Style["m",Italic],"|"}],"number of","polynomial form"}};

OrbitalData={
{"1s",0,"nodes: 0","1"},
{"2p",0,"nodes: 1",Style["z",Italic]},
{"2p",1,"nodes: 1",Style["x",Italic]},
{"2p",1,"nodes: 1",Style["y",Italic]},
{"3d",0,"nodes: 2",((Style["z",Italic])^2)},
{"3d",1,"nodes: 2",Row[{Style["x",Italic]," ",Style["z",Italic]}]},
{"3d",1,"nodes: 2",Row[{Style["y",Italic]," ",Style["z",Italic]}]},
{"3d",2,"nodes: 2",Row[{Style["x",Italic]," ",Style["y",Italic]}]},
{"3d",2,"nodes: 2",Row[{((Style["x",Italic])^2)," - ",((Style["y",Italic])^2)}]},
{"4f",0,"nodes: 3",((Style["z",Italic])^3)},
{"4f",1,"lobes: 6",Row[{Style["x",Italic]," ",((Style["z",Italic])^2)}]},
{"4f",1,"lobes: 6",Row[{Style["y",Italic]," ",((Style["z",Italic])^2)}]},
{"4f",2,"lobes: 8",Row[{Style["x",Italic]," ",Style["y",Italic]," ",Style["z",Italic]}]},
{"4f",2,"lobes: 8",Row[{Style["z",Italic],"(",((Style["x",Italic])^2)," - ",((Style["y",Italic])^2),")"}]},
{"4f",3,"lobes: 6",Row[{Style["x",Italic],"(",((Style["x",Italic])^2)," - 3 ",((Style["y",Italic])^2),")"}]},
{"4f",3,"lobes: 6",Row[{Style["y",Italic],"(3 ",((Style["x",Italic])^2)," - ",((Style["y",Italic])^2),")"}]}
};

OrbitalDataTable=Table[{OrbitalDataNames[[j]],OrbitalData[[i]]},{j,1,Length[OrbitalDataNames]},{i,1,Length[OrbitalData]}];

Manipulate[
Pane[Column[{
Text@TabView[{"characteristics"->Grid[Transpose[OrbitalDataTable[[1,j]]],ItemSize->{{15,10}},Frame->All]},Alignment->{Center,Center}],
Show[If[viewType==1,OrbitalModel[j,1,showAxLabel],OrbitalModel[j,2,showAxLabel]],ImageSize->{300,300},ImagePadding->5{{1,1},{1,1}}]},Spacings->2,Alignment->{Center,Center}],Alignment->{Center,Center},ImageSize->{400,450}],
Row[{Control[{{j,1,"orbital "},Thread[Range[16]-> {
"1s",
Subscript["2p","z"],
Subscript["2p","x"],
Subscript["2p","y"],
Subscript["3d",Superscript["z","2"]],
Subscript["3d","xz"],
Subscript["3d","yz"],
Subscript["3d","xy"],
RawBoxes[RowBox[{"3",SubscriptBox["d",RowBox[{SuperscriptBox["x","2"],"-",SuperscriptBox["y","2"]}]]}]],
Subscript["4f",Superscript["z","3"]],
Subscript["4f",Superscript["xz","2"]],
Subscript["4f",Superscript["yz","2"]],
Subscript["4f","xyz"],
RawBoxes[RowBox[{SubscriptBox["4f",RowBox[{"z","(",RowBox[{SuperscriptBox["x","2"],"-",SuperscriptBox["y","2"]}],")"}]]}]],
RawBoxes[RowBox[{SubscriptBox["4f",RowBox[{"x","(",RowBox[{SuperscriptBox["x","2"],"-",SuperscriptBox["3y","2"]}],")"}]]}]],RawBoxes[RowBox[{SubscriptBox["4f",RowBox[{"y","(",RowBox[{SuperscriptBox["3x","2"],"-",SuperscriptBox["y","2"]}],")"}]]}]]
}]}],
Spacer[20],
Column[{Control[{{viewType,1,"type of view "},{1->" w/o phases  ",2->" with phases"},
      RadioButton}],Control[{{showAxLabel,False,"show axes and labels "},{False,True}}]}]}],
TrackedSymbols:>{viewType,showAxLabel,j},SaveDefinitions->True]

Chemical bonds

Covalent bonds

H2=Molecule["Hydrogen"]

MoleculePlot[H2]

MoleculePlot3D[H2]

CH4=Molecule["Methane"]

MoleculePlot3D[CH4]

MoleculePlot[CH4]

NH3=Molecule["Ammonia"]

MoleculePlot3D[NH3]

MoleculePlot[NH3]

ChemicalData["Ammonia","BoilingPoint"]

ChemicalData["Water","BoilingPoint"]

Ionic bonds

ChemicalData["Salt"]

Chemical forces

Van Der Waals surface

(*ChemicalData[All,"Preload"];*)

SphereIntersection[c1:{_?NumericQ,_?NumericQ,_?NumericQ},r1_?NumericQ,c2:{_?NumericQ,_?NumericQ,_?NumericQ},r2_?NumericQ]:=
Block[{t,x,y,z,m,d,c1c2Vec},
c1c2Vec=c2-c1;
d=Norm[c1c2Vec];
t={(((r1^2)-(r2^2))/(2 d)),(1/2) (Sqrt[-(d^2)+2 (r1^2)+2 (r2^2)-(((((r1^2)-(r2^2)))^2)/(d^2))])};
t={t,t*{1,-1}};
t=Norm[Subtract@@(t)]/2;
c1c2Vec=c1c2Vec/Norm[c1c2Vec];
m=c1c2Vec*r1(Sqrt[1-(t/r1)^2])+c1;
t=(c1c2Vec.({x,y,z}-m)//Simplify)/.{x->#1,y->#2,z->#3};
t=Evaluate[t]&;
If[(t@@c1)<0,{Evaluate[t[[1]]<0]&,Evaluate[t[[1]]>0]&},{Evaluate[t[[1]]>0]&,Evaluate[t[[1]]<0]&}]
];

PlotOnRegions[c_,R_,ipfs_List,optsArg___]:=
Block[{opts},opts=Sequence@@Join[{optsArg},{PlotRange->All,Mesh->All}];
ParametricPlot3D[R{Cos[u]Cos[v],Sin[u]Cos[v],Sin[v]}+c,{u,0,2π},{v,-π/2,π/2},RegionFunction->(Evaluate[And@@Map[First,ipfs]]&),opts//Evaluate]
];

Combination[{}]:={};
Combination[elems_List]:=Join[{First@elems,#}&/@Rest[elems],Combination[Rest[elems]]];

CheckPairs[apos_,radiuses_]:=
Block[{comb,t},
comb=Combination[Range[Length[apos]]];
t=Select[comb,Norm[apos[[#[[1]]]]-apos[[#[[2]]]]]<(radiuses[[#[[1]]]]+radiuses[[#[[2]]]])&];
t=Transpose[{SphereIntersection[apos[[#[[1]]]],radiuses[[#[[1]]]],apos[[#[[2]]]],radiuses[[#[[2]]]]],#}]&/@t;
Reap[Sow@@@Flatten[t,1],Range[Length[apos]]]
];

mnames={"Water","Benzene","Ethanol","Isopropanol","T-Butanol","OxalicAcid","Caffeine","NitricAcid"};
(*mpRules=Thread[mnames->(ChemicalData[#,"MoleculePlot"]&/@mnames)];
aposRules=Thread[mnames->(ChemicalData[#,"AtomPositions"]&/@mnames)];
vtypesRules=Thread[mnames->(ChemicalData[#,"VertexTypes"]&/@mnames)];*)

mpRules={"Water"->,"Benzene"->,"Ethanol"->,"Isopropanol"->,"T-Butanol"->,"OxalicAcid"->,"Caffeine"->,"NitricAcid"->};

aposRules={"Water"->{{-6.3259`5.000000000000002,-25.268`5.000000000000002,26.21`5.000000000000002},{74.277`5.000000000000002,26.059`5.000000000000002,17.009`5.000000000000002},{-67.951`5.000000000000002,-0.79118`5.000000000000002,-43.219`5.000000000000002}},"Benzene"->{{-119.07`5.000000000000002,-1.5997`5.000000000000002,-75.474`5.000000000000002},{-13.956`5.000000000000002,84.677`5.000000000000002,-110.68`5.000000000000002},{-105.11`5.000000000000002,-86.277`5.000000000000002,35.21`5.000000000000002},{105.11`5.000000000000002,86.277`5.000000000000002,-35.21`5.000000000000002},{13.956`5.000000000000002,-84.677`5.000000000000002,110.68`5.000000000000002},{119.07`5.000000000000002,1.5997`5.000000000000002,75.474`5.000000000000002},{-209.33`5.000000000000002,-2.6239`5.000000000000002,-132.92`5.000000000000002},{-24.311`5.000000000000002,149.49`5.000000000000002,-195.19`5.000000000000002},{-184.85`5.000000000000002,-152.21`5.000000000000002,62.495`5.000000000000002},{184.85`5.000000000000002,152.21`5.000000000000002,-62.495`5.000000000000002},{24.311`5.000000000000002,-149.49`5.000000000000002,195.19`5.000000000000002},{209.33`5.000000000000002,2.6239`5.000000000000002,132.92`5.000000000000002}},"Ethanol"->{{-102.34`5.000000000000002,31.783`5.000000000000002,-104.25`5.000000000000002},{-44.968`5.000000000000002,-30.747`5.000000000000002,7.7579`5.000000000000002},{95.826`5.000000000000002,27.954`5.000000000000002,28.907`5.000000000000002},{-105.4`5.000000000000002,-13.896`5.000000000000002,94.442`5.000000000000002},{-38.073`5.000000000000002,-136.17`5.000000000000002,-9.208`5.000000000000002},{88.385`5.000000000000002,133.4`5.000000000000002,45.491`5.000000000000002},{155.53`5.000000000000002,9.6459`5.000000000000002,-57.985`5.000000000000002},{141.4`5.000000000000002,-18.389`5.000000000000002,113.91`5.000000000000002},{-190.35`5.000000000000002,-3.5849`5.000000000000002,-119.06`5.000000000000002}},"Isopropanol"->{{8.5267`5.000000000000002,-130.38`5.000000000000002,95.261`5.000000000000002},{-17.612`5.000000000000002,-1.8688`5.000000000000002,41.515`5.000000000000002},{113.82`5.000000000000002,58.686`5.000000000000002,-6.8101`5.000000000000002},{-120.36`5.000000000000002,-18.928`5.000000000000002,-69.351`5.000000000000002},{-57.9`5.000000000000002,65.765`5.000000000000002,113.98`5.000000000000002},{181.71`5.000000000000002,66.859`5.000000000000002,75.481`5.000000000000002},{156.49`5.000000000000002,-4.1879`5.000000000000002,-82.139`5.000000000000002},{95.427`5.000000000000002,155.86`5.000000000000002,-47.665`5.000000000000002},{-80.994`5.000000000000002,-83.777`5.000000000000002,-144.8`5.000000000000002},{-209.79`5.000000000000002,-61.49`5.000000000000002,-28.856`5.000000000000002},{-142.58`5.000000000000002,76.491`5.000000000000002,-112.38`5.000000000000002},{73.272`5.000000000000002,-123.02`5.000000000000002,165.76`5.000000000000002}},"T-Butanol"->{{-55.359`5.000000000000002,114.59`5.000000000000002,94.935`5.000000000000002},{-8.1576`5.000000000000002,11.302`5.000000000000002,9.4494`5.000000000000002},{77.691`5.000000000000002,76.234`5.000000000000002,-97.685`5.000000000000002},{68.069`5.000000000000002,-89.15`5.000000000000002,95.374`5.000000000000002},{-140.03`5.000000000000002,-42.478`5.000000000000002,-44.665`5.000000000000002},{159.82`5.000000000000002,127.06`5.000000000000002,-51.631`5.000000000000002},{18.773`5.000000000000002,146.43`5.000000000000002,-152.92`5.000000000000002},{114.97`5.000000000000002,0.97853`5.0000000000000036,-163.99`5.000000000000002},{2.5146`5.000000000000002,-129.51`5.000000000000002,169.68`5.000000000000002},{150.25`5.000000000000002,-40.067`5.000000000000002,143.19`5.000000000000002},{104.9`5.000000000000002,-168.3`5.000000000000002,33.508`5.000000000000002},{-191.98`5.000000000000002,35.651`5.000000000000002,-96.113`5.000000000000002},{-200.13`5.000000000000002,-77.832`5.000000000000002,36.495`5.000000000000002},{-120.6`5.000000000000002,-123.01`5.000000000000002,-112.39`5.000000000000002},{19.283`5.000000000000002,158.12`5.000000000000002,136.76`5.000000000000002}},"OxalicAcid"->{{-104.79`5.000000000000003,35.178`5.0000000000000036,-110.32`5.000000000000002},{132.97`5.000000000000003,79.861`5.000000000000002,-9.4048`5.000000000000002},{-146.02`5.,-118.86`5.000000000000002,47.718`5.000000000000003},{98.371`5.,-72.44`5.,150.87`5.000000000000002},{-72.72`5.000000000000002,-37.691`5.000000000000003,-2.0382`5.000000000000002},{61.446`5.000000000000002,-11.532`5.,53.777`5.},{-190.39`5.000000000000002,23.741`5.000000000000002,-152.25`5.},{221.13`5.000000000000002,101.74`5.000000000000002,21.649`5.000000000000003}},"Caffeine"->{{24.134`5.000000000000002,-147.93`5.000000000000002,193.37`5.000000000000002},{-287.16`5.000000000000002,-54.68`5.000000000000002,-121.3`5.000000000000002},{-93.553`5.000000000000002,62.099`5.000000000000002,-135.25`5.000000000000002},{203.9`5.000000000000002,53.968`5.000000000000002,68.284`5.000000000000002},{-135.82`5.000000000000002,-104.67`5.000000000000002,38.896`5.000000000000002},{138.96`5.000000000000002,169.08`5.000000000000002,-113.29`5.000000000000002},{80.333`5.000000000000002,14.21`5.000000000000002,33.387`5.000000000000002},{40.141`5.000000000000002,85.578`5.000000000000002,-78.341`5.000000000000002},{-9.1854`4.999999999999997,-85.421`5.000000000000002,96.284`5.000000000000002},{-177.11`5.000000000000002,-32.589`5.000000000000002,-74.348`5.000000000000002},{239.2`5.000000000000002,149.09`5.000000000000002,-23.529`5.000000000000002},{-139.62`5.000000000000002,135.07`5.000000000000002,-252.54`5.000000000000002},{287.15`5.000000000000002,5.3462`5.000000000000002,180.66`5.000000000000002},{-226.77`5.000000000000002,-204.28`5.000000000000002,97.556`5.000000000000002},{332.92`5.000000000000002,200.72`5.000000000000002,-24.573`5.000000000000002},{-227.73`5.000000000000002,190.48`5.000000000000002,-227.75`5.000000000000002},{-161.9`5.000000000000002,65.917`5.000000000000002,-331.1`5.000000000000002},{-63.072`5.000000000000002,202.44`5.000000000000002,-284.98`5.000000000000002},{304.9`5.000000000000002,-99.54`5.000000000000002,169.13`5.000000000000002},{236.14`5.000000000000002,22.934`5.000000000000002,273.06`5.000000000000002},{380.59`5.000000000000002,57.505`5.000000000000002,181.`5.000000000000002},{-207.86`5.000000000000002,-212.37`5.000000000000002,202.57`5.000000000000002},{-328.1`5.000000000000002,-173.72`5.000000000000002,81.802`5.000000000000002},{-210.51`5.000000000000002,-299.23`5.000000000000002,50.977`5.000000000000002}},"NitricAcid"->{{67.403`5.000000000000002,-27.205`5.000000000000002,76.284`5.000000000000002},{-141.09`5.000000000000002,-72.076`5.000000000000002,-5.2433`5.000000000000002},{-26.445`5.000000000000002,73.717`5.000000000000002,-105.76`5.000000000000002},{-38.375`5.000000000000002,-7.4803`5.000000000000002,-15.757`5.000000000000002},{138.51`5.000000000000002,33.044`5.000000000000002,50.475`5.000000000000002}}};

vtypesRules={"Water"->{"O","H","H"},"Benzene"->{"C","C","C","C","C","C","H","H","H","H","H","H"},"Ethanol"->{"O","C","C","H","H","H","H","H","H"},"Isopropanol"->{"O","C","C","C","H","H","H","H","H","H","H","H"},"T-Butanol"->{"O","C","C","C","C","H","H","H","H","H","H","H","H","H","H"},"OxalicAcid"->{"O","O","O","O","C","C","H","H"},"Caffeine"->{"O","O","N","N","N","N","C","C","C","C","C","C","C","C","H","H","H","H","H","H","H","H","H","H"},"NitricAcid"->{"O","O","O","N","H"}};

Manipulate[
Module[{regions,gr,mp,apos,radiuses,vtypes},
mp=mname/.mpRules;
apos=mname/.aposRules;
vtypes=mname/.vtypesRules;
radiuses=vtypes/.Thread[{"H","C","O","N"}->{1.2,1.7,1.52,1.55}100];
regions=Flatten[CheckPairs[apos,radiuses][[2]],1];
Show[mp,MapThread[PlotOnRegions[#1,#2,#3,MaxRecursion->2,If[surfaces==="surface",Sequence@@{PlotStyle->{Green,Opacity[.4]},Mesh->None},Sequence@@{PlotStyle->{FaceForm[None]},MeshStyle->Gray,Mesh->All}]]&,{apos,radiuses,regions}],Boxed->False,ImageSize->{450,400}]
]
,
{{mname,"Benzene","molecule name"},{"Water","Benzene","Ethanol","Isopropanol","T-Butanol","OxalicAcid","Caffeine","NitricAcid"},ControlType->PopupMenu},
{{surfaces,"mesh",""},{"surface","mesh"}},
TrackedSymbols:>{mname,surfaces},SaveDefinitions->True,AutorunSequencing->{1},SynchronousInitialization->False]

Biopolymers

Polysaccharides

glucose=Molecule["glucose"]

MoleculePlot[glucose]

MoleculePlot3D[glucose]

Lipids

Polymers of fatty acids and glycerol

glycerol=Molecule["glycerol"]

MoleculePlot3D[glycerol]

Proteins

Nucleic acids

Catalysis

Manipulate[Show[Plot[{f[a,e,x],g[ca,e,x],0},{x,0,1},PlotStyle->{{Thick,Blue},{Thick,Opacity[c],Red},{Dashed, Black}},Axes->False,Frame->True,FrameLabel->{Style["extent of reaction ξ",20],Style["energy kJ/mol",20]},ImageSize->{575,360}],Graphics[{Thick,Blue,Line[{{.05,a},{.1,a}}],Arrowheads[{-.035,.035}],Arrow[{{.075,0},{.075,a}}],Text[Style[(Subscript[Style["E",Italic], "a"]),20,Blue,Background->White],{.075,.5a}],Black,Arrow[{{.925,e},{.925,0}}],Text[Style[(Subscript[Row[{"Δ",Style["H",Italic]}], "rx"]),20,Black,Background->White],{.925,.75e}],Opacity[c],Red,Line[{{.15,ca},{.2,ca}}],Arrowheads[{-.025,.025}],Arrow[{{.175,0},{.175,ca}}],Text[Style[(Subscript[Style["E",Italic], "ca"]),20,Red,Background->White],{.175,.5ca}],,Opacity[c],Black,Rectangle[{.9ξ-.02,-40+10Boole[.38<ξ<.62]},{.9ξ+.12,-25+10Boole[.38<ξ<.62]}],Opacity[1],Darker[Green],PointSize[.04],Point[{.9ξ+.05-.047-.05Boole[ξ>.6],-15}],Red,PointSize[.05],Point[{.9ξ+.05+.045+.05Boole[ξ<.4],-15}],Blue,PointSize[.075],Point[{.9ξ+.05,-15}]}]],
{{c,1,""},{0->"uncatalyzed",1->"catalyzed"},Setter},{{a,50,"activation energy (kJ/mol)"},50,100,Appearance->"Labeled"},{{ca,30,"catalyzed activation energy (kJ/mol)"},20,40,Appearance->"Labeled"},{{e,-75,"reaction enthalpy (kJ/mol)"},-100,-50,Appearance->"Labeled"},{{ξ,.386,"extent of reaction"},0,1,Appearance->"Labeled"},TrackedSymbols:>{a,c,ca,e,ξ},ControlPlacement->Top,Initialization:>(
f[a_,e_,x_]:=Piecewise[{{.5a Erf[10x-3.2]+.5a,x<=.5},{.5(a-e) Erfc[10x-6.8]+e,x>=.5}}];g[ca_,e_,x_]:= Piecewise[{{.5ca Erf[30x-8.2]+.5ca,x<=.325},{.375ca Erfc[30x-11.8]+.25ca,.5>=x>=.325},{.25ca Erf[30x-18.1]+.5ca,.675>=x>=.5},{(.38ca-.5e)Erfc[30x-22]+e,x>=.675}}];)]

Chemical kinetics

Irreversible reaction

eqx = x'[t] == k (a0+x0-x[t])(b0+x0-x[t]);
incnd = x[0]==x0;

sol = Simplify[DSolve[{eqx,incnd},x[t],t][[1,1]]]

values = {k->1,a0->2,b0->2.5,x0->0};
Plot[Evaluate[x[t] /. sol /. values],{t,0,10},Frame->True,FrameLabel->{"t","x"},GridLines->Automatic,PlotRange->All]

Reversible reaction

eqxr = x'[t] == kp (a0+x0-x[t])(b0+x0-x[t])-km x[t](y0-x0+x[t]);
incnd = x[0]==x0;

solr = Simplify[DSolve[{eqxr,incnd},x[t],t][[1,1]]]

values = {kp->1,km->0.9,a0->2,b0->1,x0->0,y0->0};
Plot[Evaluate[x[t] /. solr /. values],{t,0,10},Frame->True,FrameLabel->{"t","x"},GridLines->Automatic,PlotRange->All]

Catalyzed reaction

sys = { c'[t] == kp s[t] (e0-c[t])- (km+k2)c[t],
 s'[t]==-kp s[t] (e0-c[t]) + km c[t]};
icnd = {c[0]==c0,s[0]==s0};
values = {kp->1,km->0.5,k2->2,c0->0,s0->1,e0->10};
prob =Flatten[ {sys,icnd} /. values]

sol=NDSolve[prob,{c[t],s[t]},{t,0,10}][[1]]

slow=Plot[ Evaluate[{c[t],s[t]} /. sol],{t,0,12},Frame->True,FrameLabel->{"t","c,s"},GridLines->Automatic,PlotRange->All,PlotLegends->{"c","s"}]

fast=Plot[ Evaluate[{c[t],s[t]} /. sol],{t,0,10},Frame->True,FrameLabel->{"t","c,s"},GridLines->Automatic,PlotRange->All,PlotLegends->{"c","s"}]

Show[{slow,fast},PlotRange->{{0,.5},All}]

Problems

Solved Problem: Basic chemical kinetics, irreversible reaction

Exercise 1, p. 270

(a) Let x(t),y(t),z(t) denote concentrations of A,B,C. Initial concentrations are x(0)=1/2, y(0)=1/3, z(0)=0. The reaction A+B->C leads to z’=k x y, and conservation of mass dC/dt=-dA/dt=-dB/dt gives z’=-x’=-y’=> 

z(t)-z(0) = x(0) - x(t) = y(0) - y(t) leading to equation z’ = k (1/2-x) (1/3-z), z(0)=0. Solve the equation

difeq=z'[t] == k ((1/2)-z[t])((1/3)-z[t]);
incnd = z[0]==0;
solz[t_]= z[t] /. DSolve[{difeq,incnd},z[t],t][[1,1]]

As above, for x(t) the equation x’ = -z’ = -k x y, with y(t)=x(t)+y(0)-x(0), gives, x’ = -k x(x-1/6)= k x (1/6-x), with solution

difeq=x'[t] == k  x[t]((1/6)-x[t]);
incnd = x[0]==1/2;
solx[t_]= x[t] /. DSolve[{difeq,incnd},x[t],t][[1,1]]

The  steady-state concentration of z(t) is lim z(t->∞)

Limit[solz[t],t->Infinity]

Find the root of the equation z(t)=0.9/3=0.3

tsol= t /. Solve[solz[t]==0.3,t][[1,1]]

Increase k by 10%

tsol /. k-> 1.1 k

Problem 1: Basic chemical kinetics, reversible reaction

Exercise 2, p. 271

Problem 2: Basic chemical kinetics, catalyzed reaction

Exercise 1, p. 276

Problem 3: Catalysis

Exercise 4, p. 278

Problem 4: Catalysis

Exercise 5, p. 278