Skip to content

Commit 52d4385

Browse files
authored
H_t and related functions for small x evaluations
1 parent 95ef5c9 commit 52d4385

File tree

1 file changed

+81
-63
lines changed

1 file changed

+81
-63
lines changed
Lines changed: 81 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
\p 30
1+
\p 100
22

33
alpha1(s) = return(1/(2*s) + 1/(s-1) + (1/2)*log(s/(2*Pi)));
44
alpha1prime(s) = return(-1/(2*s^2) - 1/(s-1)^2 + 1/(2*s));
@@ -7,63 +7,56 @@ S(N,sigmavar,t) = return(sum(n=1,N,n^(sigmavar + (t/4.0)*log(N^2/n))));
77
C0(p) = return((exp(Pi*I*(p^2/2 + 3/8)) - I*sqrt(2)*cos(Pi*p/2))/(2*cos(Pi*p)));
88
B0_eff(x,y=0.4,t=0.4) = return((1/8)*exp((t/4)*alpha1((1+y-I*x)/2)^2)*H01((1+y-I*x)/2));
99

10-
tail_factor1(t,th,x,n0,a) = return(2*(Pi^2)*exp(-t*th^2 - th*x - Pi*(n0^2)*cos(4*th))/(4*Pi*(n0^2)*cos(4*th) - a));
11-
tail_factor2(t,th,x,n0,a) = return(3*Pi*exp(-t*th^2 - th*x - Pi*(n0^2)*cos(4*th))/(4*Pi*(n0^2)*cos(4*th) - a));
12-
integ_tail1(t,th,X,n,a) = return(2*(Pi^2)*(n^4)*exp(-t*th^2 + t*X^2 - (Pi*n^2)*exp(4*X)*cos(4*th) - th*x + a*X)/(4*(Pi*n^2)*exp(4*X)*cos(4*th) - a - 2*t*X));
13-
integ_tail2(t,th,X,n,a) = return(3*Pi*(n^2)*exp(-t*th^2 + t*X^2 - (Pi*n^2)*exp(4*X)*cos(4*th) - th*x + a*X)/(4*(Pi*n^2)*exp(4*X)*cos(4*th) - a - 2*t*X));
14-
I_t_th(t,th,X,b,beta) = return(intnum(u=I*th,[I*th+X,Pi/8],exp(t*u^2 - beta*exp(4*u) + I*b*u)));
15-
I_t_th(t,th,X,b,beta) = return(intnum(u=I*th,I*th+X,exp(t*u^2 - beta*exp(4*u) + I*b*u)));
16-
J_t_th(t,th,X,b,beta) = return(intnum(u=I*th,I*th+X,u*exp(t*u^2 - beta*exp(4*u) + I*b*u)));
10+
thetafunc(x,y=0.4) = return(Pi/8 - atan((9+y)/x));
11+
alph_factor1(alph,n1) = return((n1^4)/(1-alph) + (4*n1^3)*alph/(1-alph)^2 + 6*(n1^2)*(alph^2 + alph)/(1-alph)^3 + 4*n1*(alph^3 + 4*alph^2 + alph)/(1-alph)^4 + (alph^4 + 11*alph^3 + 11*alph^2 + alph)/(1-alph)^5);
12+
alph_factor2(alph,n1) = return((n1^2)/(1-alph) + 2*n1*alph/(1-alph)^2 + (alph^2 + alph)/(1-alph)^3);
13+
tail_factor(t,th,x,n1,a) = return(exp(-t*th^2 - th*x - Pi*(n1^2)*cos(4*th))/(4*Pi*(n1^2)*cos(4*th) - a));
14+
ddx_tail_factor(t,th,x,n1,a) = return(exp(-t*th^2 - th*x - Pi*(n1^2)*cos(4*th))*(th/(4*Pi*(n1^2)*cos(4*th) - a) + 1/(4*Pi*(n1^2)*cos(4*th) - a)^2));
15+
integ_tail(t,th,X,n,a) = return(exp(-t*th^2 + t*X^2 - (Pi*n^2)*exp(4*X)*cos(4*th) - th*x + a*X)/(4*(Pi*n^2)*exp(4*X)*cos(4*th) - a - 2*t*X));
16+
ddx_integ_tail(t,th,X,n,a) = return(exp(-t*th^2 + t*X^2 - (Pi*n^2)*exp(4*X)*cos(4*th) - th*x + a*X)*(abs(X+I*th)*4*(Pi*n^2)*exp(4*X)*cos(4*th)-a-2*t*X+ 1/(4*(Pi*n^2)*exp(4*X)*cos(4*th) - a - 2*t*X)^2));
17+
I_t_th(t,th,X,b,beta,mstep=4) = return(intnum(u=I*th,I*th+X,exp(t*u^2 - beta*exp(4*u) + I*b*u),mstep));
18+
J_t_th(t,th,X,b,beta,mstep=4) = return(intnum(u=I*th,I*th+X,u*exp(t*u^2 - beta*exp(4*u) + I*b*u),mstep));
19+
Jbound_t_th(t,th,X,a,beta) = return(exp(-t*th^2)*intnum(u=0,X,(th+u)*exp(t*u^2 - beta*exp(4*u)*cos(4*th) + a*u)));
1720

18-
Ht_int_old(x,y=0.4,t=0.4,n0=5) = return(sum(n=1,n0,intnum(u=0,2,exp(t*u^2)*cos((x+I*y)*u)*(2*(Pi^2)*(n^4)*exp(9*u) - 3*Pi*(n^2)*exp(5*u))*exp(-Pi*(n^2)*exp(4*u)))));
19-
ddx_Ht_int_old(x,y=0.4,t=0.4,n0=5) = return((I/2)*sum(n=1,n0,intnum(u=0,2,u*exp(t*u^2)*cos((x+I*y)*u)*(2*(Pi^2)*(n^4)*exp(9*u) - 3*Pi*(n^2)*exp(5*u))*exp(-Pi*(n^2)*exp(4*u)))));
20-
newton_quot_Ht_int_old(x,y=0.4,t=0.4,h=0.000001,n0=5) = return((Ht_int_old(x+h,y=0.4,t=0.4,n0)-Ht_int_old(x,y=0.4,t=0.4,n0))/h);
21-
22-
Ht_integral(x,y=0.4,t=0.4) = {
23-
n0 = 4;
24-
X = 2;
25-
th = Pi/8 - atan((9+y)/x);
26-
alph = exp(-Pi*n0*cos(th));
27-
alph_factor1 = (n0^4)/(1-alph) + (4*n0^3)*alph/(1-alph)^2 + 6*(n0^2)*(alph^2 + alph)/(1-alph)^3 + 4*n0*(alph^3 + 4*alph^2 + alph)/(1-alph)^4 + (alph^4 + 11*alph^3 + 11*alph^2 + alph)/(1-alph)^5;
28-
alph_factor2 = (n0^2)/(1-alph) + 2*n0*alph/(1-alph)^2 + (alph^2 + alph)/(1-alph)^3;
29-
30-
sum_tail1 = (tail_factor1(t,th,x,n0,9+y) + tail_factor1(t,th,x,n0,9-y))*alph_factor1;
31-
sum_tail2 = (tail_factor2(t,th,x,n0,5+y) + tail_factor2(t,th,x,n0,5-y))*alph_factor2;
32-
33-
sum_tail3 = sum(n=1,n0-1,integ_tail1(t,th,X,n,9+y)) + sum(n=1,n0-1,integ_tail1(t,th,X,n,9-y));
34-
sum_tail4 = sum(n=1,n0-1,integ_tail1(t,th,X,n,5+y)) + sum(n=1,n0-1,integ_tail1(t,th,X,n,5-y));
35-
36-
overall_tail = 0.5*(sum_tail1 + sum_tail2 + sum_tail3 + sum_tail4);
37-
38-
main_est1 = sum(n=1,n0-1,2*(Pi^2)*(n^4)*(I_t_th(t,th,X,x-(9-y)*I,Pi*n^2) + conj(I_t_th(t,th,X,x-(9+y)*I,Pi*n^2))));
39-
main_est2 = sum(n=1,n0-1,3*Pi*(n^2)*(I_t_th(t,th,X,x-(5-y)*I,Pi*n^2) + conj(I_t_th(t,th,X,x-(5+y)*I,Pi*n^2))));
40-
main_est = 0.5*(main_est1 - main_est2);
21+
Ht_integral(x,y=0.4,t=0.4,n0=6,X=6) = {
22+
th = thetafunc(x,y);
23+
main_est1 = 2*(Pi^2)*sum(n=1,n0,(n^4)*(I_t_th(t,th,X,x-(9-y)*I,Pi*n^2) + conj(I_t_th(t,th,X,x-(9+y)*I,Pi*n^2))));
24+
main_est2 = 3*Pi*sum(n=1,n0,(n^2)*(I_t_th(t,th,X,x-(5-y)*I,Pi*n^2) + conj(I_t_th(t,th,X,x-(5+y)*I,Pi*n^2))));
25+
main_est = (1/2)*(main_est1 - main_est2);
4126
return(main_est);
4227
}
4328

44-
ddx_Ht_integral(x,y=0.4,t=0.4) = {
45-
n0 = 4;
46-
X = 2;
47-
th = Pi/8 - atan((9+y)/x);
48-
alph = exp(-Pi*n0*cos(th));
49-
alph_factor1 = (n0^4)/(1-alph) + (4*n0^3)*alph/(1-alph)^2 + 6*(n0^2)*(alph^2 + alph)/(1-alph)^3 + 4*n0*(alph^3 + 4*alph^2 + alph)/(1-alph)^4 + (alph^4 + 11*alph^3 + 11*alph^2 + alph)/(1-alph)^5;
50-
alph_factor2 = (n0^2)/(1-alph) + 2*n0*alph/(1-alph)^2 + (alph^2 + alph)/(1-alph)^3;
51-
52-
sum_tail1 = (tail_factor1(t,th,x,n0,9+y) + tail_factor1(t,th,x,n0,9-y))*alph_factor1;
53-
sum_tail2 = (tail_factor2(t,th,x,n0,5+y) + tail_factor2(t,th,x,n0,5-y))*alph_factor2;
54-
55-
sum_tail3 = sum(n=1,n0-1,integ_tail1(t,th,X,n,9+y)) + sum(n=1,n0-1,integ_tail1(t,th,X,n,9-y));
56-
sum_tail4 = sum(n=1,n0-1,integ_tail1(t,th,X,n,5+y)) + sum(n=1,n0-1,integ_tail1(t,th,X,n,5-y));
57-
58-
overall_tail = 0.5*(sum_tail1 + sum_tail2 + sum_tail3 + sum_tail4);
59-
60-
main_est1 = sum(n=1,n0-1,2*(Pi^2)*(n^4)*(J_t_th(t,th,X,x-(9-y)*I,Pi*n^2) - conj(I_t_th(t,th,X,x-(9+y)*I,Pi*n^2))));
61-
main_est2 = sum(n=1,n0-1,3*Pi*(n^2)*(I_t_th(t,th,X,x-(5-y)*I,Pi*n^2) - conj(I_t_th(t,th,X,x-(5+y)*I,Pi*n^2))));
29+
Ht_integral_err(x,y=0.4,t=0.4,n0=6,X=6) = {
30+
th = thetafunc(x,y);
31+
n1 = n0+1;
32+
alph = exp(-Pi*n1*cos(4*th));
33+
sum_tail1 = 2*(Pi^2)*(tail_factor(t,th,x,n1,9+y) + tail_factor(t,th,x,n1,9-y))*alph_factor1(alph,n1);
34+
sum_tail2 = 3*Pi*(tail_factor(t,th,x,n1,5+y) + tail_factor(t,th,x,n1,5-y))*alph_factor2(alph,n1);
35+
sum_tail3 = 2*(Pi^2)*sum(n=1,n0,(n^4)*(integ_tail(t,th,X,n,9+y) + integ_tail(t,th,X,n,9-y)));
36+
sum_tail4 = 3*Pi*sum(n=1,n0,(n^2)*(integ_tail(t,th,X,n,5+y) + integ_tail(t,th,X,n,5-y)));
37+
overall_tail = (1/2)*(sum_tail1 + sum_tail2 + sum_tail3 + sum_tail4);
38+
return(overall_tail);
39+
}
40+
41+
ddx_Ht_integral(x,y=0.4,t=0.4,n0=6,X=6) = {
42+
th = thetafunc(x,y);
43+
main_est1 = 2*(Pi^2)*sum(n=1,n0,(n^4)*(J_t_th(t,th,X,x-(9-y)*I,Pi*n^2) - conj(J_t_th(t,th,X,x-(9+y)*I,Pi*n^2))));
44+
main_est2 = 3*Pi*sum(n=1,n0,(n^2)*(J_t_th(t,th,X,x-(5-y)*I,Pi*n^2) - conj(J_t_th(t,th,X,x-(5+y)*I,Pi*n^2))));
6245
main_est = (I/2)*(main_est1 - main_est2);
6346
return(main_est);
6447
}
6548

66-
newton_quot_Ht_integral(x,y=0.4,t=0.4,h=0.0001) = return((Ht_integral(x+h,y,t)-Ht_integral(x,y,t))/h);
49+
ddx_Ht_integral_err(x,y=0.4,t=0.4,n0=6,X=6) = {
50+
th = thetafunc(x,y);
51+
n1 = n0+1;
52+
alph = exp(-Pi*n1*cos(4*th));
53+
sum_tail1 = 2*(Pi^2)*(ddx_tail_factor(t,th,x,n1,9+y) + ddx_tail_factor(t,th,x,n1,9-y))*alph_factor1(alph,n1);
54+
sum_tail2 = 3*Pi*(ddx_tail_factor(t,th,x,n1,5+y) + ddx_tail_factor(t,th,x,n1,5-y))*alph_factor2(alph,n1);
55+
sum_tail3 = 2*(Pi^2)*sum(n=1,n0,(n^4)*(ddx_integ_tail(t,th,X,n,9+y) + ddx_integ_tail(t,th,X,n,9-y)));
56+
sum_tail4 = 3*Pi*sum(n=1,n0,(n^2)*(ddx_integ_tail(t,th,X,n,5+y) + ddx_integ_tail(t,th,X,n,5-y)));
57+
overall_tail = (1/2)*(sum_tail1 + sum_tail2 + sum_tail3 + sum_tail4);
58+
return(overall_tail);
59+
}
6760

6861
abceff_x(x,y=0.4,t=0.4) = {
6962
T = x/2;
@@ -85,25 +78,50 @@ abceff_x(x,y=0.4,t=0.4) = {
8578
B = B0 * B_sum;
8679
termC1 = Pi^(-sdash/2)*gamma(sdash/2)*(a^(-sig))*C0(p)*U;
8780
termC2 = Pi^(-(1-sdash)/2)*gamma((1-sdash)/2)*(a^(-(1-sig)))*conj(C0(p))*conj(U);
88-
C = exp(t*Pi^2/64)*(sdash*(sdash-1)/2)*(-1^N)*(termC1 + termC2);
81+
C = exp(t*Pi^2/64)*(sdash*(sdash-1)/2)*((-1)^N)*(termC1 + termC2);
8982
return((A+B-C)/8);
9083
}
9184

92-
x=11;n=1;X=2;y=0.4;t=0.4;a=9+y;beta = Pi*n^2;th = Pi/8 - atan((9+y)/x);lhs=beta*exp(4*X)*cos(4*th);rhs=max(t/2,(a+2*t*X)/4)
93-
print(x," ",X," ",lhs," ",rhs);
85+
abeff_x(x,y=0.4,t=0.4) = {
86+
T = x/2;
87+
Tdash = T + Pi*t/8;
88+
a=sqrt(Tdash/(2*Pi));
89+
N=floor(a);
90+
p = 1 - 2*(a-N);
91+
U = exp(-I*((Tdash/2)*log(Tdash/(2*Pi)) - Tdash/2 - Pi/8));
92+
sig = (1-y)/2;
93+
s = sig + I*T;
94+
sdash = sig + I*Tdash;
95+
alph1 = alpha1(s);
96+
alph2 = alpha1(1-s);
97+
A0 = exp((t/4)*alph1^2)*H01(s);
98+
B0 = exp((t/4)*alph2^2)*H01(1-s);
99+
A_sum = sum(n=1,N,n^((t/4.0)*log(n) - (t/2.0)*alph1 - s));
100+
B_sum = sum(n=1,N,n^((t/4.0)*log(n) - (t/2.0)*alph2 - (1-s)));
101+
A = A0 * A_sum;
102+
B = B0 * B_sum;
103+
return((A+B)/8);
104+
}
105+
106+
ddx_Ht_bound(x,y=0.4,t=0.4,n0=50,X=6) = {
107+
th = Pi/8 - atan((9+y)/x);
108+
main_est1 = 2*(Pi^2)*sum(n=1,n0,(n^4)*(Jbound_t_th(t,th,X,(9-y),Pi*n^2) + Jbound_t_th(t,th,X,(9+y),Pi*n^2)));
109+
main_est2 = 3*Pi*sum(n=1,n0,(n^2)*(Jbound_t_th(t,th,X,(5-y),Pi*n^2) + Jbound_t_th(t,th,X,(5+y),Pi*n^2)));
110+
main_est = (1/2)*(main_est1 + main_est2);
111+
print(main_est);
112+
return(main_est);
113+
}
94114

95-
x=11;n=4;y=0.4;t=0.4;a=9+y;th = Pi/8 - atan((9+y)/x);lhs=Pi*(n^2)*cos(th);rhs=max(t/2,a/4)
96-
print(x," ",lhs," ",rhs);
115+
newton_quot_Ht_integral(x,y=0.4,t=0.4,h=0.0001) = return((Ht_integral(x+h,y,t)-Ht_integral(x,y,t))/h);
116+
newton_quot_abc(x,y=0.4,t=0.4,h=0.0001) = return((abceff_x(x+h,y,t)-abceff_x(x,y,t))/h);
117+
newton_quot_ab(x,y=0.4,t=0.4,h=0.0001) = return((abeff_x(x+h,y,t)-abeff_x(x,y,t))/h);
97118

98-
x=1;
99-
print(Ht_integral(x)/B0_eff(x),"\n",Ht_int_old(x)/B0_eff(x),"\n",abceff_x(x)/B0_eff(x))
100119

101-
x=25;
102-
print(Ht_integral(x)/B0_eff(x),"\n",abceff_x(x)/B0_eff(x))
103120

104-
x=1;
105-
print(Ht_int_old(x)/B0_eff(x),"\n",ddx_Ht_int_old(x)/B0_eff(x),"\n",newton_quot_Ht_int_old(x)/B0_eff(x));
121+
\\for(x=20,300,print(x," ",abs(Ht_integral(x)/B0_eff(x))*precision(1., 10)," ",abs(abceff_x(x)/B0_eff(x))*precision(1., 10)," ",\
122+
abs(ddx_Ht_integral(x)/B0_eff(x))*precision(1., 10)));
106123

107-
x=25;
108-
print(Ht_integral(x)/B0_eff(x),"\n",ddx_Ht_integral(x)/B0_eff(x),"\n",newton_quot_Ht_integral(x)/B0_eff(x));
124+
\\for(x=20,100,print(x," ",abs(ddx_Ht_integral(x)/newton_quot_abc(x,0.4,0.4,0.0000001))*precision(1., 10)));
109125

126+
\\xc=1600;y=0.4;thc = Pi/8 - atan((9+y)/xc);D = ddx_Ht_bound(xc);filename="ddxratio_xc_1600.csv";
127+
\\for(x=200,16000,write(filename,concat(concat((x/10.0)*precision(1., 10),","),(D*exp(-thc*x/10)/abs(newton_quot_abc(x/10,0.4,0.4,0.0000001)))*precision(1., 10))));

0 commit comments

Comments
 (0)