Gr=Plot[{Exp[-(1/6)(((Log[x]))^2)],Exp[-(3/2)(((Log[x]))^2)-0.5],0},{x,0,1},PlotStyle->{Black,{Thick,Blue},{Thick,Red}},Filling->{1->Axis},FillingStyle->Opacity[0.1],AxesLabel->{Style[Exp[-a],18],Style[Exp[-α],18]}]

Export["D:/research/strings/FTDT/stab.png",Gr]

Plot[{6 (x^2),(1/((3/(2 (x^2)))+0.2))},{x,0,5}]

ContourPlot[{2((b^2)+(a^2))/2+3b-1==0,3 b+2==0},{b,-5,5},{a,-5,5}]

C0=1;C1=4;C2=1;C3=1;
C0p=-1;C1p=3;C2p=-3;C3p=-1;
p1={C1/C0,C2/C0};
p2={2C2/C1,3C3/C1};
p1p={C1p/C0p,C2p/C0p};
BMT[b_]:=-((3C0 C3-C1 C2)b+(2 (C2^2)-3C1 C3))/((C1^2)-2 C0 C2);
wall[b_]:=-((C0 C2p-C2 C0p)b+( C2 C1p-C1 C2p))/(C1 C0p- C0 C1p);
sol=Solve[wall[b]==(b^2)/2];
blim=b/.sol;
wall0[b_]:=wall[b]+100000(HeavisideTheta[blim[[1]] -b]+HeavisideTheta[b-blim[[2]]]);
Gr=Plot[{(b^2)/2,BMT[b],wall[b]},{b,-5,5},PlotStyle->{Blue,{Thick,Red},{Thick,Green}},Epilog->{PointSize[0.02],Magenta,Inset[Style["ϖ(γ)" ,16],p1+{-0.1,0.6}],Point[p1],Blue,Inset[Style["ϖ(γ)" ,16],p2+{0.22,0.6}],Inset[Style["∼" ,18],p2+{-0.07,0.88}],Point[p2], Magenta,Inset[Style["ϖ(γ')" ,16],p1p+{-0.2,-0.5}],Point[p1p],Red,Inset[Style["(Subscript[ℓ, f])(γ)" ,16],{-4.2,0.9}],Black,Inset[Style["U" ,20],{2,6}]},Axes->True,Frame->False,Filling->{1->Top,2->Top},FillingStyle->Opacity[0.1],AxesLabel->{Style[b,14],Style[w,14]},PlotRange->{0,6.5}]

Export["D:/research/strings/FTDT/curves.pdf",Gr]

Gr=Plot[{(b^2)/2,BMT[b]},{b,-5,5},PlotStyle->{Blue,{Thick,Red},{Thick,Green}},Epilog->{PointSize[0.02],Magenta,Inset[Style["ϖ(γ)" ,16],p1+{-0.1,0.6}],Point[p1],Blue,Inset[Style["ϖ(γ)" ,16],p2+{0.22,0.6}],Inset[Style["∼" ,18],p2+{-0.07,0.88}],Point[p2], Magenta,Inset[Style["ϖ(γ')" ,16],p1p+{-0.2,-0.5}],Point[p1p],Red,Inset[Style["(Subscript[ℓ, f])(γ)" ,16],{-4.2,0.9}],Black,Inset[Style["U" ,20],{2,6}]},Axes->True,Frame->False,Filling->{1->Top,2->Top},FillingStyle->Opacity[0.1],AxesLabel->{Style[b,14],Style[w,14]},PlotRange->{0,6.5}]

Export["D:/research/strings/FTDT/curves0.gif",Gr]

(* plot in (x,\alpha) plane - green line is Castelnuovo bound, orange line is when BMT line is tangent to parabola *)
fcon[x_]:=Which[0<x<1,x+1/2,1<=x<15/8,Sqrt[2x+1/4],15/8<=x<9/4,2/3x+3/4,9/4<=x<3,1/3x+3/2,3<=x,1/2x+1,x<0,-10];
Pl=Plot[{fcon[x],Sqrt[2x],3/4(x+1)},{x,0,4},PlotRange->{1,4},Epilog->{Dashed,Line[{{1,0},{1,3/2}}],Line[{{15/8,0},{15/8,2}}],Line[{{9/4,0},{9/4,9/4}}],Line[{{3,0},{3,5/2}}]}];
Show[Pl,Table[ParametricPlot[xan[x,0,n],{n,0,4},PlotStyle->Dotted],{x,0,4,1/2}],AxesLabel->{Style[x,14],Style[α,14]},Ticks->{{1/2,1,15/8,9/4,3,4},{1,2,3,4}}]

SetDirectory[NotebookDirectory[]];Export["../xaplot.pdf",Pl]

Pl=Plot[{1/2x(x+1)-2/3x fcon[x],-2/3 x(Sqrt[2x]-3/4(x+1))},{x,0,4},PlotRange->{0,2.2},Epilog->{Green,Line[{{0,0},{4,0}}],Thin,Black,Dashed,Line[{{15/8,0},{15/8,25/228}}],Line[{{9/4,0},{9/4,9/32}}],Line[{{3,0},{3,1}}],Dotted,Table[Line[{{0,k/2},{4,k/2}}],{k,1,4}]}];
Show[Pl,AxesLabel->{Style[x,14],Style[δ,14]},Ticks->{{1/2,1,15/8,9/4,3,4},{0,1,2,3}}]

SetDirectory[NotebookDirectory[]];Export["../deltaplot.pdf",Pl]

(* improved BG inequality / BMT inequality for the quintic *)
ChunyLi[x_]:=Which[0<x<1/4,-1/2Abs[x],1/4<x<3/4,1/2Abs[x]-1/4,3/4<x<1,3/2Abs[x]-1,x>1 || x<0,ChunyLi[x-Floor[x]]+x Floor[x]-1/2 Floor[x]^2];
Pl=Plot[{1/2 x^2,ChunyLi[x],1/2 x^2+1/2(x-Floor[x])(1-x+Floor[x])},{x,-2.5,2.5},AxesLabel->{Style[b,14],Style[w,14]},Ticks->{{-2,-1,1,2},{0,1,2,3}}]

SetDirectory[NotebookDirectory[]];Export["../LiX5.png",%]

(* improved BG inequality / BMT inequality for X42 *)
ClearAll[ChunyLi];ChunyLi[x_]:=Which[0<x<(4-Sqrt[13])/3,x^2-x,(4-Sqrt[13])/3<x<1/2,5/8x^2-1/8,1/2<x<(Sqrt[13]-1)/3,5/8x^2-x/4, (Sqrt[13]-1)/3<x<1,x^2-1/2,x>1 || x<0,ChunyLi[x-Floor[x]]+x Floor[x]-1/2 Floor[x]^2];
Pl=Plot[{1/2 x^2,ChunyLi[x],1/2 x^2+1/2(x-Floor[x])(1-x+Floor[x])},{x,-2.5,2.5},AxesLabel->{Style[b,14],Style[w,14]},Ticks->{{-2,-1,1,2},{0,1,2,3}}]

SetDirectory[NotebookDirectory[]];Export["../LiX42.png",%]