Dynamic AdS/CMT - Superconductor - Spectral - Broken phase

Print["hmm"]

GRSetup2.nb - modified

(* Latest Version *)

metric={gtt,grr,gθθ,gϕϕ,gzz}

Gd=DiagonalMatrix[metric]

Gd[[1,2]]=grt

Gd[[2,1]]=grt

BuildMetric:=(Gu=FullSimplify[Inverse[Gd]];G={{u,d},IdentityMatrix[Nind]};)

BuildMetric

ind={t,r,θ,ϕ,z}

Nind=Length[ind]

getind[i1_]:=(If[IntegerQ[i1],i1,Position[ind,i1][[1,1]]])

lstind[i1_]:=(lsttmp2={};Do[AppendTo[lsttmp2,getind[i1[[lsttmp1,1]]]],{lsttmp1,1,Length[i1]}];lsttmp2)

up[i1_,i2_]:=(lsttmp2={};Do[AppendTo[lsttmp2,If[i1[[lsttmp1,2]]=!=i2[[lsttmp1]],If[i1[[lsttmp1,2]]===d,d,u],0]],{lsttmp1,1,Length[i1]}];lsttmp2)

MT[t1_,dim_,indpos_]:=(MTtmp1=0;If[Length[indpos]=!=dim,Print["Error in index position"]];Do[MTtmp1=Table[MTtmp1,{MTtmp3,1,Nind}],{MTtmp2,1,dim}];t1={indpos,MTtmp1})

ST[t1_,tind_,val_]:=(STtmp1=t1;If[up[tind,t1[[1]]]=!=Table[0,{Length[tind]}],Print["Error in Index Assignment!!"];];STtmp1[[2]]=ReplacePart[t1[[2]],val,lstind[tind]];STtmp1)

Edited the expression below as 7.0 seems to complain about Sum[x] whereas 6.0 would just return x (ie. if there is no sum index!)

GT[t1_,tind_]:=(GTtmp2=up[tind,t1[[1]]];GTtmp3="";GTtmp4="";GTtmp5="";GTtmp6=t1;
		Do[
			Switch[GTtmp2[[GTtmp1]],
				0,
				(GTtmp3=GTtmp3<>","<>ToString[getind[tind[[GTtmp1,1]]]];),
				u,
				(GTtmp3=GTtmp3<>","<>"tmpind"<>ToString[GTtmp1];
					GTtmp4=GTtmp4<>" Gu[["<>ToString[getind[tind[[GTtmp1,1]]]]<>", tmpind"<>ToString[GTtmp1]<>"]] ";
					GTtmp5=GTtmp5<>",{tmpind"<>ToString[GTtmp1]<>",1,Nind}"),
				d,
				(GTtmp3=GTtmp3<>","<>"tmpind"<>ToString[GTtmp1];
					GTtmp4=GTtmp4<>" Gd[["<>ToString[getind[tind[[GTtmp1,1]]]]<>", tmpind"<>ToString[GTtmp1]<>"]] ";
					GTtmp5=GTtmp5<>",{tmpind"<>ToString[GTtmp1]<>",1,Nind}";)];
			,{GTtmp1,1,Length[t1[[1]]]}];If[GTtmp4===""&&GTtmp5==="",ToExpression["GTtmp6[[2"<>GTtmp3<>"]]"],ToExpression["Sum[GTtmp6[[2"<>GTtmp3<>"]]"<>GTtmp4<>GTtmp5<>"]"]])

Trace, Outer Product and Covariant Derivative! - GREinstein.nb

Syntax:   trT[tensor,{{1,4},{2,3}}]   -  ie. contract 1 and 4 plus 2 and 3 positions

trT[t1_,lst_]:=(

dimt1=Length[Dimensions[t1[[2]]]];
tmpt1=t1;
Clear[tracetmp];

If[dimt1===2,

tracetmp=Sum[GT[tmpt1,{{s1,d},{s1,u}}],{s1,1,Nind}];

,

MT[tracetmp,dimt1-2Length[lst],Table[d,{ii,1,dimt1-2Length[lst]}]];

tmpstring1="";tmpstring2="";tmpstring3="";

Do[

If[{}===Position[lst,indno],
tmpstring1=tmpstring1<>"{i"<>ToString[indno]<>",d},";
tmpstring3=tmpstring3<>"{i"<>ToString[indno]<>",1,Nind},";
];

tmpstring2=tmpstring2<>"{i"<>ToString[indno]<>",d},";

,{indno,1,dimt1}];

tmpstring4="";

Do[

tmpstring4=tmpstring4<>"{s"<>ToString[indno]<>",1,Nind},";

tmpstring2=StringReplace[tmpstring2,"i"<>ToString[lst[[indno,1]]]->"s"<>ToString[indno]];

tmpstring2=StringReplace[tmpstring2,"i"<>ToString[lst[[indno,2]]]<>",d}"->"s"<>ToString[indno]<>",u}"];

,{indno,1,Length[lst]}];

tmpeval="Do[tracetmp=ST[tracetmp,{"<>StringDrop[tmpstring1,-1]<>"},Sum[GT[tmpt1,{"<>StringDrop[tmpstring2,-1]<>"}],"<>StringDrop[tmpstring4,-1]<>"]],"<>StringDrop[tmpstring3,-1]<>"]";

ToExpression[tmpeval];

];

tracetmp
)

Syntax:   outerT[tensor1,tensor2]

outerT[t1_,t2_]:=(

dimt1=Length[Dimensions[t1[[2]]]];dimt2=Length[Dimensions[t2[[2]]]];
tmpt1=t1;tmpt2=t2;
Clear[outertmp];

MT[outertmp,dimt1+dimt2,Table[d,{ii,1,dimt1+dimt2}]];

tmpstring1="";tmpstring2="";

Do[

tmpstring1=tmpstring1<>"{i"<>ToString[indno]<>",d},";
tmpstring2=tmpstring2<>"{i"<>ToString[indno]<>",1,Nind},";

,{indno,1,dimt1}];

tmpstring3="";tmpstring4="";

Do[

tmpstring3=tmpstring3<>"{j"<>ToString[indno]<>",d},";
tmpstring4=tmpstring4<>"{j"<>ToString[indno]<>",1,Nind},";

,{indno,1,dimt2}];

tmpeval="Do[outertmp=ST[outertmp,{"<>tmpstring1<>StringDrop[tmpstring3,-1]<>"},GT[tmpt1,{"<>StringDrop[tmpstring1,-1]<>"}]GT[tmpt2,{"<>StringDrop[tmpstring3,-1]<>"}]],"<>tmpstring2<>StringDrop[tmpstring4,-1]<>"]";

ToExpression[tmpeval];

outertmp

)

scalarDT[t1_]:=(

tmpt1=t1;
Clear[covDTtmp];
MT[covDTtmp,1,{d}];

tmpeval="Do[covDTtmp=ST[covDTtmp,{{i1,d}},D[tmpt1,ind[[i1]]]],{i1,1,Nind}]";

ToExpression[tmpeval];

covDTtmp

)

covDT[t1_]:=(

dimt1=Length[Dimensions[t1[[2]]]];
tmpt1=t1;
Clear[covDTtmp];
MT[covDTtmp,dimt1+1,Table[d,{ii,1,dimt1+1}]];

(* Build expression *)

tmpstring1="";tmpstring2="";tmpstring3="";

Do[

tmpstring1=tmpstring1<>"{i"<>ToString[indno]<>",d},";

tmpstring2=tmpstring2<>"{i"<>ToString[indno]<>",1,Nind},";

,{indno,1,dimt1}];

Do[
tmpstring4="-Sum[GT[tmpt1,{"<>StringDrop[tmpstring1,-1]<>"}]GT[Γ,{{REPL,d},{s1,d},{s2,u}}],{s2,1,Nind}]";

tmpstring4=StringReplace[tmpstring4,"i"<>ToString[indno]-> "s2"];

tmpstring4=StringReplace[tmpstring4,"REPL"->"i"<>ToString[indno]];

tmpstring3=tmpstring3<>tmpstring4;

,{indno,1,dimt1}];

tmpeval="Do[covDTtmp=ST[covDTtmp,{"<>tmpstring1<>"{s1,d}},D[GT[tmpt1,{"<>StringDrop[tmpstring1,-1]<>"}],ind[[s1]]]"<>tmpstring3<>"],"<>tmpstring2<>"{s1,1,Nind}]";


ToExpression[tmpeval];

covDTtmp

);

.

Buildmetric

Gd=(1/(z^2))(({{-T[v,z], -gvz[v,z], 0, 0}, {-gvz[v,z], gzz[v,z], 0, 0}, {0, 0, S[v,z]^2, 0}, {0, 0, 0, S[v,z]^2}}))

ind={v,z,x1,x2}

Nind=Length[ind]

BuildMetric;

Gd

Gu

detg=Simplify[Det[Gd]]

GRrun2.nb

Clear[Γ]

MT[Γ,3,{d,d,u}];

Clear[R4]

MT[R4,4,{d,d,d,u}];

Clear[R2]

MT[R2,2,{d,d}];

Clear[G2]

MT[G2,2,{d,d}];

Do[Γ=ST[Γ,{{ind[[i1]],d},{ind[[i2]],d},{ind[[i3]],u}},Sum[(1/2)GT[G,{{ind[[i3]],u},{ind[[ss1]],u}}](D[GT[G,{{ind[[i1]],d},{ind[[ss1]],d}}],ind[[i2]]]+D[GT[G,{{ind[[ss1]],d},{ind[[i2]],d}}],ind[[i1]]]-D[GT[G,{{ind[[i1]],d},{ind[[i2]],d}}],ind[[ss1]]]),{ss1,1,Nind}]],{i1,1,Nind},{i2,1,Nind},{i3,1,Nind}]

(* FullSimplify[Γ] *)

Γ=FullSimplify[Γ];

Do[
	R4=ST[R4,
			{{ind[[i1]],d},{ind[[i2]],d},{ind[[i3]],d},{ind[[i4]],u}},
	
			D[GT[Γ,{{ind[[i1]],d},{ind[[i3]],d},{ind[[i4]],u}}],ind[[i2]]]-D[GT[Γ,{{ind[[i2]],d},{ind[[i3]],d},{ind[[i4]],u}}],ind[[i1]]]+
			Sum[GT[Γ,{{ind[[i1]],d},{ind[[i3]],d},{ind[[ss1]],u}}]GT[Γ,{{ind[[i2]],d},{ind[[ss1]],d},{ind[[i4]],u}}]-GT[Γ,{{ind[[i2]],d},{ind[[i3]],d},{ind[[ss1]],u}}]GT[Γ,{{ind[[i1]],d},{ind[[ss1]],d},{ind[[i4]],u}}],{ss1,1,Nind}]
		
		]
		,
	{i1,1,Nind},{i2,1,Nind},{i3,1,Nind},{i4,1,Nind}]

(* FullSimplify[R4] *)

Do[R2=ST[R2,
			{{ind[[i1]],d},{ind[[i2]],d}},
			Sum[GT[R4,{{ind[[i1]],d},{ind[[ss1]],u},{ind[[i2]],d},{ind[[ss1]],d}}],{ss1,1,Nind}]
		]
	,{i1,1,Nind},{i2,1,Nind}]

(* FullSimplify[R2] *)

Ricci=Sum[GT[R2,{{ind[[ss1]],u},{ind[[ss1]],d}}],{ss1,1,Nind}];

Do[G2=ST[G2,
			{{ind[[i1]],d},{ind[[i2]],d}},
			GT[R2,{{ind[[i1]],d},{ind[[i2]],d}}]-(1/2)GT[G,{{ind[[i1]],d},{ind[[i2]],d}}]Ricci]
	,{i1,1,Nind},{i2,1,Nind}]

(* FullSimplify[G2] *)

(* FullSimplify[Ricci] *)

Einstein equations

R2=Simplify[R2];

Ricci=Simplify[Sum[GT[R2,{{ind[[ss1]],u},{ind[[ss1]],d}}],{ss1,1,Nind}]];

Clear[A];

MT[A,1,{d}];

A=ST[A,{{v,d}},av[v,z]];

A=ST[A,{{z,d}},az[v,z]];

Clear[F];

MT[F,2,{d,d}];

Do[
F=ST[F,{{i1,d},{i2,d}},D[GT[A,{{i1,d}}],ind[[i2]]]-D[GT[A,{{i2,d}}],ind[[i1]]]];
,{i1,1,Nind},{i2,1,Nind}];

trFF=Simplify[trT[outerT[F,F],{{2,4}}]];

Fsqr=Simplify[trT[trFF,{{1,2}}]];

ϕ[v_,z_]:=p[v,z]+I α[v,z]

Clear[Dp];

MT[Dp,1,{d}];

Do[
Dp=ST[Dp,{{i1,d}},D[ϕ[v,z],ind[[i1]]]-I GT[A,{{i1,d}}]ϕ[v,z]];
,{i1,1,Nind}];

ConjDp={{d},Conjugate[Dp[[2]]]};

DpDp=Simplify[ComplexExpand[trT[outerT[ConjDp,Dp],{1,2}]]];

Vterm=Simplify[-2ComplexExpand[Conjugate[ϕ[v,z]]ϕ[v,z]]];

DpDp=(DpDp/.{Re[xx_]->xx,Im[xx_]->0});

sqrtdetg=Simplify[PowerExpand[Sqrt[Det[-Gd]]]];

L=sqrtdetg(Ricci+6-(1/4)Fsqr-DpDp-Vterm)

tmp1=Simplify[Coefficient[L,{Derivative[2,0][gvz][v,z],Derivative[0,2][gvz][v,z],Derivative[1,1][gvz][v,z]}]];

tmp2=Simplify[Coefficient[L,{Derivative[2,0][gzz][v,z],Derivative[0,2][gzz][v,z],Derivative[1,1][gzz][v,z]}]];

tmp3=Simplify[Coefficient[L,{Derivative[2,0][T][v,z],Derivative[0,2][T][v,z],Derivative[1,1][T][v,z]}]];

tmp4=Simplify[Coefficient[L,{Derivative[2,0][S][v,z],Derivative[0,2][S][v,z],Derivative[1,1][S][v,z]}]];

GHBT=Simplify[D[tmp1.{Derivative[1,0][gvz][v,z],0,(1/2)Derivative[0,1][gvz][v,z]},v]+D[tmp1.{0,Derivative[0,1][gvz][v,z],(1/2)Derivative[1,0][gvz][v,z]},z]];

GHBT+=Simplify[D[tmp2.{Derivative[1,0][gzz][v,z],0,(1/2)Derivative[0,1][gzz][v,z]},v]+D[tmp2.{0,Derivative[0,1][gzz][v,z],(1/2)Derivative[1,0][gzz][v,z]},z]];

GHBT+=Simplify[D[tmp3.{Derivative[1,0][T][v,z],0,(1/2)Derivative[0,1][T][v,z]},v]+D[tmp3.{0,Derivative[0,1][T][v,z],(1/2)Derivative[1,0][T][v,z]},z]];

GHBT+=Simplify[D[tmp4.{Derivative[1,0][S][v,z],0,(1/2)Derivative[0,1][S][v,z]},v]+D[tmp4.{0,Derivative[0,1][S][v,z],(1/2)Derivative[1,0][S][v,z]},z]];

L2=L-GHBT;

tmp1=Simplify[Coefficient[L2,{Derivative[2,0][gvz][v,z],Derivative[0,2][gvz][v,z],Derivative[1,1][gvz][v,z]}]]

tmp2=Simplify[Coefficient[L2,{Derivative[2,0][gzz][v,z],Derivative[0,2][gzz][v,z],Derivative[1,1][gzz][v,z]}]]

tmp3=Simplify[Coefficient[L2,{Derivative[2,0][T][v,z],Derivative[0,2][T][v,z],Derivative[1,1][T][v,z]}]]

tmp4=Simplify[Coefficient[L2,{Derivative[2,0][S][v,z],Derivative[0,2][S][v,z],Derivative[1,1][S][v,z]}]]

EOM[fld_]:=(
tmp=D[L2,fld];
Do[
If[(tmp2=D[fld,ind[[ii]]])=!=0,
tmp-=D[D[L2,tmp2],ind[[ii]]];
]
,{ii,1,Nind}];
tmp
)

eqp=EOM[p[v,z]];

eqα=EOM[α[v,z]];

eqav=EOM[av[v,z]];

eqaz=EOM[az[v,z]];

eqgvz=EOM[gvz[v,z]];

eqgzz=EOM[gzz[v,z]];

eqT=EOM[T[v,z]];

eqS=EOM[S[v,z]];

Clear[gvz,gzz,az]

gvz[v_,z_]:=1

gzz[v_,z_]:=0

az[v_,z_]:=0

eqp2=Simplify[eqp]

eqα2=Simplify[eqα]

eqav2=Simplify[eqav]

eqaz2=Simplify[eqaz]

eqgvz2=Simplify[eqgvz]

eqgzz2=Simplify[eqgzz]

eqT2=Simplify[eqT]

eqS2=Simplify[eqS]

Evsol=Simplify[Solve[{eqgvz2==0,eqS2==0,eqp2==0,eqα2==0,eqaz==0},{Derivative[1,1][p][v,z],Derivative[1,1][α][v,z], Derivative[1,1][av][v,z], Derivative[1,1][S][v,z], Derivative[0,2][T][v,z]}][[1]]]

Momsol=Simplify[Solve[{eqT2==0,eqgzz==0,eqav==0},{Derivative[2,0][S][v,z], Derivative[0,2][S][v,z], Derivative[0,2][av][v,z]}][[1]]]

Simplify[D[eqT2,v]/.D[Evsol,z]/.Evsol/.Momsol]

Simplify[D[eqav,v]/.D[Evsol,z]/.Evsol/.Momsol]

Simplify[D[eqgzz,z]/.D[Evsol,v]/.Evsol/.Momsol]

av[v_,z_]:=a[v,z]

α[v_,z_]:=h[v,z]

Const1=Derivative[0,2][S][v,z]-(Derivative[0,2][S][v,z]/.Momsol)

Const2=Derivative[0,2][a][v,z]-(Derivative[0,2][a][v,z]/.Momsol)

Const3=Derivative[2,0][S][v,z]-(Derivative[2,0][S][v,z]/.Momsol)

Eq1=Derivative[1,1][p][v,z]-(Derivative[1,1][p][v,z]/.Evsol)

Eq2=Derivative[1,1][h][v,z]-(Derivative[1,1][h][v,z]/.Evsol)

Eq3=Derivative[1,1][a][v,z]-(Derivative[1,1][a][v,z]/.Evsol)

Eq4=Derivative[1,1][S][v,z]-(Derivative[1,1][S][v,z]/.Evsol)

Eq5=Derivative[0,2][T][v,z]-(Derivative[0,2][T][v,z]/.Evsol)

p[v_,z_]:=p[z]

h[v_,z_]:=h[z]

a[v_,z_]:=a[z]

T[v_,z_]:=T[z]

S[v_,z_]:=S[z]

ell1=Simplify[Eq1]

ell2=Simplify[Eq2]

ellc1=Simplify[Eq3]

ellc2=Simplify[Eq4]

ell3=Simplify[Eq5]

ell4=Simplify[Const1]

ell5=Simplify[Const2]

ellc3=Simplify[Const3]

sol=FullSimplify[Solve[{ell1,ell2,ell3,ell4,ell5}==0,{p''[z],h''[z],a''[z],T''[z],S''[z]}][[1]]]

Expand[ellc1]

Expand[ellc2]

Expand[ellc3]

sol2=FullSimplify[Solve[{ellc1,ellc2}==0,{T'[z],p'[z]}][[1]]]

Simplify[ellc3/.sol2]

Simplify[(D[ellc1,z]+2((S'[z])/(S[z])) ellc1)/.sol]

Simplify[D[S[z]^2ellc1,z]/.sol]

Simplify[(D[ellc2,z]-((S'[z])/(S[z])) ellc2+(2/z) ellc2)/.sol]

Simplify[D[((z^2)/(S[z]))ellc2,z]/.sol]

Print["\n\nSo, if c1 and c2 are zero, and they obey simple decoupled eqns, then c3 also zero!\n\n"]

Asymptotic expansion

p[z_]:=(z^2 p2+z^3 p3+z^4 p4+z^5 p5+z^6 p6+z^7 p7+z^8 p8+z^9 p9+z^10 p10+z^11 p11+z^12 p12);

h[z_]:=(z^2 h2+z^3 h3+z^4 h4+z^5 h5+z^6 h6+z^7 h7+z^8 h8+z^9 h9+z^10 h10+z^11 h11+z^12 h12);

a[z_]:=a0+z a1+z^2 a2+z^3 a3+z^4 a4+z^5 a5+z^6 a6+z^7 a7+z^8 a8+z^9 a9+z^10 a10+z^11 a11+z^12 a12;

T[z_]:=1+z^2T2+z^3 T3+z^4 T4+z^5 T5+z^6 T6+z^7 T7+z^8 T8+z^9 T9+z^10 T10+z^11 T11+z^12 T12;

S[z_]:=1+z^2S2+z^3 S3+z^4 S4+z^5 S5+z^6 S6+z^7 S7+z^8 S8+z^9 S9+z^10 S10+z^11 S11+z^12 S12;

Clear[repl];

runeq:=(

tmp1=Series[ellc1/.repl,{z,0,pos-1}];

tmp2=Series[ellc2/.repl,{z,0,pos-1}];

tmp3=Series[ellc3/.repl,{z,0,pos-1}];

tmp4=Series[ell1/.repl,{z,0,pos-1}];

tmp5=Series[ell2/.repl,{z,0,pos-1}];

tmp6=Series[ell3/.repl,{z,0,pos-1}];

tmp7=Series[ell4/.repl,{z,0,pos-1}];

tmp8=Series[ell5/.repl,{z,0,pos-1}];

)

repl={};

pos=1;

runeq

tmplist={tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8}

sol2=Solve[tmplist==0,{T2,S2,a2}][[1]]

repl=sol2;

pos=2;

runeq

tmplist={tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8}

sol3=Simplify[Solve[tmplist==0,{p3,h3,a3,S3}][[1]]]

repl=Join[repl,sol3];

pos=3;

runeq

tmplist={tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8}

sol4=Simplify[Solve[tmplist==0,{p4,h4,a4,S4,T4}][[1]]]

repl=Join[repl,sol4];

pos=4;

runeq

tmplist={tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8}

sol5=Simplify[Solve[tmplist==0,{p5,h5,a5,S5,T5}][[1]]]

repl=Join[repl,sol5];

pos=5;

runeq

tmplist={tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8}

sol6=Simplify[Solve[tmplist==0,{p6,h6,a6,S6,T6}][[1]]]

repl=Join[repl,sol6];

pos=6;

runeq

tmplist={tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8}

sol7=Simplify[Solve[tmplist==0,{p7,h7,a7,S7,T7}][[1]]]

repl=Join[repl,sol7];

pos=7;

runeq

tmplist={tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8}

sol8=Simplify[Solve[tmplist==0,{p8,h8,a8,S8,T8}][[1]]]

repl=Join[repl,sol8];

pos=8;

runeq

tmplist={tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8}

sol9=Simplify[Solve[tmplist==0,{p9,h9,a9,S9,T9}][[1]]]

repl=Join[repl,sol9];

pos=9;

runeq

tmplist={tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8}

sol10=Simplify[Solve[tmplist==0,{p10,h10,a10,S10,T10}][[1]]]

repl=Join[repl,sol10];

pos=10;

runeq

tmplist={tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8}

sol11=Simplify[Solve[tmplist==0,{p11,h11,a11,S11,T11}][[1]]]

repl=Join[repl,sol11];

pos=11;

runeq

tmplist={tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8}

sol12=Simplify[Solve[tmplist==0,{p12,h12,a12,S12,T12}][[1]]]

repl=Join[repl,sol12];

repl=FullSimplify[repl]

p[z]//.repl

h[z]//.repl

a[z]//.repl

T[z]//.repl

S[z]//.repl

Clear[p,h,a,T,S]

Horizon expansion

Clear[T,S,a,p,h]

Clear[repl];

runeq:=(

tmp1=Series[ellc1/.repl,{z,z0,pos}];

tmp2=Series[ellc2/.repl,{z,z0,pos}];

tmp3=Series[ellc3/.repl,{z,z0,pos}];

tmp4=Series[ell1/.repl,{z,z0,pos}];

tmp5=Series[ell2/.repl,{z,z0,pos}];

tmp6=Series[ell3/.repl,{z,z0,pos-1}];

tmp7=Series[ell4/.repl,{z,z0,pos-1}];

tmp8=Series[ell5/.repl,{z,z0,pos-1}];

)

T[z_]:=t1(z0-z)+t2 (z0-z)^2+t3(z0-z)^3+t4(z0-z)^4+t5(z0-z)^5+t6(z0-z)^6

S[z_]:=s0+s1(z0-z)+s2 (z0-z)^2+s3(z0-z)^3+s4(z0-z)^4+s5(z0-z)^5+s6(z0-z)^6

a[z_]:=a0+a1(z0-z)+a2 (z0-z)^2+a3(z0-z)^3+a4(z0-z)^4+a5(z0-z)^5+a6(z0-z)^6

p[z_]:=p0+p1(z0-z)+p2 (z0-z)^2+p3(z0-z)^3+p4(z0-z)^4+p5(z0-z)^5+p6(z0-z)^6

h[z_]:=h0+h1(z0-z)+h2 (z0-z)^2+h3(z0-z)^3+h4(z0-z)^4+h5(z0-z)^5+h6(z0-z)^6

repl={};

pos=0;

runeq

tmplist={tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8}

sol1=Simplify[Solve[tmplist==0,{a0,p1,h1,s1}][[1]]]

repl=Join[repl,sol1];

pos=1;

runeq

tmplist={tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8}

sol2=Simplify[Solve[tmplist==0,{a2,p2,h2,s2,t2}][[1]]]

repl=Join[repl,sol2];

pos=2;

runeq

tmplist={tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8}

sol3=Simplify[Solve[tmplist==0,{a3,p3,h3,s3,t3}][[1]]]

repl=Join[repl,sol3];

pos=3;

runeq

tmplist={tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8}

sol4=Simplify[Solve[tmplist==0,{a4,p4,h4,s4,t4}][[1]]]

repl=Join[repl,sol4];

pos=4;

runeq

tmplist={tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8}

sol5=Simplify[Solve[tmplist==0,{a5,p5,h5,s5,t5}][[1]]]

repl=Join[repl,sol5];

pos=5;

runeq

tmplist={tmp1,tmp2,tmp3,tmp4,tmp5,tmp6,tmp7,tmp8}

sol6=Simplify[Solve[tmplist==0,{a6,p6,h6,s6,t6}][[1]]]

repl=Join[repl,sol6];

p[z]//.repl

h[z]//.repl

a[z]//.repl

T[z]//.repl

S[z]//.repl

Clear[p,h,a,T,S]

Radial evolution equations

tmp=Simplify[Solve[{ellc1==0,ellc2==0},{T'[z],h'[z]}]]

Expand[tmp]

Simplify[ellc3/.tmp]

tmp=Simplify[Solve[{ell1==0,ell4==0,ell5==0,ellc1==0,ellc2==0},{p''[z],a''[z],S''[z],T'[z],h'[z]}]]

eqlist=Thread[{p''[z],a''[z],S''[z],T'[z],h'[z]}==({p''[z],a''[z],S''[z],T'[z],h'[z]}/.tmp[[1]])]

Summary - Must Run.

replasym={p2->asymp2,h2->asymh2,a0->asyma0,a1->asyma1,T3->asymT3};

replhoriz={t1->horizt1,a1->horiza1,p0->horizp0,h0->horizh0,s0->horizs0};

horizp[z_]:=p0-(((-z+z0) (2 p0+a1 h0 (z0^2)))/(t1 (z0^2)))+(((((-z+z0))^2) (8 (p0^3)+4 p0 (8+2 (h0^2)-4 t1 z0-(a1^2) (z0^4))+a1 h0 (z0^2) (28-8 t1 z0+(a1^2) (z0^4))))/(8 (t1^2) (z0^4)))+(1/(36 (t1^3) (z0^6)))(((-z+z0))^3) (-24 (p0^5)-24 (p0^3) (9+2 (h0^2)-3 t1 z0)+3 a1 h0 (p0^2) (z0^2) (-16+(a1^2) (z0^4))+p0 (-296-24 (h0^4)-72 (t1^2) (z0^2)+78 (a1^2) (z0^4)+6 (a1^4) (z0^8)+72 (h0^2) (-3+t1 z0)-36 t1 z0 (-8+(a1^2) (z0^4)))+3 a1 h0 (z0^2) (-108-12 (t1^2) (z0^2)-11 (a1^2) (z0^4)+(h0^2) (-16+(a1^2) (z0^4))+3 t1 z0 (28+(a1^2) (z0^4))))+(1/(2304 (t1^4) (z0^8)))(((-z+z0))^4) (1152 (p0^7)+1728 a1 h0 (p0^4) (z0^2)+192 (p0^5) (85+18 (h0^2)-24 t1 z0)+24 (p0^3) (2352+144 (h0^4)-1728 t1 z0+288 (t1^2) (z0^2)-32 (a1^2) (z0^4)+5 (a1^4) (z0^8)-16 (h0^2) (-85+24 t1 z0))-6 a1 h0 (p0^2) (z0^2) (-3664-576 (h0^2)+96 (a1^2) (z0^4)+21 (a1^4) (z0^8)-96 t1 z0 (-16+(a1^2) (z0^4)))+p0 (40960+1152 (h0^6)-4608 (t1^3) (z0^3)-12720 (a1^2) (z0^4)-3672 (a1^4) (z0^8)-27 (a1^6) (z0^12)-192 (h0^4) (-85+24 t1 z0)-3456 (t1^2) (z0^2) (-8+(a1^2) (z0^4))+384 t1 z0 (-148+39 (a1^2) (z0^4)+3 (a1^4) (z0^8))+24 (h0^2) (2352-1728 t1 z0+288 (t1^2) (z0^2)-32 (a1^2) (z0^4)+5 (a1^4) (z0^8)))+2 a1 h0 (z0^2) (23584+864 (h0^4)-1152 (t1^3) (z0^3)+5520 (a1^2) (z0^4)-30 (a1^4) (z0^8)+432 (t1^2) (z0^2) (28+(a1^2) (z0^4))-288 t1 z0 (108+11 (a1^2) (z0^4))+3 (h0^2) (3664-96 (a1^2) (z0^4)-21 (a1^4) (z0^8)+96 t1 z0 (-16+(a1^2) (z0^4)))))-(1/(57600 (t1^5) (z0^10)))(((-z+z0))^5) (23040 (p0^9)+2304 (p0^7) (193+40 (h0^2)-50 t1 z0)+96 a1 h0 (p0^6) (z0^2) (308+5 (a1^2) (z0^4))+32 (p0^5) (80860+4320 (h0^4)-51000 t1 z0+7200 (t1^2) (z0^2)+354 (a1^2) (z0^4)-75 (a1^4) (z0^8)-216 (h0^2) (-193+50 t1 z0))-12 a1 h0 (p0^4) (z0^2) (-44576+14400 t1 z0-432 (a1^2) (z0^4)+15 (a1^4) (z0^8)-24 (h0^2) (308+5 (a1^2) (z0^4)))+2 (p0^3) (2472064+46080 (h0^6)+1036800 (t1^2) (z0^2)-115200 (t1^3) (z0^3)-23856 (a1^2) (z0^4)-6216 (a1^4) (z0^8)+2235 (a1^6) (z0^12)-3456 (h0^4) (-193+50 t1 z0)+32 (h0^2) (80860-51000 t1 z0+7200 (t1^2) (z0^2)+354 (a1^2) (z0^4)-75 (a1^4) (z0^8))-1200 t1 z0 (2352-32 (a1^2) (z0^4)+5 (a1^4) (z0^8)))-6 a1 h0 (p0^2) (z0^2) (-413408-19536 (a1^2) (z0^4)+6614 (a1^4) (z0^8)+75 (a1^6) (z0^12)+4800 (t1^2) (z0^2) (-16+(a1^2) (z0^4))-48 (h0^4) (308+5 (a1^2) (z0^4))+4 (h0^2) (-44576+14400 t1 z0-432 (a1^2) (z0^4)+15 (a1^4) (z0^8))-100 t1 z0 (-3664+96 (a1^2) (z0^4)+21 (a1^4) (z0^8)))+2 p0 (1177600+11520 (h0^8)-253712 (a1^2) (z0^4)+57600 (t1^4) (z0^4)-258312 (a1^4) (z0^8)-6993 (a1^6) (z0^12)-1152 (h0^6) (-193+50 t1 z0)+57600 (t1^3) (z0^3) (-8+(a1^2) (z0^4))+16 (h0^4) (80860-51000 t1 z0+7200 (t1^2) (z0^2)+354 (a1^2) (z0^4)-75 (a1^4) (z0^8))-9600 (t1^2) (z0^2) (-148+39 (a1^2) (z0^4)+3 (a1^4) (z0^8))+50 t1 z0 (-40960+12720 (a1^2) (z0^4)+3672 (a1^4) (z0^8)+27 (a1^6) (z0^12))+(h0^2) (2472064+1036800 (t1^2) (z0^2)-115200 (t1^3) (z0^3)-23856 (a1^2) (z0^4)-6216 (a1^4) (z0^8)+2235 (a1^6) (z0^12)-1200 t1 z0 (2352-32 (a1^2) (z0^4)+5 (a1^4) (z0^8))))-a1 h0 (z0^2) (-96 (h0^6) (308+5 (a1^2) (z0^4))+12 (h0^4) (-44576+14400 t1 z0-432 (a1^2) (z0^4)+15 (a1^4) (z0^8))+5 (-511616-240464 (a1^2) (z0^4)-11520 (t1^4) (z0^4)+1296 (a1^4) (z0^8)+159 (a1^6) (z0^12)+5760 (t1^3) (z0^3) (28+(a1^2) (z0^4))-5760 (t1^2) (z0^2) (108+11 (a1^2) (z0^4))-80 t1 z0 (-11792-2760 (a1^2) (z0^4)+15 (a1^4) (z0^8)))+6 (h0^2) (-413408-19536 (a1^2) (z0^4)+6614 (a1^4) (z0^8)+75 (a1^6) (z0^12)+4800 (t1^2) (z0^2) (-16+(a1^2) (z0^4))-100 t1 z0 (-3664+96 (a1^2) (z0^4)+21 (a1^4) (z0^8)))))+(1/(4147200 (t1^6) (z0^12)))(((-z+z0))^6) (1382400 (p0^11)+46080 (p0^9) (731+150 (h0^2)-180 t1 z0)+9216 a1 h0 (p0^8) (z0^2) (178+5 (a1^2) (z0^4))+4608 (p0^7) (60521+3000 (h0^4)-34740 t1 z0+4500 (t1^2) (z0^2)+383 (a1^2) (z0^4)-50 (a1^4) (z0^8)-40 (h0^2) (-731+180 t1 z0))-1152 a1 h0 (p0^6) (z0^2) (-32684-882 (a1^2) (z0^4)+45 (a1^4) (z0^8)-32 (h0^2) (178+5 (a1^2) (z0^4))+30 t1 z0 (308+5 (a1^2) (z0^4)))+288 (p0^5) (3218720+48000 (h0^6)+1020000 (t1^2) (z0^2)-96000 (t1^3) (z0^3)+64496 (a1^2) (z0^4)-13756 (a1^4) (z0^8)+125 (a1^6) (z0^12)-960 (h0^4) (-731+180 t1 z0)+48 (h0^2) (60521-34740 t1 z0+4500 (t1^2) (z0^2)+383 (a1^2) (z0^4)-50 (a1^4) (z0^8))+40 t1 z0 (-80860-354 (a1^2) (z0^4)+75 (a1^4) (z0^8)))+36 a1 h0 (p0^4) (z0^2) (7514816+864000 (t1^2) (z0^2)+378208 (a1^2) (z0^4)-36984 (a1^4) (z0^8)+1785 (a1^6) (z0^12)+1536 (h0^4) (178+5 (a1^2) (z0^4))+120 t1 z0 (-44576-432 (a1^2) (z0^4)+15 (a1^4) (z0^8))-96 (h0^2) (-32684-882 (a1^2) (z0^4)+45 (a1^4) (z0^8)+30 t1 z0 (308+5 (a1^2) (z0^4))))-36 a1 h0 (p0^2) (z0^2) (-18272128-3170720 (a1^2) (z0^4)+579960 (a1^4) (z0^8)+16350 (a1^6) (z0^12)+45 (a1^8) (z0^16)-96000 (t1^3) (z0^3) (-16+(a1^2) (z0^4))-1024 (h0^6) (178+5 (a1^2) (z0^4))+3000 (t1^2) (z0^2) (-3664+96 (a1^2) (z0^4)+21 (a1^4) (z0^8))-60 t1 z0 (-413408-19536 (a1^2) (z0^4)+6614 (a1^4) (z0^8)+75 (a1^6) (z0^12))+96 (h0^4) (-32684-882 (a1^2) (z0^4)+45 (a1^4) (z0^8)+30 t1 z0 (308+5 (a1^2) (z0^4)))-2 (h0^2) (7514816+864000 (t1^2) (z0^2)+378208 (a1^2) (z0^4)-36984 (a1^4) (z0^8)+1785 (a1^6) (z0^12)+120 t1 z0 (-44576-432 (a1^2) (z0^4)+15 (a1^4) (z0^8))))+6 (p0^3) (193580032+1152000 (h0^8)-41472000 (t1^3) (z0^3)+6178176 (a1^2) (z0^4)+3456000 (t1^4) (z0^4)-4416240 (a1^4) (z0^8)+677328 (a1^6) (z0^12)+13725 (a1^8) (z0^16)-30720 (h0^6) (-731+180 t1 z0)+2304 (h0^4) (60521-34740 t1 z0+4500 (t1^2) (z0^2)+383 (a1^2) (z0^4)-50 (a1^4) (z0^8))+72000 (t1^2) (z0^2) (2352-32 (a1^2) (z0^4)+5 (a1^4) (z0^8))-120 t1 z0 (2472064-23856 (a1^2) (z0^4)-6216 (a1^4) (z0^8)+2235 (a1^6) (z0^12))-96 (h0^2) (-3218720-1020000 (t1^2) (z0^2)+96000 (t1^3) (z0^3)-64496 (a1^2) (z0^4)+13756 (a1^4) (z0^8)-125 (a1^6) (z0^12)-40 t1 z0 (-80860-354 (a1^2) (z0^4)+75 (a1^4) (z0^8))))-3 a1 h0 (z0^2) (-133539840-110648384 (a1^2) (z0^4)+1382400 (t1^5) (z0^5)-1007184 (a1^4) (z0^8)+319524 (a1^6) (z0^12)+1125 (a1^8) (z0^16)-864000 (t1^4) (z0^4) (28+(a1^2) (z0^4))-3072 (h0^8) (178+5 (a1^2) (z0^4))+1152000 (t1^3) (z0^3) (108+11 (a1^2) (z0^4))+24000 (t1^2) (z0^2) (-11792-2760 (a1^2) (z0^4)+15 (a1^4) (z0^8))-600 t1 z0 (-511616-240464 (a1^2) (z0^4)+1296 (a1^4) (z0^8)+159 (a1^6) (z0^12))+384 (h0^6) (-32684-882 (a1^2) (z0^4)+45 (a1^4) (z0^8)+30 t1 z0 (308+5 (a1^2) (z0^4)))-12 (h0^4) (7514816+864000 (t1^2) (z0^2)+378208 (a1^2) (z0^4)-36984 (a1^4) (z0^8)+1785 (a1^6) (z0^12)+120 t1 z0 (-44576-432 (a1^2) (z0^4)+15 (a1^4) (z0^8)))-12 (h0^2) (18272128+3170720 (a1^2) (z0^4)-579960 (a1^4) (z0^8)-16350 (a1^6) (z0^12)-45 (a1^8) (z0^16)+96000 (t1^3) (z0^3) (-16+(a1^2) (z0^4))-3000 (t1^2) (z0^2) (-3664+96 (a1^2) (z0^4)+21 (a1^4) (z0^8))+60 t1 z0 (-413408-19536 (a1^2) (z0^4)+6614 (a1^4) (z0^8)+75 (a1^6) (z0^12))))+2 p0 (691200 (h0^10)-23040 (h0^8) (-731+180 t1 z0)+2304 (h0^6) (60521-34740 t1 z0+4500 (t1^2) (z0^2)+383 (a1^2) (z0^4)-50 (a1^4) (z0^8))-144 (h0^4) (-3218720-1020000 (t1^2) (z0^2)+96000 (t1^3) (z0^3)-64496 (a1^2) (z0^4)+13756 (a1^4) (z0^8)-125 (a1^6) (z0^12)-40 t1 z0 (-80860-354 (a1^2) (z0^4)+75 (a1^4) (z0^8)))+3 (h0^2) (193580032-41472000 (t1^3) (z0^3)+6178176 (a1^2) (z0^4)+3456000 (t1^4) (z0^4)-4416240 (a1^4) (z0^8)+677328 (a1^6) (z0^12)+13725 (a1^8) (z0^16)+72000 (t1^2) (z0^2) (2352-32 (a1^2) (z0^4)+5 (a1^4) (z0^8))-120 t1 z0 (2472064-23856 (a1^2) (z0^4)-6216 (a1^4) (z0^8)+2235 (a1^6) (z0^12)))-4 (-51673600+196512 (a1^2) (z0^4)+1036800 (t1^5) (z0^5)+19930272 (a1^4) (z0^8)+1292418 (a1^6) (z0^12)+4095 (a1^8) (z0^16)+1296000 (t1^4) (z0^4) (-8+(a1^2) (z0^4))-288000 (t1^3) (z0^3) (-148+39 (a1^2) (z0^4)+3 (a1^4) (z0^8))+2250 (t1^2) (z0^2) (-40960+12720 (a1^2) (z0^4)+3672 (a1^4) (z0^8)+27 (a1^6) (z0^12))-90 t1 z0 (-1177600+253712 (a1^2) (z0^4)+258312 (a1^4) (z0^8)+6993 (a1^6) (z0^12)))))//.replhoriz;

horizh[z_]:=h0+(((-z+z0) (-2 h0+a1 p0 (z0^2)))/(t1 (z0^2)))+(((((-z+z0))^2) (8 (h0^3)+4 h0 (8+2 (p0^2)-4 t1 z0-(a1^2) (z0^4))-a1 p0 (z0^2) (28-8 t1 z0+(a1^2) (z0^4))))/(8 (t1^2) (z0^4)))+(1/(36 (t1^3) (z0^6)))(((-z+z0))^3) (-24 (h0^5)-24 (h0^3) (9+2 (p0^2)-3 t1 z0)-3 a1 (h0^2) p0 (z0^2) (-16+(a1^2) (z0^4))+h0 (-296-24 (p0^4)-72 (t1^2) (z0^2)+78 (a1^2) (z0^4)+6 (a1^4) (z0^8)+72 (p0^2) (-3+t1 z0)-36 t1 z0 (-8+(a1^2) (z0^4)))+3 a1 p0 (z0^2) (108+12 (t1^2) (z0^2)+11 (a1^2) (z0^4)+(p0^2) (16-(a1^2) (z0^4))-3 t1 z0 (28+(a1^2) (z0^4))))+(1/(2304 (t1^4) (z0^8)))(((-z+z0))^4) (1152 (h0^7)-1728 a1 (h0^4) p0 (z0^2)+192 (h0^5) (85+18 (p0^2)-24 t1 z0)+24 (h0^3) (2352+144 (p0^4)-1728 t1 z0+288 (t1^2) (z0^2)-32 (a1^2) (z0^4)+5 (a1^4) (z0^8)-16 (p0^2) (-85+24 t1 z0))+6 a1 (h0^2) p0 (z0^2) (-3664-576 (p0^2)+96 (a1^2) (z0^4)+21 (a1^4) (z0^8)-96 t1 z0 (-16+(a1^2) (z0^4)))+h0 (40960+1152 (p0^6)-4608 (t1^3) (z0^3)-12720 (a1^2) (z0^4)-3672 (a1^4) (z0^8)-27 (a1^6) (z0^12)-192 (p0^4) (-85+24 t1 z0)-3456 (t1^2) (z0^2) (-8+(a1^2) (z0^4))+384 t1 z0 (-148+39 (a1^2) (z0^4)+3 (a1^4) (z0^8))+24 (p0^2) (2352-1728 t1 z0+288 (t1^2) (z0^2)-32 (a1^2) (z0^4)+5 (a1^4) (z0^8)))+2 a1 p0 (z0^2) (-864 (p0^4)+3 (p0^2) (-3664+96 (a1^2) (z0^4)+21 (a1^4) (z0^8)-96 t1 z0 (-16+(a1^2) (z0^4)))+2 (-11792+576 (t1^3) (z0^3)-2760 (a1^2) (z0^4)+15 (a1^4) (z0^8)-216 (t1^2) (z0^2) (28+(a1^2) (z0^4))+144 t1 z0 (108+11 (a1^2) (z0^4)))))-(1/(57600 (t1^5) (z0^10)))(((-z+z0))^5) (23040 (h0^9)+2304 (h0^7) (193+40 (p0^2)-50 t1 z0)-96 a1 (h0^6) p0 (z0^2) (308+5 (a1^2) (z0^4))+32 (h0^5) (80860+4320 (p0^4)-51000 t1 z0+7200 (t1^2) (z0^2)+354 (a1^2) (z0^4)-75 (a1^4) (z0^8)-216 (p0^2) (-193+50 t1 z0))+12 a1 (h0^4) p0 (z0^2) (-44576+14400 t1 z0-432 (a1^2) (z0^4)+15 (a1^4) (z0^8)-24 (p0^2) (308+5 (a1^2) (z0^4)))+2 (h0^3) (2472064+46080 (p0^6)+1036800 (t1^2) (z0^2)-115200 (t1^3) (z0^3)-23856 (a1^2) (z0^4)-6216 (a1^4) (z0^8)+2235 (a1^6) (z0^12)-3456 (p0^4) (-193+50 t1 z0)+32 (p0^2) (80860-51000 t1 z0+7200 (t1^2) (z0^2)+354 (a1^2) (z0^4)-75 (a1^4) (z0^8))-1200 t1 z0 (2352-32 (a1^2) (z0^4)+5 (a1^4) (z0^8)))+6 a1 (h0^2) p0 (z0^2) (-413408-19536 (a1^2) (z0^4)+6614 (a1^4) (z0^8)+75 (a1^6) (z0^12)+4800 (t1^2) (z0^2) (-16+(a1^2) (z0^4))-48 (p0^4) (308+5 (a1^2) (z0^4))+4 (p0^2) (-44576+14400 t1 z0-432 (a1^2) (z0^4)+15 (a1^4) (z0^8))-100 t1 z0 (-3664+96 (a1^2) (z0^4)+21 (a1^4) (z0^8)))+2 h0 (1177600+11520 (p0^8)-253712 (a1^2) (z0^4)+57600 (t1^4) (z0^4)-258312 (a1^4) (z0^8)-6993 (a1^6) (z0^12)-1152 (p0^6) (-193+50 t1 z0)+57600 (t1^3) (z0^3) (-8+(a1^2) (z0^4))+16 (p0^4) (80860-51000 t1 z0+7200 (t1^2) (z0^2)+354 (a1^2) (z0^4)-75 (a1^4) (z0^8))-9600 (t1^2) (z0^2) (-148+39 (a1^2) (z0^4)+3 (a1^4) (z0^8))+50 t1 z0 (-40960+12720 (a1^2) (z0^4)+3672 (a1^4) (z0^8)+27 (a1^6) (z0^12))+(p0^2) (2472064+1036800 (t1^2) (z0^2)-115200 (t1^3) (z0^3)-23856 (a1^2) (z0^4)-6216 (a1^4) (z0^8)+2235 (a1^6) (z0^12)-1200 t1 z0 (2352-32 (a1^2) (z0^4)+5 (a1^4) (z0^8))))-a1 p0 (z0^2) (96 (p0^6) (308+5 (a1^2) (z0^4))-12 (p0^4) (-44576+14400 t1 z0-432 (a1^2) (z0^4)+15 (a1^4) (z0^8))+5 (511616+240464 (a1^2) (z0^4)+11520 (t1^4) (z0^4)-1296 (a1^4) (z0^8)-159 (a1^6) (z0^12)-5760 (t1^3) (z0^3) (28+(a1^2) (z0^4))+5760 (t1^2) (z0^2) (108+11 (a1^2) (z0^4))+80 t1 z0 (-11792-2760 (a1^2) (z0^4)+15 (a1^4) (z0^8)))-6 (p0^2) (-413408-19536 (a1^2) (z0^4)+6614 (a1^4) (z0^8)+75 (a1^6) (z0^12)+4800 (t1^2) (z0^2) (-16+(a1^2) (z0^4))-100 t1 z0 (-3664+96 (a1^2) (z0^4)+21 (a1^4) (z0^8)))))+(1/(4147200 (t1^6) (z0^12)))(((-z+z0))^6) (1382400 (h0^11)+46080 (h0^9) (731+150 (p0^2)-180 t1 z0)-9216 a1 (h0^8) p0 (z0^2) (178+5 (a1^2) (z0^4))+4608 (h0^7) (60521+3000 (p0^4)-34740 t1 z0+4500 (t1^2) (z0^2)+383 (a1^2) (z0^4)-50 (a1^4) (z0^8)-40 (p0^2) (-731+180 t1 z0))+1152 a1 (h0^6) p0 (z0^2) (-32684-882 (a1^2) (z0^4)+45 (a1^4) (z0^8)-32 (p0^2) (178+5 (a1^2) (z0^4))+30 t1 z0 (308+5 (a1^2) (z0^4)))+288 (h0^5) (3218720+48000 (p0^6)+1020000 (t1^2) (z0^2)-96000 (t1^3) (z0^3)+64496 (a1^2) (z0^4)-13756 (a1^4) (z0^8)+125 (a1^6) (z0^12)-960 (p0^4) (-731+180 t1 z0)+48 (p0^2) (60521-34740 t1 z0+4500 (t1^2) (z0^2)+383 (a1^2) (z0^4)-50 (a1^4) (z0^8))+40 t1 z0 (-80860-354 (a1^2) (z0^4)+75 (a1^4) (z0^8)))-36 a1 (h0^4) p0 (z0^2) (7514816+864000 (t1^2) (z0^2)+378208 (a1^2) (z0^4)-36984 (a1^4) (z0^8)+1785 (a1^6) (z0^12)+1536 (p0^4) (178+5 (a1^2) (z0^4))+120 t1 z0 (-44576-432 (a1^2) (z0^4)+15 (a1^4) (z0^8))-96 (p0^2) (-32684-882 (a1^2) (z0^4)+45 (a1^4) (z0^8)+30 t1 z0 (308+5 (a1^2) (z0^4))))+36 a1 (h0^2) p0 (z0^2) (-18272128-3170720 (a1^2) (z0^4)+579960 (a1^4) (z0^8)+16350 (a1^6) (z0^12)+45 (a1^8) (z0^16)-96000 (t1^3) (z0^3) (-16+(a1^2) (z0^4))-1024 (p0^6) (178+5 (a1^2) (z0^4))+3000 (t1^2) (z0^2) (-3664+96 (a1^2) (z0^4)+21 (a1^4) (z0^8))-60 t1 z0 (-413408-19536 (a1^2) (z0^4)+6614 (a1^4) (z0^8)+75 (a1^6) (z0^12))+96 (p0^4) (-32684-882 (a1^2) (z0^4)+45 (a1^4) (z0^8)+30 t1 z0 (308+5 (a1^2) (z0^4)))-2 (p0^2) (7514816+864000 (t1^2) (z0^2)+378208 (a1^2) (z0^4)-36984 (a1^4) (z0^8)+1785 (a1^6) (z0^12)+120 t1 z0 (-44576-432 (a1^2) (z0^4)+15 (a1^4) (z0^8))))+6 (h0^3) (193580032+1152000 (p0^8)-41472000 (t1^3) (z0^3)+6178176 (a1^2) (z0^4)+3456000 (t1^4) (z0^4)-4416240 (a1^4) (z0^8)+677328 (a1^6) (z0^12)+13725 (a1^8) (z0^16)-30720 (p0^6) (-731+180 t1 z0)+2304 (p0^4) (60521-34740 t1 z0+4500 (t1^2) (z0^2)+383 (a1^2) (z0^4)-50 (a1^4) (z0^8))+72000 (t1^2) (z0^2) (2352-32 (a1^2) (z0^4)+5 (a1^4) (z0^8))-120 t1 z0 (2472064-23856 (a1^2) (z0^4)-6216 (a1^4) (z0^8)+2235 (a1^6) (z0^12))-96 (p0^2) (-3218720-1020000 (t1^2) (z0^2)+96000 (t1^3) (z0^3)-64496 (a1^2) (z0^4)+13756 (a1^4) (z0^8)-125 (a1^6) (z0^12)-40 t1 z0 (-80860-354 (a1^2) (z0^4)+75 (a1^4) (z0^8))))+3 a1 p0 (z0^2) (-133539840-110648384 (a1^2) (z0^4)+1382400 (t1^5) (z0^5)-1007184 (a1^4) (z0^8)+319524 (a1^6) (z0^12)+1125 (a1^8) (z0^16)-864000 (t1^4) (z0^4) (28+(a1^2) (z0^4))-3072 (p0^8) (178+5 (a1^2) (z0^4))+1152000 (t1^3) (z0^3) (108+11 (a1^2) (z0^4))+24000 (t1^2) (z0^2) (-11792-2760 (a1^2) (z0^4)+15 (a1^4) (z0^8))-600 t1 z0 (-511616-240464 (a1^2) (z0^4)+1296 (a1^4) (z0^8)+159 (a1^6) (z0^12))+384 (p0^6) (-32684-882 (a1^2) (z0^4)+45 (a1^4) (z0^8)+30 t1 z0 (308+5 (a1^2) (z0^4)))-12 (p0^4) (7514816+864000 (t1^2) (z0^2)+378208 (a1^2) (z0^4)-36984 (a1^4) (z0^8)+1785 (a1^6) (z0^12)+120 t1 z0 (-44576-432 (a1^2) (z0^4)+15 (a1^4) (z0^8)))-12 (p0^2) (18272128+3170720 (a1^2) (z0^4)-579960 (a1^4) (z0^8)-16350 (a1^6) (z0^12)-45 (a1^8) (z0^16)+96000 (t1^3) (z0^3) (-16+(a1^2) (z0^4))-3000 (t1^2) (z0^2) (-3664+96 (a1^2) (z0^4)+21 (a1^4) (z0^8))+60 t1 z0 (-413408-19536 (a1^2) (z0^4)+6614 (a1^4) (z0^8)+75 (a1^6) (z0^12))))+2 h0 (691200 (p0^10)-23040 (p0^8) (-731+180 t1 z0)+2304 (p0^6) (60521-34740 t1 z0+4500 (t1^2) (z0^2)+383 (a1^2) (z0^4)-50 (a1^4) (z0^8))-144 (p0^4) (-3218720-1020000 (t1^2) (z0^2)+96000 (t1^3) (z0^3)-64496 (a1^2) (z0^4)+13756 (a1^4) (z0^8)-125 (a1^6) (z0^12)-40 t1 z0 (-80860-354 (a1^2) (z0^4)+75 (a1^4) (z0^8)))+3 (p0^2) (193580032-41472000 (t1^3) (z0^3)+6178176 (a1^2) (z0^4)+3456000 (t1^4) (z0^4)-4416240 (a1^4) (z0^8)+677328 (a1^6) (z0^12)+13725 (a1^8) (z0^16)+72000 (t1^2) (z0^2) (2352-32 (a1^2) (z0^4)+5 (a1^4) (z0^8))-120 t1 z0 (2472064-23856 (a1^2) (z0^4)-6216 (a1^4) (z0^8)+2235 (a1^6) (z0^12)))-4 (-51673600+196512 (a1^2) (z0^4)+1036800 (t1^5) (z0^5)+19930272 (a1^4) (z0^8)+1292418 (a1^6) (z0^12)+4095 (a1^8) (z0^16)+1296000 (t1^4) (z0^4) (-8+(a1^2) (z0^4))-288000 (t1^3) (z0^3) (-148+39 (a1^2) (z0^4)+3 (a1^4) (z0^8))+2250 (t1^2) (z0^2) (-40960+12720 (a1^2) (z0^4)+3672 (a1^4) (z0^8)+27 (a1^6) (z0^12))-90 t1 z0 (-1177600+253712 (a1^2) (z0^4)+258312 (a1^4) (z0^8)+6993 (a1^6) (z0^12)))))//.replhoriz;

horiza[z_]:=a1 (-z+z0)+((a1 (((-z+z0))^2) (-12+4 t1 z0+(a1^2) (z0^4)))/(4 t1 (z0^2)))+((a1 (((-z+z0))^3) (16 (h0^4)+16 (p0^4)+4 (h0^2) (28+8 (p0^2)-3 (a1^2) (z0^4))+3 (((-12+4 t1 z0+(a1^2) (z0^4)))^2)-4 (p0^2) (-28+3 (a1^2) (z0^4))))/(48 (t1^2) (z0^4)))+(1/(192 (t1^3) (z0^6)))a1 (((-z+z0))^4) (-64 (h0^6)-64 (p0^6)-16 (h0^4) (52+12 (p0^2)-12 t1 z0-3 (a1^2) (z0^4))+3 (((-12+4 t1 z0+(a1^2) (z0^4)))^3)+16 (p0^4) (-52+12 t1 z0+3 (a1^2) (z0^4))-2 (p0^2) (1712-272 (a1^2) (z0^4)+9 (a1^4) (z0^8)+24 t1 z0 (-28+3 (a1^2) (z0^4)))-2 (h0^2) (1712+96 (p0^4)-672 t1 z0-272 (a1^2) (z0^4)+72 (a1^2) t1 (z0^5)+9 (a1^4) (z0^8)-16 (p0^2) (-52+12 t1 z0+3 (a1^2) (z0^4))))+(1/(3840 (t1^4) (z0^8)))a1 (((-z+z0))^5) (1280 (h0^8)+1280 (p0^8)+32 (h0^6) (704+160 (p0^2)-160 t1 z0-35 (a1^2) (z0^4))+15 (((-12+4 t1 z0+(a1^2) (z0^4)))^4)-32 (p0^6) (-704+160 t1 z0+35 (a1^2) (z0^4))+4 (p0^4) (34544+1920 (t1^2) (z0^2)-3936 (a1^2) (z0^4)+129 (a1^4) (z0^8)+320 t1 z0 (-52+3 (a1^2) (z0^4)))+4 (h0^4) (34544+1920 (p0^4)+1920 (t1^2) (z0^2)-3936 (a1^2) (z0^4)+129 (a1^4) (z0^8)+320 t1 z0 (-52+3 (a1^2) (z0^4))-24 (p0^2) (-704+160 t1 z0+35 (a1^2) (z0^4)))-2 (p0^2) (-176768+37808 (a1^2) (z0^4)-2544 (a1^4) (z0^8)+63 (a1^6) (z0^12)+960 (t1^2) (z0^2) (-28+3 (a1^2) (z0^4))+80 t1 z0 (1712-272 (a1^2) (z0^4)+9 (a1^4) (z0^8)))+2 (h0^2) (176768+2560 (p0^6)-37808 (a1^2) (z0^4)+2544 (a1^4) (z0^8)-63 (a1^6) (z0^12)-960 (t1^2) (z0^2) (-28+3 (a1^2) (z0^4))-48 (p0^4) (-704+160 t1 z0+35 (a1^2) (z0^4))-80 t1 z0 (1712-272 (a1^2) (z0^4)+9 (a1^4) (z0^8))+4 (p0^2) (34544+1920 (t1^2) (z0^2)-3936 (a1^2) (z0^4)+129 (a1^4) (z0^8)+320 t1 z0 (-52+3 (a1^2) (z0^4)))))+(1/(691200 (t1^5) (z0^10)))a1 (((-z+z0))^6) (-230400 (h0^10)-230400 (p0^10)-1536 (h0^8) (3308+750 (p0^2)-750 t1 z0-145 (a1^2) (z0^4))+675 (((-12+4 t1 z0+(a1^2) (z0^4)))^5)+1536 (p0^8) (-3308+750 t1 z0+145 (a1^2) (z0^4))-96 (p0^6) (436032+24000 (t1^2) (z0^2)-42436 (a1^2) (z0^4)+1185 (a1^4) (z0^8)+300 t1 z0 (-704+35 (a1^2) (z0^4)))-96 (h0^6) (436032+24000 (p0^4)+24000 (t1^2) (z0^2)-42436 (a1^2) (z0^4)+1185 (a1^4) (z0^8)+300 t1 z0 (-704+35 (a1^2) (z0^4))-64 (p0^2) (-3308+750 t1 z0+145 (a1^2) (z0^4)))+4 (p0^4) (-39896512+576000 (t1^3) (z0^3)+6689136 (a1^2) (z0^4)-428964 (a1^4) (z0^8)+9225 (a1^6) (z0^12)+144000 (t1^2) (z0^2) (-52+3 (a1^2) (z0^4))+900 t1 z0 (34544-3936 (a1^2) (z0^4)+129 (a1^4) (z0^8)))-10 (p0^2) (27742208-7540032 (a1^2) (z0^4)+773616 (a1^4) (z0^8)-38412 (a1^6) (z0^12)+729 (a1^8) (z0^16)+57600 (t1^3) (z0^3) (-28+3 (a1^2) (z0^4))+7200 (t1^2) (z0^2) (1712-272 (a1^2) (z0^4)+9 (a1^4) (z0^8))+180 t1 z0 (-176768+37808 (a1^2) (z0^4)-2544 (a1^4) (z0^8)+63 (a1^6) (z0^12)))-4 (h0^4) (39896512+576000 (p0^6)-576000 (t1^3) (z0^3)-6689136 (a1^2) (z0^4)+428964 (a1^4) (z0^8)-9225 (a1^6) (z0^12)-144000 (t1^2) (z0^2) (-52+3 (a1^2) (z0^4))-2304 (p0^4) (-3308+750 t1 z0+145 (a1^2) (z0^4))-900 t1 z0 (34544-3936 (a1^2) (z0^4)+129 (a1^4) (z0^8))+72 (p0^2) (436032+24000 (t1^2) (z0^2)-42436 (a1^2) (z0^4)+1185 (a1^4) (z0^8)+300 t1 z0 (-704+35 (a1^2) (z0^4))))-2 (h0^2) (576000 (p0^8)-3072 (p0^6) (-3308+750 t1 z0+145 (a1^2) (z0^4))+144 (p0^4) (436032+24000 (t1^2) (z0^2)-42436 (a1^2) (z0^4)+1185 (a1^4) (z0^8)+300 t1 z0 (-704+35 (a1^2) (z0^4)))-4 (p0^2) (-39896512+576000 (t1^3) (z0^3)+6689136 (a1^2) (z0^4)-428964 (a1^4) (z0^8)+9225 (a1^6) (z0^12)+144000 (t1^2) (z0^2) (-52+3 (a1^2) (z0^4))+900 t1 z0 (34544-3936 (a1^2) (z0^4)+129 (a1^4) (z0^8)))+5 (27742208-7540032 (a1^2) (z0^4)+773616 (a1^4) (z0^8)-38412 (a1^6) (z0^12)+729 (a1^8) (z0^16)+57600 (t1^3) (z0^3) (-28+3 (a1^2) (z0^4))+7200 (t1^2) (z0^2) (1712-272 (a1^2) (z0^4)+9 (a1^4) (z0^8))+180 t1 z0 (-176768+37808 (a1^2) (z0^4)-2544 (a1^4) (z0^8)+63 (a1^6) (z0^12)))))//.replhoriz;

horizT[z_]:=t1 (-z+z0)+(((-z+z0))^2) (-(t1/z0)+(((a1^2) (z0^2))/2))+(((((-z+z0))^3) (144+16 (h0^4)+64 (p0^2)+16 (p0^4)+32 (h0^2) (2+(p0^2))-120 (a1^2) (z0^4)+9 (a1^4) (z0^8)))/(48 t1 (z0^4)))+(1/(48 (t1^2) (z0^6)))(((-z+z0))^4) (-16 (h0^6)-16 (p0^6)-16 (h0^4) (9+3 (p0^2)-t1 z0-(a1^2) (z0^4))+16 (p0^4) (-9+t1 z0+(a1^2) (z0^4))+(p0^2) (-400+64 t1 z0+88 (a1^2) (z0^4)-9 (a1^4) (z0^8))+3 (-12+(a1^2) (z0^4)) (12-4 t1 z0-13 (a1^2) (z0^4)+3 (a1^2) t1 (z0^5)+(a1^4) (z0^8))+(h0^2) (-400-48 (p0^4)+64 t1 z0+88 (a1^2) (z0^4)-9 (a1^4) (z0^8)+32 (p0^2) (-9+t1 z0+(a1^2) (z0^4))))+(1/(3840 (t1^3) (z0^8)))(((-z+z0))^5) (1280 (h0^8)+1280 (p0^8)+256 (h0^6) (67+20 (p0^2)-10 t1 z0-5 (a1^2) (z0^4))-256 (p0^6) (-67+10 t1 z0+5 (a1^2) (z0^4))+128 (p0^4) (604+10 (t1^2) (z0^2)-139 (a1^2) (z0^4)+7 (a1^4) (z0^8)+20 t1 z0 (-9+(a1^2) (z0^4)))+128 (h0^4) (604+60 (p0^4)+10 (t1^2) (z0^2)-139 (a1^2) (z0^4)+7 (a1^4) (z0^8)+20 t1 z0 (-9+(a1^2) (z0^4))-6 (p0^2) (-67+10 t1 z0+5 (a1^2) (z0^4)))+15 (-12+(a1^2) (z0^4)) (16 (t1^2) (z0^2) (-4+3 (a1^2) (z0^4))+(((-12+(a1^2) (z0^4)))^2) (-4+5 (a1^2) (z0^4))+32 t1 z0 (12-13 (a1^2) (z0^4)+(a1^4) (z0^8)))+4 (p0^2) (37120+1280 (t1^2) (z0^2)-18032 (a1^2) (z0^4)+2824 (a1^4) (z0^8)-99 (a1^6) (z0^12)-40 t1 z0 (400-88 (a1^2) (z0^4)+9 (a1^4) (z0^8)))+4 (h0^2) (37120+1280 (p0^6)+1280 (t1^2) (z0^2)-18032 (a1^2) (z0^4)+2824 (a1^4) (z0^8)-99 (a1^6) (z0^12)-192 (p0^4) (-67+10 t1 z0+5 (a1^2) (z0^4))-40 t1 z0 (400-88 (a1^2) (z0^4)+9 (a1^4) (z0^8))+64 (p0^2) (604+10 (t1^2) (z0^2)-139 (a1^2) (z0^4)+7 (a1^4) (z0^8)+20 t1 z0 (-9+(a1^2) (z0^4)))))-(1/(69120 (t1^4) (z0^10)))(((-z+z0))^6) (23040 (h0^10)+23040 (p0^10)+768 (h0^8) (534+150 (p0^2)-90 t1 z0-35 (a1^2) (z0^4))-768 (p0^8) (-534+90 t1 z0+35 (a1^2) (z0^4))-135 (-12+(a1^2) (z0^4)) (((-12+4 t1 z0+(a1^2) (z0^4)))^2) (24-8 t1 z0-38 (a1^2) (z0^4)+6 (a1^2) t1 (z0^5)+3 (a1^4) (z0^8))+1536 (p0^6) (45 (t1^2) (z0^2)+9 t1 z0 (-67+5 (a1^2) (z0^4))+5 (344-61 (a1^2) (z0^4)+3 (a1^4) (z0^8)))+1536 (h0^6) (150 (p0^4)+45 (t1^2) (z0^2)+9 t1 z0 (-67+5 (a1^2) (z0^4))-2 (p0^2) (-534+90 t1 z0+35 (a1^2) (z0^4))+5 (344-61 (a1^2) (z0^4)+3 (a1^4) (z0^8)))-8 (p0^4) (-979712+2880 (t1^3) (z0^3)+377424 (a1^2) (z0^4)-41376 (a1^4) (z0^8)+1431 (a1^6) (z0^12)+8640 (t1^2) (z0^2) (-9+(a1^2) (z0^4))+864 t1 z0 (604-139 (a1^2) (z0^4)+7 (a1^4) (z0^8)))-2 (p0^2) (-5474560+46080 (t1^3) (z0^3)+4248192 (a1^2) (z0^4)-902976 (a1^4) (z0^8)+62424 (a1^6) (z0^12)-1539 (a1^8) (z0^16)-2160 (t1^2) (z0^2) (400-88 (a1^2) (z0^4)+9 (a1^4) (z0^8))-108 t1 z0 (-37120+18032 (a1^2) (z0^4)-2824 (a1^4) (z0^8)+99 (a1^6) (z0^12)))+8 (h0^4) (979712+28800 (p0^6)-2880 (t1^3) (z0^3)-377424 (a1^2) (z0^4)+41376 (a1^4) (z0^8)-1431 (a1^6) (z0^12)-8640 (t1^2) (z0^2) (-9+(a1^2) (z0^4))-576 (p0^4) (-534+90 t1 z0+35 (a1^2) (z0^4))-864 t1 z0 (604-139 (a1^2) (z0^4)+7 (a1^4) (z0^8))+576 (p0^2) (45 (t1^2) (z0^2)+9 t1 z0 (-67+5 (a1^2) (z0^4))+5 (344-61 (a1^2) (z0^4)+3 (a1^4) (z0^8))))+2 (h0^2) (5474560+57600 (p0^8)-46080 (t1^3) (z0^3)-4248192 (a1^2) (z0^4)+902976 (a1^4) (z0^8)-62424 (a1^6) (z0^12)+1539 (a1^8) (z0^16)-1536 (p0^6) (-534+90 t1 z0+35 (a1^2) (z0^4))+2160 (t1^2) (z0^2) (400-88 (a1^2) (z0^4)+9 (a1^4) (z0^8))+108 t1 z0 (-37120+18032 (a1^2) (z0^4)-2824 (a1^4) (z0^8)+99 (a1^6) (z0^12))+2304 (p0^4) (45 (t1^2) (z0^2)+9 t1 z0 (-67+5 (a1^2) (z0^4))+5 (344-61 (a1^2) (z0^4)+3 (a1^4) (z0^8)))-8 (p0^2) (-979712+2880 (t1^3) (z0^3)+377424 (a1^2) (z0^4)-41376 (a1^4) (z0^8)+1431 (a1^6) (z0^12)+8640 (t1^2) (z0^2) (-9+(a1^2) (z0^4))+864 t1 z0 (604-139 (a1^2) (z0^4)+7 (a1^4) (z0^8)))))//.replhoriz;

horizS[z_]:=s0+((s0 (-z+z0) (12+4 (h0^2)+4 (p0^2)-4 t1 z0-(a1^2) (z0^4)))/(4 t1 (z0^2)))-((((h0^2)+(p0^2)) s0 (((-z+z0))^2) (4+(a1^2) (z0^4)))/(4 (t1^2) (z0^4)))-((((h0^2)+(p0^2)) s0 (((-z+z0))^3) (4 (h0^2) (-4+(a1^2) (z0^4))+4 (p0^2) (-4+(a1^2) (z0^4))+(-20+12 t1 z0-3 (a1^2) (z0^4)) (4+(a1^2) (z0^4))))/(48 (t1^3) (z0^6)))-(1/(1152 (t1^4) (z0^8)))((h0^2)+(p0^2)) s0 (((-z+z0))^4) (3200+192 (h0^4)+192 (p0^4)-3840 t1 z0+1152 (t1^2) (z0^2)+1872 (a1^2) (z0^4)-1536 (a1^2) t1 (z0^5)+288 (a1^2) (t1^2) (z0^6)+432 (a1^4) (z0^8)-144 (a1^4) t1 (z0^9)+9 (a1^6) (z0^12)+12 (p0^2) (-44+16 t1 z0-5 (a1^2) (z0^4)) (-4+(a1^2) (z0^4))+12 (h0^2) (32 (p0^2)+(-44+16 t1 z0-5 (a1^2) (z0^4)) (-4+(a1^2) (z0^4))))+(1/(23040 (t1^5) (z0^10)))((h0^2)+(p0^2)) s0 (((-z+z0))^5) (110080+2304 (h0^6)+2304 (p0^6)-192000 t1 z0+115200 (t1^2) (z0^2)-23040 (t1^3) (z0^3)+90880 (a1^2) (z0^4)-112320 (a1^2) t1 (z0^5)+46080 (a1^2) (t1^2) (z0^6)-5760 (a1^2) (t1^3) (z0^7)+35184 (a1^4) (z0^8)-25920 (a1^4) t1 (z0^9)+4320 (a1^4) (t1^2) (z0^10)+2184 (a1^6) (z0^12)-540 (a1^6) t1 (z0^13)+9 (a1^8) (z0^16)-48 (p0^4) (-816+240 t1 z0+12 (a1^2) (z0^4)-7 (a1^4) (z0^8))+48 (h0^4) (816+144 (p0^2)-240 t1 z0-12 (a1^2) (z0^4)+7 (a1^4) (z0^8))-12 (p0^2) (-12736+208 (a1^2) (z0^4)+676 (a1^4) (z0^8)+45 (a1^6) (z0^12)+480 (t1^2) (z0^2) (-4+(a1^2) (z0^4))-60 t1 z0 (-176+24 (a1^2) (z0^4)+5 (a1^4) (z0^8)))+12 (h0^2) (12736+576 (p0^4)-208 (a1^2) (z0^4)-676 (a1^4) (z0^8)-45 (a1^6) (z0^12)-480 (t1^2) (z0^2) (-4+(a1^2) (z0^4))-8 (p0^2) (-816+240 t1 z0+12 (a1^2) (z0^4)-7 (a1^4) (z0^8))+60 t1 z0 (-176+24 (a1^2) (z0^4)+5 (a1^4) (z0^8))))-(1/(345600 (t1^6) (z0^12)))((h0^2)+(p0^2)) s0 (((-z+z0))^6) (3033600+23040 (h0^8)+23040 (p0^8)-6604800 t1 z0+5760000 (t1^2) (z0^2)-2304000 (t1^3) (z0^3)+3436352 (a1^2) (z0^4)+345600 (t1^4) (z0^4)-5452800 (a1^2) t1 (z0^5)+3369600 (a1^2) (t1^2) (z0^6)-921600 (a1^2) (t1^3) (z0^7)+1799472 (a1^4) (z0^8)+86400 (a1^2) (t1^4) (z0^8)-2111040 (a1^4) t1 (z0^9)+777600 (a1^4) (t1^2) (z0^10)-86400 (a1^4) (t1^3) (z0^11)+228828 (a1^6) (z0^12)-131040 (a1^6) t1 (z0^13)+16200 (a1^6) (t1^2) (z0^14)+3735 (a1^8) (z0^16)-540 (a1^8) t1 (z0^17)-96 (p0^6) (-5464+1440 t1 z0-38 (a1^2) (z0^4)-5 (a1^4) (z0^8))+96 (h0^6) (5464+960 (p0^2)-1440 t1 z0+38 (a1^2) (z0^4)+5 (a1^4) (z0^8))+8 (p0^4) (432320+43200 (t1^2) (z0^2)+9576 (a1^2) (z0^4)+2658 (a1^4) (z0^8)+585 (a1^6) (z0^12)-360 t1 z0 (816-12 (a1^2) (z0^4)+7 (a1^4) (z0^8)))+8 (h0^4) (432320+17280 (p0^4)+43200 (t1^2) (z0^2)+9576 (a1^2) (z0^4)+2658 (a1^4) (z0^8)+585 (a1^6) (z0^12)-36 (p0^2) (-5464+1440 t1 z0-38 (a1^2) (z0^4)-5 (a1^4) (z0^8))-360 t1 z0 (816-12 (a1^2) (z0^4)+7 (a1^4) (z0^8)))+(p0^2) (6998016+1009984 (a1^2) (z0^4)-480048 (a1^4) (z0^8)-90804 (a1^6) (z0^12)-2205 (a1^8) (z0^16)+115200 (t1^3) (z0^3) (-4+(a1^2) (z0^4))-21600 (t1^2) (z0^2) (-176+24 (a1^2) (z0^4)+5 (a1^4) (z0^8))+720 t1 z0 (-12736+208 (a1^2) (z0^4)+676 (a1^4) (z0^8)+45 (a1^6) (z0^12)))+(h0^2) (6998016+92160 (p0^6)+1009984 (a1^2) (z0^4)-480048 (a1^4) (z0^8)-90804 (a1^6) (z0^12)-2205 (a1^8) (z0^16)+115200 (t1^3) (z0^3) (-4+(a1^2) (z0^4))-288 (p0^4) (-5464+1440 t1 z0-38 (a1^2) (z0^4)-5 (a1^4) (z0^8))-21600 (t1^2) (z0^2) (-176+24 (a1^2) (z0^4)+5 (a1^4) (z0^8))+720 t1 z0 (-12736+208 (a1^2) (z0^4)+676 (a1^4) (z0^8)+45 (a1^6) (z0^12))+16 (p0^2) (432320+43200 (t1^2) (z0^2)+9576 (a1^2) (z0^4)+2658 (a1^4) (z0^8)+585 (a1^6) (z0^12)-360 t1 z0 (816-12 (a1^2) (z0^4)+7 (a1^4) (z0^8)))))//.replhoriz;

asymp[z_]:=p2 (z^2)+a0 h2 (z^3)+(1/6) (3 a1 h2-4 (a0^2) p2) (z^4)+(1/3) (-(a0^3) h2-2 a0 a1 p2-p2 T3) (z^5)+(1/60) (-30 (a0^2) a1 h2+8 (a0^4) p2-15 (a1^2) p2+14 p2 ((h2^2)+(p2^2))-35 a0 h2 T3) (z^6)+(1/180) (8 (a0^5) h2+48 (a0^3) a1 p2+a0 (-69 (a1^2) h2+60 h2 ((h2^2)+(p2^2)))-66 a1 h2 T3+99 (a0^2) p2 T3) (z^7)+(((280 (a0^4) a1 h2-315 (a1^3) h2-32 (a0^6) p2+504 a1 h2 ((h2^2)+(p2^2))+(a0^2) (806 (a1^2) p2-860 p2 ((h2^2)+(p2^2)))+896 (a0^3) h2 T3+1649 a0 a1 p2 T3+500 p2 (T3^2)) (z^8))/2520)+(1/1260)(-4 (a0^7) h2-48 (a0^5) a1 p2+(a0^3) h2 (235 (a1^2)-324 ((h2^2)+(p2^2)))+8 a0 a1 p2 (33 (a1^2)-61 ((h2^2)+(p2^2)))-2 (-386 (a0^2) a1 h2+110 (a0^4) p2-183 (a1^2) p2+167 p2 ((h2^2)+(p2^2))) T3+535 a0 h2 (T3^2)) (z^9)+(1/90720)(-1008 (a0^6) a1 h2+64 (a0^8) p2+36 (a0^2) a1 h2 (469 (a1^2)-1093 ((h2^2)+(p2^2)))+4 (a0^4) p2 (-1906 (a1^2)+3641 ((h2^2)+(p2^2)))+54 p2 (105 (a1^4)-298 (a1^2) ((h2^2)+(p2^2))+162 ((((h2^2)+(p2^2)))^2))-2 a0 (3132 (a0^4) h2+17768 (a0^2) a1 p2+9 h2 (-2756 (a1^2)+2443 ((h2^2)+(p2^2)))) T3+(26388 a1 h2-42517 (a0^2) p2) (T3^2)) (z^10)+(1/453600)(2 a0 (32 (a0^8) h2+640 (a0^6) a1 p2+38 (a0^2) a1 p2 (-680 (a1^2)+2129 ((h2^2)+(p2^2)))+2 (a0^4) h2 (-3506 (a1^2)+9625 ((h2^2)+(p2^2)))+3 h2 (8445 (a1^4)-27322 (a1^2) ((h2^2)+(p2^2))+11384 ((((h2^2)+(p2^2)))^2)))+2 (-43168 (a0^4) a1 h2+5180 (a0^6) p2+12 a1 h2 (3795 (a1^2)-6062 ((h2^2)+(p2^2)))+(a0^2) p2 (-122040 (a1^2)+132161 ((h2^2)+(p2^2)))) T3-5 a0 (31441 (a0^2) h2+54768 a1 p2) (T3^2)-64000 p2 (T3^3)) (z^11)+(1/9979200)(6336 (a0^8) a1 h2-256 (a0^10) p2+198 a1 h2 (105 (a1^2)-302 ((h2^2)+(p2^2))) (15 (a1^2)-16 ((h2^2)+(p2^2)))-16 (a0^6) p2 (-5999 (a1^2)+24481 ((h2^2)+(p2^2)))+44 (a0^4) a1 h2 (-12114 (a1^2)+52981 ((h2^2)+(p2^2)))-4 (a0^2) p2 (261441 (a1^4)-1083379 (a1^2) ((h2^2)+(p2^2))+493120 ((((h2^2)+(p2^2)))^2))+2 a0 (32384 (a0^6) h2+372148 (a0^4) a1 p2+44 (a0^2) h2 (-40939 (a1^2)+57354 ((h2^2)+(p2^2)))+a1 p2 (-1957536 (a1^2)+3601319 ((h2^2)+(p2^2)))) T3+(-6405487 (a0^2) a1 h2+1911860 (a0^4) p2+4 p2 (-739971 (a1^2)+683452 ((h2^2)+(p2^2)))) (T3^2)-3376120 a0 h2 (T3^3)) (z^12)//.replasym;

asymh[z_]:=h2 (z^2)-a0 p2 (z^3)+(1/6) (-4 (a0^2) h2-3 a1 p2) (z^4)+(1/3) (-2 a0 a1 h2+(a0^3) p2-h2 T3) (z^5)+(1/60) (8 (a0^4) h2-15 (a1^2) h2+30 (a0^2) a1 p2+14 h2 ((h2^2)+(p2^2))+35 a0 p2 T3) (z^6)+(1/180) (48 (a0^3) a1 h2-8 (a0^5) p2+a0 (69 (a1^2) p2-60 p2 ((h2^2)+(p2^2)))+99 (a0^2) h2 T3+66 a1 p2 T3) (z^7)+(((-32 (a0^6) h2-280 (a0^4) a1 p2+63 a1 p2 (5 (a1^2)-8 ((h2^2)+(p2^2)))+(a0^2) (806 (a1^2) h2-860 h2 ((h2^2)+(p2^2)))+1649 a0 a1 h2 T3-896 (a0^3) p2 T3+500 h2 (T3^2)) (z^8))/2520)+(1/1260)(-48 (a0^5) a1 h2+4 (a0^7) p2+8 a0 a1 h2 (33 (a1^2)-61 ((h2^2)+(p2^2)))+(a0^3) p2 (-235 (a1^2)+324 ((h2^2)+(p2^2)))-2 (110 (a0^4) h2-183 (a1^2) h2+386 (a0^2) a1 p2+167 h2 ((h2^2)+(p2^2))) T3-535 a0 p2 (T3^2)) (z^9)+(1/90720)(64 (a0^8) h2+1008 (a0^6) a1 p2+36 (a0^2) a1 p2 (-469 (a1^2)+1093 ((h2^2)+(p2^2)))+4 (a0^4) h2 (-1906 (a1^2)+3641 ((h2^2)+(p2^2)))+54 h2 (105 (a1^4)-298 (a1^2) ((h2^2)+(p2^2))+162 ((((h2^2)+(p2^2)))^2))+2 a0 (-17768 (a0^2) a1 h2+3132 (a0^4) p2+9 p2 (-2756 (a1^2)+2443 ((h2^2)+(p2^2)))) T3-(42517 (a0^2) h2+26388 a1 p2) (T3^2)) (z^10)+(1/453600)(2 a0 (640 (a0^6) a1 h2-32 (a0^8) p2+38 (a0^2) a1 h2 (-680 (a1^2)+2129 ((h2^2)+(p2^2)))-2 (a0^4) p2 (-3506 (a1^2)+9625 ((h2^2)+(p2^2)))-3 p2 (8445 (a1^4)-27322 (a1^2) ((h2^2)+(p2^2))+11384 ((((h2^2)+(p2^2)))^2)))+2 (5180 (a0^6) h2+43168 (a0^4) a1 p2+12 a1 p2 (-3795 (a1^2)+6062 ((h2^2)+(p2^2)))+(a0^2) h2 (-122040 (a1^2)+132161 ((h2^2)+(p2^2)))) T3+5 a0 (-54768 a1 h2+31441 (a0^2) p2) (T3^2)-64000 h2 (T3^3)) (z^11)+(1/9979200)(-256 (a0^10) h2-6336 (a0^8) a1 p2+44 (a0^4) a1 p2 (12114 (a1^2)-52981 ((h2^2)+(p2^2)))-198 a1 p2 (105 (a1^2)-302 ((h2^2)+(p2^2))) (15 (a1^2)-16 ((h2^2)+(p2^2)))-16 (a0^6) h2 (-5999 (a1^2)+24481 ((h2^2)+(p2^2)))-4 (a0^2) h2 (261441 (a1^4)-1083379 (a1^2) ((h2^2)+(p2^2))+493120 ((((h2^2)+(p2^2)))^2))+2 a0 (372148 (a0^4) a1 h2-32384 (a0^6) p2-44 (a0^2) p2 (-40939 (a1^2)+57354 ((h2^2)+(p2^2)))+a1 h2 (-1957536 (a1^2)+3601319 ((h2^2)+(p2^2)))) T3+(1911860 (a0^4) h2+6405487 (a0^2) a1 p2+4 h2 (-739971 (a1^2)+683452 ((h2^2)+(p2^2)))) (T3^2)+3376120 a0 p2 (T3^3)) (z^12)//.replasym;

asyma[z_]:=a0+a1 z+(1/6) a0 ((h2^2)+(p2^2)) (z^4)+(1/6) a1 ((h2^2)+(p2^2)) (z^5)-(1/45) (a0^3) ((h2^2)+(p2^2)) (z^6)-(5/126) a0 ((h2^2)+(p2^2)) (a0 a1+2 T3) (z^7)+((((h2^2)+(p2^2)) (4 (a0^5)+a0 (-85 (a1^2)+127 ((h2^2)+(p2^2)))-200 a1 T3) (z^8))/2520)+((((h2^2)+(p2^2)) (98 (a0^4) a1+9 a1 (-45 (a1^2)+139 ((h2^2)+(p2^2)))+448 (a0^3) T3) (z^9))/22680)-((a0 ((h2^2)+(p2^2)) (8 (a0^6)+(a0^2) (-905 (a1^2)+2224 ((h2^2)+(p2^2)))-4250 a0 a1 T3-5480 (T3^2)) (z^10))/113400)-((((h2^2)+(p2^2)) ((a0^2) a1 (162 (a0^4)-5735 (a1^2)+23903 ((h2^2)+(p2^2)))+a0 (1314 (a0^4)-25115 (a1^2)+36858 ((h2^2)+(p2^2))) T3-30410 a1 (T3^2)) (z^11))/623700)+(1/14968800)((h2^2)+(p2^2)) (32 (a0^9)+(a0^5) (-11756 (a1^2)+58132 ((h2^2)+(p2^2)))+9 a0 (10845 (a1^4)-55822 (a1^2) ((h2^2)+(p2^2))+33662 ((((h2^2)+(p2^2)))^2))-90872 (a0^4) a1 T3+72 a1 (4905 (a1^2)-13168 ((h2^2)+(p2^2))) T3-247250 (a0^3) (T3^2)) (z^12)//.replasym;

asymT[z_]:=1+T3 (z^3)+(1/12) (3 (a1^2)-4 ((h2^2)+(p2^2))) (z^4)+(1/6) (a0^2) ((h2^2)+(p2^2)) (z^6)+(1/9) ((h2^2)+(p2^2)) (2 a0 a1+T3) (z^7)-(1/630) ((h2^2)+(p2^2)) (14 (a0^4)-75 (a1^2)+38 ((h2^2)+(p2^2))) (z^8)-(1/180) (a0^2) ((h2^2)+(p2^2)) (9 a0 a1+16 T3) (z^9)+((((h2^2)+(p2^2)) (36 (a0^6)+(a0^2) (-1385 (a1^2)+1628 ((h2^2)+(p2^2)))-2900 a0 a1 T3-860 (T3^2)) (z^10))/22680)+((((h2^2)+(p2^2)) (4 a0 a1 (24 (a0^4)-195 (a1^2)+482 ((h2^2)+(p2^2)))+(387 (a0^4)-1335 (a1^2)+1096 ((h2^2)+(p2^2))) T3) (z^11))/18900)-((((h2^2)+(p2^2)) (88 (a0^8)+3 (a0^4) (-4485 (a1^2)+9886 ((h2^2)+(p2^2)))+9 (2025 (a1^4)-7905 (a1^2) ((h2^2)+(p2^2))+2908 ((((h2^2)+(p2^2)))^2))-63515 (a0^3) a1 T3-67735 (a0^2) (T3^2)) (z^12))/1247400)//.replasym;

asymS[z_]:=1+(1/6) (-(h2^2)-(p2^2)) (z^4)+(1/36) (a0^2) ((h2^2)+(p2^2)) (z^6)+(1/63) ((h2^2)+(p2^2)) (a0 a1+5 T3) (z^7)-((((h2^2)+(p2^2)) (7 (a0^4)-45 (a1^2)+111 ((h2^2)+(p2^2))) (z^8))/2520)-(((a0^2) ((h2^2)+(p2^2)) (13 a0 a1+74 T3) (z^9))/3240)+((((h2^2)+(p2^2)) (18 (a0^6)+(a0^2) (-785 (a1^2)+2519 ((h2^2)+(p2^2)))-1670 a0 a1 T3-5750 (T3^2)) (z^10))/113400)+((((h2^2)+(p2^2)) (a0 a1 (26 (a0^4)+3 (-85 (a1^2)+426 ((h2^2)+(p2^2))))+3 (79 (a0^4)-545 (a1^2)+1342 ((h2^2)+(p2^2))) T3) (z^11))/69300)-((((h2^2)+(p2^2)) (88 (a0^8)+(a0^4) (-15940 (a1^2)+82193 ((h2^2)+(p2^2)))+27 (1575 (a1^4)-9430 (a1^2) ((h2^2)+(p2^2))+9886 ((((h2^2)+(p2^2)))^2))-82660 (a0^3) a1 T3-275950 (a0^2) (T3^2)) (z^12))/14968800)//.replasym;

eqlist={p''[z]==-(2 (z^2) ((a[z])^2) (((h[z])^2)+((p[z])^2)) S[z] (z ((h[z])^2) S[z] p'[z]+z ((p[z])^2) S[z] p'[z]-4 p[z] (S[z]-z S'[z]))-4 z a[z] h[z] T[z] ((z^2) ((h[z])^2) ((S[z])^2) ((p'[z])^2)+2 z p[z] S[z] p'[z] (-S[z]+z S'[z])+((p[z])^2) (((S[z])^2) (2+(z^2) ((p'[z])^2))-4 z S[z] S'[z]+2 (z^2) ((S'[z])^2)))+T[z] (4 z ((p[z])^4) ((S[z])^2) p'[z]+2 (z^3) ((h[z])^2) ((S[z])^2) T[z] ((p'[z])^3)-8 ((p[z])^3) S[z] (S[z]-z S'[z])+z ((p[z])^2) (4 ((h[z])^2) ((S[z])^2) p'[z]+4 z h[z] S[z] a'[z] (S[z]-z S'[z])+p'[z] (((S[z])^2) (12-(z^4) ((a'[z])^2)+2 T[z] (-2+(z^2) ((p'[z])^2)))+4 (z^2) T[z] ((S'[z])^2)))))/(4 (z^2) ((p[z])^2) S[z] ((T[z])^2) (-S[z]+z S'[z])),a''[z]==((2 (a[z] (((h[z])^2)+((p[z])^2)) S[z]-(z^2) T[z] a'[z] S'[z]))/((z^2) S[z] T[z])),S''[z]==-(((((h[z])^2)+((p[z])^2)) S[z] (((a[z])^2) (((h[z])^2)+((p[z])^2))-2 a[z] h[z] T[z] p'[z]+((T[z])^2) ((p'[z])^2)))/(2 ((p[z])^2) ((T[z])^2))),T'[z]==(2 (z^2) ((a[z])^2) (((((h[z])^2)+((p[z])^2)))^2) ((S[z])^2)-4 (z^2) a[z] h[z] (((h[z])^2)+((p[z])^2)) ((S[z])^2) T[z] p'[z]+T[z] (4 ((p[z])^4) ((S[z])^2)+2 (z^2) ((h[z])^2) ((S[z])^2) T[z] ((p'[z])^2)+((p[z])^2) (((S[z])^2) (12+4 ((h[z])^2)-(z^4) ((a'[z])^2)+2 T[z] (-6+(z^2) ((p'[z])^2)))+16 z S[z] T[z] S'[z]-4 (z^2) T[z] ((S'[z])^2))))/(4 z ((p[z])^2) S[z] T[z] (-S[z]+z S'[z])),h'[z]==((-a[z] (((h[z])^2)+((p[z])^2))+h[z] T[z] p'[z])/(p[z] T[z]))};

Numerics

Clear[inteq,zhoriz,eps];

inteq[z0in_Real,horizp0in_Real,horiza1in_Real,horizt1in_Real,horizs0in_Real,asymp2in_Real,asymh2in_Real,asyma0in_Real,asyma1in_Real,asymT3in_Real,output_]:=(

z0=z0in;

horizp0=horizp0in;

horizh0=0;

horiza1=horiza1in;

horizt1=horizt1in;

horizs0=horizs0in;

asymp2=asymp2in;

asymh2=asymh2in;

asyma0=asyma0in;

asyma1=asyma1in;

asymT3=asymT3in;


eps=0.01 ;

eps2=0.001 ;

zmid = 0.4;

zhoriz=1-eps2;

nsol1=NDSolve[Join[eqlist,{p[eps]==asymp[eps],p'[eps]==asymp'[eps],h[eps]==asymh[eps],a[eps]==asyma[eps],a'[eps]==asyma'[eps],T[eps]==asymT[eps],S[eps]==asymS[eps],S'[eps]==asymS'[eps]}],{p,h,a,T,S},{z,eps,zhoriz}][[1]];

zcut1=nsol1[[1,2,1,1,2]];

If[zcut1<zmid,Print["Error  ",zcut2]];

nsol2=NDSolve[Join[eqlist,{p[zhoriz]==horizp[zhoriz],p'[zhoriz]==horizp'[zhoriz],h[zhoriz]==horizh[zhoriz],a[zhoriz]==horiza[zhoriz],a'[zhoriz]==horiza'[zhoriz],T[zhoriz]==horizT[zhoriz],S[zhoriz]==horizS[zhoriz],S'[zhoriz]==horizS'[zhoriz]}],{p,h,a,T,S},{z,eps,zhoriz}][[1]];

zcut2=nsol2[[1,2,1,1,1]];

If[zcut2>zmid,Print["Error  ",zcut2]];

Clear[horizp0,horizh0,horiza1,horizt1,horizs0,asymp2,asymh2,asyma0,asyma1,asymT3];

If[output==1,

(*Return[{h'[eps],T'[eps]}/.nsol2];*)

htab=Table[{z,h[z]/.nsol2},{z,20eps,100eps,10eps}];

Ttab=Table[{z,T[z]-1/.nsol2},{z,20eps,100eps,10eps}];

hfit=Fit[htab,{z,z^2},z];

Tfit=Fit[Ttab,{z,z^2},z];

Return[{Coefficient[hfit,z],Coefficient[Tfit,z]}];


];

If[output==2,

list={(p[zmid]/.nsol1)-(p[zmid]/.nsol2),(h[zmid]/.nsol1)-(h[zmid]/.nsol2),(a[zmid]/.nsol1)-(a[zmid]/.nsol2),(T[zmid]/.nsol1)-(T[zmid]/.nsol2),(S[zmid]/.nsol1)-(S[zmid]/.nsol2)};

dlist={(p'[zmid]/.nsol1)-(p'[zmid]/.nsol2),(a'[zmid]/.nsol1)-(a'[zmid]/.nsol2),(S'[zmid]/.nsol1)-(S'[zmid]/.nsol2)};

Return[Join[list,{dlist[[1]],dlist[[2]],dlist[[3]]}]];

];


If[output==0,

ptab=Table[{z,p[z]/.nsol2},{z,20eps,100eps,10eps}];

htab=Table[{z,h[z]/.nsol2},{z,20eps,100eps,10eps}];

atab=Table[{z,a[z]/.nsol2},{z,20eps,100eps,10eps}];

Ttab=Table[{z,T[z]-1/.nsol2},{z,20eps,100eps,10eps}];

Stab=Table[{z,S[z]/.nsol2},{z,20eps,100eps,10eps}];

pfit=Fit[ptab,{z,z^2},z];

hfit=Fit[htab,{z,z^2},z];

afit=Fit[atab,{1,z},z];

Tfit=Fit[Ttab,{z,z^2,z^3},z];

Sfit=Fit[Stab,{1,z},z];

pfit2=Fit[ptab,{z^2},z];

hfit2=Fit[htab,{z^2},z];

Tfit2=Fit[Ttab,{z^3},z];

Return[{{pf==pfit,hf==hfit,af==afit,Tf==Tfit,Sf==Sfit},{pfit2,hfit2,Tfit2}}];

];

);

"inteq[z0,horizp0,horiza1,horizt1,horizs0,asymp2,asymh2,asyma0,asyma1,asymT3,output_]"

a[z_]:=q(1-z)

T[z_]:=1-(1+((q^2)/4)) z^3+((q^2)/4) z^4

S[z_]:=1

Simplify[-a'[1]]

Simplify[-T'[1]]

Clear[a,T,S]

inteq[1.,0.0001,q,3.-((q^2)/4),1.,0.0001,0.0001,q,-q,-(1.+((q^2)/4)),2]/.{q->0.3};

plt1=Plot[T[z]/.nsol1,{z,eps,zcut1}];

plt2=Plot[T[z]/.nsol2,{z,zcut2,zhoriz}];

Show[plt1,plt2]

q=0.3;

solx=FindRoot[inteq[1.,x1,q,x2,x3,x4,x5,x6,x7,x8,2],{x1,0.001},{x2,3.},{x3,1.},{x4,0.001},{x5,0.001},{x6,q},{x7,-q},{x8,-(1.+((q^2)/4))}]

inteq[1.,x1,q,x2,x3,x4,x5,x6,x7,x8,2]/.solx

q=0.3427;

vec={0.000001,3.-((q^2)/4),1.,0.000001,0.000001,q,-q,-(1.+((q^2)/4))};

mat={};

eq0=inteq[1.,vec[[1]],q,vec[[2]],vec[[3]],vec[[4]],vec[[5]],vec[[6]],vec[[7]],vec[[8]],2];

DX = 0.0001;

Do[

vec0=vec;

vec0[[jj]]-=DX ;

eq1=inteq[1.,vec0[[1]],q,vec0[[2]],vec0[[3]],vec0[[4]],vec0[[5]],vec0[[6]],vec0[[7]],vec0[[8]],2];

vec0[[jj]]+=2*DX ;

eq2=inteq[1.,vec0[[1]],q,vec0[[2]],vec0[[3]],vec0[[4]],vec0[[5]],vec0[[6]],vec0[[7]],vec0[[8]],2];

AppendTo[mat,(eq2-eq1)/(2*DX)];

,{jj,1,8}];

Print["det = ",Det[mat]];

dvec=Inverse[Transpose[mat]].eq0;

vec = vec-dvec;

Print["vec = ",vec,"  ->  eq = ",eq0];

Clear[q];

matlist={};

Do[

vec={0.0000000000001,3.-((q^2)/4),1.,0.0000000000001,0.0000000000001,q,-q,-(1.+((q^2)/4))};

mat={};

eq0=inteq[1.,vec[[1]],q,vec[[2]],vec[[3]],vec[[4]],vec[[5]],vec[[6]],vec[[7]],vec[[8]],2];

DX = 0.000001;

Do[

vec0=vec;

vec0[[jj]]-=DX ;

eq1=inteq[1.,vec0[[1]],q,vec0[[2]],vec0[[3]],vec0[[4]],vec0[[5]],vec0[[6]],vec0[[7]],vec0[[8]],2];

vec0[[jj]]+=2*DX ;

eq2=inteq[1.,vec0[[1]],q,vec0[[2]],vec0[[3]],vec0[[4]],vec0[[5]],vec0[[6]],vec0[[7]],vec0[[8]],2];

AppendTo[mat,(eq2-eq1)/(2*DX)];

,{jj,1,8}];

tmp=Eigenvalues[mat];

Print["q = ",q,"\n\n    evals = ",Sort[Abs[tmp]],"\n\n"];

AppendTo[matlist,{q,Eigenvalues[mat]}];

,{q,0.1,3.3,0.1}];

Clear[q];

q=2.979;

vec={0.0000000000001,3.-((q^2)/4),1.,0.0000000000001,0.0000000000001,q,-q,-(1.+((q^2)/4))};

mat={};

eq0=inteq[1.,vec[[1]],q,vec[[2]],vec[[3]],vec[[4]],vec[[5]],vec[[6]],vec[[7]],vec[[8]],2];

DX = 0.000001;

Do[

vec0=vec;

vec0[[jj]]-=DX ;

eq1=inteq[1.,vec0[[1]],q,vec0[[2]],vec0[[3]],vec0[[4]],vec0[[5]],vec0[[6]],vec0[[7]],vec0[[8]],2];

vec0[[jj]]+=2*DX ;

eq2=inteq[1.,vec0[[1]],q,vec0[[2]],vec0[[3]],vec0[[4]],vec0[[5]],vec0[[6]],vec0[[7]],vec0[[8]],2];

AppendTo[mat,(eq2-eq1)/(2*DX)];

,{jj,1,8}];

Print["det = ",Det[mat]];

dvec=Inverse[Transpose[mat]].eq0;

vec = vec-dvec;

Print["vec = ",vec,"  ->  eq = ",eq0];

Eigenvalues[mat]

Eigensystem[mat][[1]]

Eigensystem[mat][[2,-1]]

evec={-0.8940344494134517`,-0.4044619181215`,3.3346699386897934`*^-7,-7.75137404251833`*^-12,-5.683965098262476`*^-13,0.19264724252179596`,-1.3338732284597615`*^-7,-2.873927593868073`*^-7};

mat.evec/evec

"inteq[z0,horizp0,horiza1,horizt1,horizs0,asymp2,asymh2,asyma0,asyma1,asymT3,output_]";

"inteq[1.,vec[[1]],q,vec[[2]],vec[[3]],vec[[4]],vec[[5]],vec[[6]],vec[[7]],vec[[8]],2]";

evec={-0.894,-0.404,0.,0.,0.,0.193,0.,0.};

q=3.0;

vec={0.0000000000001,3.-((q^2)/4),1.,0.0000000000001,0.0000000000001,q,-q,-(1.+((q^2)/4))}-0.2*evec;

mat={};

eq0=inteq[1.,vec[[1]],q,vec[[2]],vec[[3]],vec[[4]],vec[[5]],vec[[6]],vec[[7]],vec[[8]],2];

DX = 0.000001;

Do[

vec0=vec;

vec0[[jj]]-=DX ;

eq1=inteq[1.,vec0[[1]],q,vec0[[2]],vec0[[3]],vec0[[4]],vec0[[5]],vec0[[6]],vec0[[7]],vec0[[8]],2];

vec0[[jj]]+=2*DX ;

eq2=inteq[1.,vec0[[1]],q,vec0[[2]],vec0[[3]],vec0[[4]],vec0[[5]],vec0[[6]],vec0[[7]],vec0[[8]],2];

AppendTo[mat,(eq2-eq1)/(2*DX)];

,{jj,1,8}];

Print["det = ",Det[mat]];

dvec=Inverse[Transpose[mat]].eq0;

vec = vec-dvec;

Print["vec = ",vec,"  ->  eq = ",eq0];