Get["~/doc/research/first_order_singularities/mma/schofield.wl"]

SetAttributes[untilSuccess,HoldAll];
untilSuccess[e_]:=Quiet[Check[e,untilSuccess[e]]]

randomEval[eq_]:=eq/.Around[x_,y_]:>RandomVariate[NormalDistribution[x,y]]

Match ends

Generate fits

nAs=2;

s0=#1->Re[#2]&@@@untilSuccess[newSol[randomEval[eqAround[2,h[0]][1,-1,2]],{θc->1+RandomReal[],θ0->0.2},{AH,A[1],A[2]},.1]]

Timing[dGdξLowList[nAs,h[0]][6]/(Range[0,6]!)//.rules[h[0]]/.s0]

ListLogPlot[{
Abs[Gls],
Chop[Abs[dGdξLowList[2,h[0]][6]]//.rules[h[0]]/.s0]
}]

ListLogPlot[{
Abs[Ghs],
Chop[Abs@dGdξList[2,h[0]][10,0]//.rules[h[0]]/.s0]
}]

m0=annealFit[res[2,h[0],d][2]//.rules[h[0]],d,s0]

m01=FindRoot[Evaluate[D[Total[((res[2,h[0],(10^(-15))][2])^2)]//.rules[h[0]],{m0[[2,All,1]]}]],Evaluate[m0[[2]]/.Rule->List],WorkingPrecision->20,MaxIterations->5000]

m1=annealFit[res[2,h[1],δ][3]//.rules[h[1]],δ,Join[m0[[2]],{gC[1]->0}]]

m11=FindRoot[Evaluate[D[Total[((res[2,h[1],(10^(-15))][3])^2)]//.rules[h[1]],{m1[[2,All,1]]}]],Evaluate[m1[[2]]/.Rule->List],WorkingPrecision->20,MaxIterations->5000]

m2=annealFit[res[3,h[2],δ][4]//.rules[h[2]],δ,Join[m1[[2]],{gC[2]->0,A[3]->0}]]

m21=FindRoot[Evaluate[D[Total[((res[3,h[2],(10^(-15))][4])^2)]//.rules[h[2]],{m2[[2,All,1]]}]],Evaluate[m2[[2]]/.Rule->List],WorkingPrecision->20,MaxIterations->5000]

m3=annealFit[res[3,h[3],δ][5]//.rules[h[3]],δ,Join[m2[[2]],{gC[3]->0}]]

m31=FindRoot[Evaluate[D[Total[Most@((res[3,h[3],(10^(-15))][5])^2)]//.rules[h[3]],{m3[[2,All,1]]}]],Evaluate[m3[[2]]/.Rule->List],WorkingPrecision->20,MaxIterations->5000]

m4=annealFit[res[4,h[4],δ][6]//.rules[h[4]],δ,Join[m3[[2]],{gC[4]->0,A[4]->0}]]

m41=FindRoot[Evaluate[D[Total[((res[4,h[4],(10^(-15))][])^2)]//.rules[h[4]],{m4[[2,All,1]]}]],Evaluate[m4[[2]]/.Rule->List],WorkingPrecision->20,MaxIterations->5000]

m5=annealFit[res[4,h[5],δ][7]//.rules[h[5]],δ,Join[m4[[2]],{gC[5]->0}]]

m51=FindRoot[Evaluate[D[Total[((res[4,h[5],(10^(-15))][7])^2)]//.rules[h[5]],{m5[[2,All,1]]}]],Evaluate[m5[[2]]/.Rule->List],WorkingPrecision->20,MaxIterations->5000]

m6=annealFit[res[5,h[6],δ][8]//.rules[h[6]],δ,Join[m5[[2]],{gC[6]->0,A[5]->0}]]

m61=FindRoot[Evaluate[D[Total[((res[5,h[6],(10^(-15))][8])^2)]//.rules[h[6]],{m6[[2,All,1]]}]],Evaluate[m6[[2]]/.Rule->List],WorkingPrecision->20,MaxIterations->5000]

m7=annealFit[Most@res[5,h[7],δ][9]//.rules[h[7]],δ,Join[m6[[2]],{gC[7]->0}]]

m71=FindRoot[Evaluate[D[Total[((res[5,h[7],(10^(-15))][9])^2)]//.rules[h[7]],{m7[[2,All,1]]}]],Evaluate[m7[[2]]/.Rule->List],WorkingPrecision->20,MaxIterations->5000]

m8=annealFit[res[6,h[8],δ][10]//.rules[h[8]],δ,Join[m7[[2]],{gC[8]->0,A[6]->0}]]

m81=FindRoot[Evaluate[D[Total[((res[6,h[8],(10^(-15))][10])^2)]//.rules[h[8]],{m8[[2,All,1]]}]],Evaluate[m8[[2]]/.Rule->List],WorkingPrecision->20,MaxIterations->5000]

ntest=2;n1=2;
ourΦ1=dΦdηList[n1,h[0]][ntest,1]//.rules[h[0]]/.m01;
ourΦ2=dΦdηList[n1,h[1]][ntest,1]//.rules[h[1]]/.m11;
ourΦ3=dΦdηList[3,h[2]][ntest,1]//.rules[h[2]]/.m21;
ourΦ4=dΦdηList[3,h[2]][ntest,1]//.rules[h[2]]/.m31;
ourΦ5=dΦdηList[4,h[4]][ntest,1]//.rules[h[4]]/.m41;
ourΦ6=dΦdηList[4,h[5]][ntest,1]//.rules[h[5]]/.m51;
ourΦ7=dΦdηList[5,h[6]][ntest,1]//.rules[h[6]]/.m61;
ourΦ8=dΦdηList[5,h[7]][ntest,1]//.rules[h[7]]/.m71;
ourΦ9=dΦdηList[6,h[8]][ntest,1]//.rules[h[8]]/.m81;
test=((Φs[[;;ntest+1]]-#)/Φs[[;;ntest+1]])&/@{ourΦ1,ourΦ2,ourΦ3,ourΦ4,ourΦ5,ourΦ6,ourΦ7,ourΦ8,ourΦ9};

Show[ListLogLogPlot[Abs@Re@Transpose[test],Joined->True],LogLogPlot[0.0005(x^(-2)),{x,0.5,10},PlotStyle->Black]]

ListLogPlot[Abs[{ruleθ0[h[0]]/.m01,ruleθ0[h[1]]/.m11,ruleθ0[h[2]]/.m21,ruleθ0[h[3]]/.m31,ruleθ0[h[4]]/.m41,ruleθ0[h[5]]/.m51,ruleθ0[h[6]]/.m61,ruleθ0[h[7]]/.m71,ruleθ0[h[8]]/.m8[[2]]}]/.gC[0]->1,PlotRange->{(10^(-6)),(10^(
-1))}]

ListPlot[Abs[{ruleAH[h[0]]/.m01,ruleAH[h[1]]/.m11,ruleAH[h[2]]/.m21,ruleAH[h[3]]/.m31,ruleAH[h[4]]/.m41,ruleAH[h[5]]/.m51,ruleAH[h[6]]/.m61,ruleAH[h[7]]/.m71,ruleAH[h[8]]/.m8[[2]]}]/.gC[0]->1]

Stored fits

m01={θc->1.21119491859637855712121672976181324791`20.,θ0->0.18037805864637876662547309902146492111`20.,AH->-2.12939491414141908415061096249208640186`20.,A[1]->1.2447666137912675194943832370360671582`20.,A[2]->0.49992397885043029926506996142872430489`20.};

m11={θc->1.35152890616164762778517094120905354748`20.,θ0->0.19577685217395626794351230428323615065`20.,AH->-2.19329002202443521915906734872177584071`20.,A[1]->1.2323957708050473247230573917991786155`20.,A[2]->0.38993454167949585526176302950567201436`20.,gC[1]->-0.01480119866378319374012061649409943942`20.};

m21={θc->1.44826732606543626750443052210721464039`20.,θ0->0.19563567437869586038661779686289677704`20.,AH->-2.24381246052891059122067988859858612937`20.,A[1]->1.29712614684674249654921222637869204181`20.,A[2]->0.37108987555325540173113676725825610292`20.,gC[1]->-0.10859849803391633266832263540326194918`20.,gC[2]->-0.00317944766056712038023148626594881042`20.,A[3]->-0.02895083168061132881654746104306156029`20.};

m31={θc->1.47231730333795406829164341435348879632`20.,θ0->0.19553676651611357190507648227827237504`20.,AH->-2.23226520959893245256443830558689061059`20.,A[1]->1.28070451707480511625399624125304547023`20.,A[2]->0.3631836370719508085204084331441440884`20.,gC[1]->-0.1143621295363031084101244043274410552`20.,gC[2]->-0.00319213676835238378789556503183596684`20.,A[3]->-0.02903327038943439003760410093715258202`20.,gC[3]->2.09695608120214374639812905518516`20.*^-6};

m41={θc->1.40685112116988131347738999465946108103`20.,θ0->0.19721474012413645060526334873429732397`20.,AH->-2.4181833936101608806268359330715611577`20.,A[1]->1.53789467845559602032778911961941048503`20.,A[2]->0.43094482487038804352508236661378759891`20.,gC[1]->-0.20595660506372287512633079131774138659`20.,gC[2]->0.00809611950395225550558553351265800302`20.,A[3]->-0.09436173168315158121810526381523231976`20.,gC[3]->0.0042785677827476388881966506971821218`20.,gC[4]->-0.00026246183044576637272832231317920559`20.,A[4]->0.01167749987477899320520435821890714578`20.};

m51={θc->1.31630265190654504126990798607059700922`20.,θ0->0.19673889480178571425603386505667387764`20.,AH->-2.50900083782283931078340616602237669362`20.,A[1]->1.67031087534281158130313089477564731749`20.,A[2]->0.56306766534037991081905173207850130325`20.,gC[1]->-0.25713549953522877435447386379651138296`20.,gC[2]->-0.03961674425173714729077632539065329366`20.,A[3]->-0.14571077274500842786302970874523210784`20.,gC[3]->0.00475222097467538268037623052646543767`20.,gC[4]->0.00159156689838684910691438924196192437`20.,A[4]->0.00377107946158147555052135172564476592`20.,gC[5]->-0.00040849309195947277394752738192568273`20.};

m61={θc->1.30473402558862438279384169966038694306`20.,θ0->0.19664406607951774833901943811295592628`20.,AH->-2.5357690039537832228273199757845976845`20.,A[1]->1.70925197304907657860231502073565109485`20.,A[2]->0.59113509728442785240986585173891514474`20.,gC[1]->-0.27922153451404268795553330872363798882`20.,gC[2]->-0.04274889088010283689229826734918839383`20.,A[3]->-0.16924891466424059319679853386434304484`20.,gC[3]->0.00526750468100285897753499365101993439`20.,gC[4]->0.00513426762087048461311709326153702045`20.,A[4]->0.00412589655174002642884610058388901463`20.,gC[5]->-0.00156864582912082369615474351244620055`20.,gC[6]->0.0001332630841149475556949818043285057`20.,A[5]->0.0014336612326993358485643925703811874`20.};

m71={θc->1.31355404039653182669914597217190170034`20.,θ0->0.19665875841110683697922172037847911269`20.,AH->-2.53343299034841646331539418608388424723`20.,A[1]->1.70577157551054277158049213768122631914`20.,A[2]->0.58696280011958254780275098766609387839`20.,gC[1]->-0.28362958660470974751439847343277330961`20.,gC[2]->-0.04106603664706777390294072097816960584`20.,A[3]->-0.17093933071704376945795105099576307144`20.,gC[3]->0.00713245531052218542782052857426229551`20.,gC[4]->0.00453278036043904087566110942927425189`20.,A[4]->0.00520241118526903817122380025058684848`20.,gC[5]->-0.00128617871409771127507986263520036548`20.,gC[6]->0.00002668327789037362388656113497927527`20.,A[5]->0.00166817266046418252029728758844488422`20.,gC[7]->0.00001770468231070234835884333324251827`20.};

m8={10461.445570771271`,{θc->1.3165755399877996`,θ0->0.1966622586676097`,AH->-2.5326463007251494`,A[1]->1.704610793571788`,A[2]->0.5858031732617006`,gC[1]->-0.28522649008675394`,gC[2]->-0.04070402717976069`,A[3]->-0.17149012788410323`,gC[3]->0.007797122391878326`,gC[4]->0.004656040873728506`,A[4]->0.005103205021904066`,gC[5]->-0.001432754158168632`,gC[6]->0.00006084634154911762`,A[5]->0.002063010461212938`,gC[7]->0.000014182759560736414`,gC[8]->2.804302657070413`*^-7,A[6]->-0.00006191602811550506`}}

m81=FindRoot[Evaluate[D[Total[((res[6,h[8],(10^(-15))][10])^2)]//.rules[h[8]],{m8[[2,All,1]]}]],Evaluate[m8[[2]]/.Rule->List],WorkingPrecision->20,MaxIterations->5000]