10 using namespace TMath;
14 void dkia_(
int *IFAC,
double *
X,
double *
A,
double *DKI,
double *DKID,
int *IERRO);
15 void dlia_(
int *IFAC,
double *
X,
double *
A,
double *DLI,
double *DLID,
int *IERRO);
20 TFile *
file =
new TFile(filename.data());
30 cout <<
"LaplaceSolution object initialized as follows:" << endl;
31 cout <<
" Inner Radius = " <<
a <<
" cm." << endl;
32 cout <<
" Outer Radius = " <<
b <<
" cm." << endl;
33 cout <<
" Half Length = " <<
L <<
" cm." << endl;
49 cout <<
"Now filling the Beta[m][n] Array..."<<endl;
56 double previous =
jn(m,x)*
yn(m,l*x) -
jn(m,l*x)*
yn(m,x);
57 while (n < NumberOfOrders)
62 if (value == 0) cout <<
"FFFFFFUUUUUUUUUUU......" << endl;
63 if ( (value == 0) || (value<0 && previous>0) || (value>0 && previous<0))
65 double slp = (value-previous)/epsilon;
66 double cpt = value - slp*
x;
70 if (
verbosity) cout <<
" " << x0 <<
"," << Betamn[
m][
n];
86 N2mn[
m][
n] = 2/(
pi*
pi*Betamn[
m][
n]*Betamn[
m][
n]);
88 if (
verbosity) cout <<
"m: " <<
m <<
" n: " <<
n <<
" N2[m][n]: " << N2mn[
m][
n];
95 if (
verbosity) cout <<
" Int: " << integral << endl;
100 cout <<
"Done." << endl;
106 cout <<
"Now filling the Mu[n][k] Array..."<<endl;
107 cout <<
"Done." << endl;
113 if (
verbosity) cout <<
"Determine Rmn("<<m<<
","<<n<<
","<<r<<
") = ";
118 if (n<0 || n>NumberOfOrders) error=1;
119 if (r<a || r>
b) error=1;
122 cout <<
"Invalid arguments Rmn("<<m<<
","<<n<<
","<<r<<
")" << endl;;
130 R =
yn(m,Betamn[m][n]*
a)*
jn(m,Betamn[m][n]*r) -
jn(m,Betamn[m][n]*a)*
yn(m,Betamn[m][n]*r);
141 if (n<0 || n>NumberOfOrders) error=1;
142 if (r<a || r>
b) error=1;
145 cout <<
"Invalid arguments Rmn1("<<m<<
","<<n<<
","<<r<<
")" << endl;;
153 double BetaN = (n+1)*
pi/
L;
154 R = BesselK(m,BetaN*
a)*BesselI(m,BetaN*r)-BesselI(m,BetaN*a)*BesselK(m,BetaN*r);
164 if (n<0 || n>NumberOfOrders) error=1;
165 if (r<a || r>
b) error=1;
168 cout <<
"Invalid arguments Rmn2("<<m<<
","<<n<<
","<<r<<
")" << endl;;
176 double BetaN = (n+1)*
pi/
L;
177 R = BesselK(m,BetaN*b)*BesselI(m,BetaN*r)-BesselI(m,BetaN*b)*BesselK(m,BetaN*r);
187 if (n<0 || n>NumberOfOrders) error=1;
188 if (ref<a || ref>
b) error=1;
189 if (r<a || r>b) error=1;
192 cout <<
"Invalid arguments RPrime("<<m<<
","<<n<<
","<<ref<<
","<<r<<
")" << endl;;
204 double BetaN = (n+1)*
pi/
L;
205 double term1 = BesselK(m,BetaN*ref)*( BesselI(abs(m-1),BetaN*r) + BesselI(m+1,BetaN*r) );
206 double term2 = BesselI(m,BetaN*ref)*( BesselK(abs(m-1),BetaN*r) + BesselK(m+1,BetaN*r) );
207 R = BetaN/2.0*(term1 + term2);
217 if (k<0 || k>NumberOfOrders) error=1;
218 if (r<a || r>
b) error=1;
221 cout <<
"Invalid arguments Rnk("<<n<<
","<<k<<
","<<r<<
")" << endl;;
227 double BetaN = (n+1)*
pi/
L;
239 dlia_( &IFAC, &X, &A, &DLI_1, &DERR, &IERRO);
242 dkia_( &IFAC, &X, &A, &DKI_1, &DERR, &IERRO);
245 dkia_( &IFAC, &X, &A, &DKI_2, &DERR, &IERRO);
248 dlia_( &IFAC, &X, &A, &DLI_2, &DERR, &IERRO);
250 double R= DLI_1*DKI_1 - DKI_2*DLI_2;
268 if(fByFile)
return ByFileEZ(r,phi,z,r1,phi1,z1);
271 if (r<a || r>
b) error=1;
272 if (phi<0 || phi>2*
pi) error=1;
273 if (z<0 || z>
L) error=1;
274 if (r1<a || r1>b) error=1;
275 if (phi1<0 || phi1>2*pi) error=1;
276 if (z1<0 || z1>L) error=1;
279 cout <<
"Invalid arguments Ez(";
297 double term = 1/(2.0*
pi);
299 term *= (2 - ((m==0)?1:0))*cos(m*(phi-phi1));
301 term *= Rmn(m,n,r)*Rmn(m,n,r1)/N2mn[
m][
n];
305 term *= cosh(Betamn[m][n]*z)*sinh(Betamn[m][n]*(L-z1))/sinh(Betamn[m][n]*L);
309 term *= -cosh(Betamn[m][n]*(L-z))*sinh(Betamn[m][n]*z1)/sinh(Betamn[m][n]*L);;
313 if (
verbosity) cout <<
" " << term <<
" " << G << endl;
316 if (
verbosity) cout <<
"Ez = " << G << endl;
324 if(fByFile)
return ByFileER(r,phi,z,r1,phi1,z1);
327 if (r<a || r>
b) error=1;
328 if (phi<0 || phi>2*
pi) error=1;
329 if (z<0 || z>
L) error=1;
330 if (r1<a || r1>b) error=1;
331 if (phi1<0 || phi1>2*pi) error=1;
332 if (z1<0 || z1>L) error=1;
335 cout <<
"Invalid arguments Er(";
351 double term = 1/(L*
pi);
353 term *= (2 - ((
m==0)?1:0))*cos(
m*(phi-phi1));
355 double BetaN = (
n+1)*pi/L;
356 term *= sin(BetaN*z)*sin(BetaN*z1);
360 term *= RPrime(
m,
n,
a,r)*Rmn2(
m,
n,r1);
364 term *= Rmn1(
m,
n,r1)*RPrime(
m,
n,b,r);
367 term /= BesselI(
m,BetaN*
a)*BesselK(
m,BetaN*b)-BesselI(
m,BetaN*b)*BesselK(
m,BetaN*a);
373 if (
verbosity) cout <<
"Er = " << G << endl;
382 if (r<a || r>
b) error=1;
383 if (phi<0 || phi>2*
pi) error=1;
384 if (z<0 || z>
L) error=1;
385 if (r1<a || r1>b) error=1;
386 if (phi1<0 || phi1>2*pi) error=1;
387 if (z1<0 || z1>L) error=1;
390 cout <<
"Invalid arguments Ephi(";