test_bessel.cc 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. //**********************************************************************************//
  2. // Copyright (C) 2009-2015 Ovidio Pena <ovidio@bytesfall.com> //
  3. // Copyright (C) 2013-2015 Konstantin Ladutenko <kostyfisik@gmail.com> //
  4. // //
  5. // This file is part of scattnlay //
  6. // //
  7. // This program is free software: you can redistribute it and/or modify //
  8. // it under the terms of the GNU General Public License as published by //
  9. // the Free Software Foundation, either version 3 of the License, or //
  10. // (at your option) any later version. //
  11. // //
  12. // This program is distributed in the hope that it will be useful, //
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of //
  14. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
  15. // GNU General Public License for more details. //
  16. // //
  17. // The only additional remark is that we expect that all publications //
  18. // describing work using this software, or all commercial products //
  19. // using it, cite the following reference: //
  20. // [1] O. Pena and U. Pal, "Scattering of electromagnetic radiation by //
  21. // a multilayered sphere," Computer Physics Communications, //
  22. // vol. 180, Nov. 2009, pp. 2348-2354. //
  23. // //
  24. // You should have received a copy of the GNU General Public License //
  25. // along with this program. If not, see <http://www.gnu.org/licenses/>. //
  26. //**********************************************************************************//
  27. #include <complex>
  28. #include <cmath>
  29. #include <cstdio>
  30. #include <stdexcept>
  31. #include <vector>
  32. #include "../../bessel.h"
  33. #include "../../nmie.h"
  34. int nmax_ = -1;
  35. //Temporary variables
  36. std::vector<std::complex<double> > PsiZeta_;
  37. void calcD1D3(const std::complex<double> z, std::vector<std::complex<double> > &D1, std::vector<std::complex<double> > &D3) {
  38. D1[nmax_] = std::complex<double>(0.0, 0.0);
  39. const std::complex<double> zinv = std::complex<double>(1.0, 0.0)/z;
  40. for (int n = nmax_; n > 0; n--) {
  41. D1[n - 1] = static_cast<double>(n)*zinv - 1.0/(D1[n] + static_cast<double>(n)*zinv);
  42. }
  43. if (std::abs(D1[0]) > 100000.0)
  44. throw std::invalid_argument("Unstable D1! Please, try to change input parameters!\n");
  45. PsiZeta_.resize(nmax_ + 1);
  46. // Upward recurrence for PsiZeta and D3 - equations (18a) - (18d)
  47. PsiZeta_[0] = 0.5*(1.0 - std::complex<double>(std::cos(2.0*z.real()), std::sin(2.0*z.real()))
  48. *std::exp(-2.0*z.imag()));
  49. D3[0] = std::complex<double>(0.0, 1.0);
  50. for (int n = 1; n <= nmax_; n++) {
  51. PsiZeta_[n] = PsiZeta_[n - 1]*(static_cast<double>(n)*zinv - D1[n - 1])
  52. *(static_cast<double>(n)*zinv - D3[n - 1]);
  53. D3[n] = D1[n] + std::complex<double>(0.0, 1.0)/PsiZeta_[n];
  54. }
  55. }
  56. void calcPsiZeta(std::complex<double> z, std::vector<std::complex<double> > &Psi, std::vector<std::complex<double> > &Zeta) {
  57. std::complex<double> c_i(0.0, 1.0);
  58. std::vector<std::complex<double> > D1(nmax_ + 1), D3(nmax_ + 1);
  59. calcD1D3(z, D1, D3);
  60. Psi.resize(nmax_+1);
  61. Zeta.resize(nmax_+1);
  62. Psi[0] = std::sin(z);
  63. Zeta[0] = std::sin(z) - c_i*std::cos(z);
  64. for (int n = 1; n <= nmax_; n++) {
  65. Psi[n] = Psi[n - 1]*(static_cast<double>(n)/z - D1[n - 1]);
  66. Zeta[n] = Zeta[n - 1]*(static_cast<double>(n)/z - D3[n - 1]);
  67. }
  68. }
  69. int main(int argc, char *argv[]) {
  70. int n_small = 1, n_big = 15;
  71. int n = n_big+2, n_print;
  72. std::complex<double> z_small(0.0012, 0.0034);
  73. std::complex<double> z_medium(1.0, 2.0);
  74. std::complex<double> z_big(18.0, 17.0);
  75. std::complex<double> z_big_real(81.0, 0.0);
  76. std::complex<double> z_big_imag(0.0, 13.0);
  77. std::complex<double> z;
  78. std::vector<std::complex<double> > D1, D3;
  79. int nm;
  80. // csj and cdj - complex argument spherical bessel first kind and derivative
  81. // csy and cdy - complex argument spherical bessel second kind and derivative
  82. std::vector< std::complex<double> > csj, cdj, csy, cdy, csh;
  83. std::vector<std::complex<double> > Psi, Zeta, dPsi, dZeta;
  84. auto c_i = std::complex<double>(0.0,1.0);
  85. printf("===== Small ========\n");
  86. z = z_small;
  87. printf("z = %+10.5er%+10.5ei\n", z.real(), z.imag());
  88. nmie::bessel::csphjy (n, z, nm, csj, cdj, csy, cdy );
  89. csh.resize(csj.size());
  90. for (unsigned int i = 0; i < csj.size(); ++i)
  91. csh[i] = csj[i]+c_i*csy[i];
  92. nmie::bessel::calcPsi(n, z, Psi, dPsi);
  93. nmie::bessel::calcZeta(n, z, Zeta, dZeta);
  94. // n_print = n_small;
  95. // printf("csj[%i] = %+10.5er%+10.5ei; csy[%i] = %+10.5er%+10.5ei\n", n_print,
  96. // csj[n_print].real(), csj[n_print].imag(), n_print,
  97. // csy[n_print].real(), csy[n_print].imag());
  98. // printf("WA csj = e r e i; WA csy = e r e i\n");
  99. // n_print = n_big;
  100. // printf("csj[%i] = %+10.5er%+10.5ei; csy[%i] = %+10.5er%+10.5ei\n", n_big,
  101. // csj[n_print].real(), csj[n_print].imag(), n_print,
  102. // csy[n_print].real(), csy[n_print].imag());
  103. // printf(" WA csj = e r e i; WA csy = e r e i\n");
  104. // n_print = n_small;
  105. // printf("csh[%i] = %+10.5er%+10.5ei\n", n_print,
  106. // csh[n_print].real(), csh[n_print].imag());
  107. // printf("WA csj = e r e i;\n");
  108. // n_print = n_big;
  109. // printf("csh[%i] = %+10.5er%+10.5ei\n", n_print,
  110. // csh[n_print].real(), csh[n_print].imag());
  111. // printf("WA csj = e r e i;\n");
  112. n_print = n_small;
  113. printf("Psi[%i] = %+10.5er%+10.5ei; Zeta[%i] = %+10.5er%+10.5ei\n", n_print,
  114. Psi[n_print].real(), Psi[n_print].imag(), n_print,
  115. Zeta[n_print].real(), Zeta[n_print].imag());
  116. printf("WA Psi = e r e i; WA Zeta = e r e i\n");
  117. n_print = n_big;
  118. printf("Psi[%i] = %+10.5er%+10.5ei; Zeta[%i] = %+10.5er%+10.5ei\n", n_big,
  119. Psi[n_print].real(), Psi[n_print].imag(), n_print,
  120. Zeta[n_print].real(), Zeta[n_print].imag());
  121. printf(" WA Psi = e r e i; WA Zeta = e r e i\n");
  122. n_print = n_small;
  123. printf("dPsi[%i] = %+10.5er%+10.5ei; dZeta[%i] = %+10.5er%+10.5ei\n", n_print,
  124. dPsi[n_print].real(), dPsi[n_print].imag(), n_print,
  125. dZeta[n_print].real(), dZeta[n_print].imag());
  126. printf("WA dPsi = 0.800005e-03r+0.226667e-02i; WA dZeta = +4.8284 e+04r-5.98822e+04i\n");
  127. n_print = n_big;
  128. printf("dPsi[%i] = %+10.5er%+10.5ei; dZeta[%i] = %+10.5er%+10.5ei\n", n_big,
  129. dPsi[n_print].real(), dPsi[n_print].imag(), n_print,
  130. dZeta[n_print].real(), dZeta[n_print].imag());
  131. printf(" WA dPsi = +1.75388e-53r-6.94429e-54i; WA dZeta = +8.58553e+55r+7.47397e+55i\n");
  132. nmax_ = nm;
  133. printf("----- Scattnlay (nmax_=%d)-----\n",nmax_);
  134. calcPsiZeta(z, Psi, Zeta);
  135. n_print = n_small;
  136. printf("Psi[%i] = %+10.5er%+10.5ei; Zeta[%i] = %+10.5er%+10.5ei\n", n_print,
  137. Psi[n_print].real(), Psi[n_print].imag(), n_print,
  138. Zeta[n_print].real(), Zeta[n_print].imag());
  139. printf("WA Psi = e r e i; WA Zeta = e r e i\n");
  140. n_print = n_big;
  141. printf("Psi[%i] = %+10.5er%+10.5ei; Zeta[%i] = %+10.5er%+10.5ei\n", n_big,
  142. Psi[n_print].real(), Psi[n_print].imag(), n_print,
  143. Zeta[n_print].real(), Zeta[n_print].imag());
  144. printf(" WA Psi = e r e i; WA Zeta = e r e i\n");
  145. printf("===== Medium ========\n");
  146. z = z_medium;
  147. printf("z = %+10.5er%+10.5ei\n", z.real(), z.imag());
  148. nmie::bessel::csphjy (n, z, nm, csj, cdj, csy, cdy );
  149. csh.resize(csj.size());
  150. for (unsigned int i = 0; i < csj.size(); ++i)
  151. csh[i] = csj[i]+c_i*csy[i];
  152. nmie::bessel::calcPsi(n, z, Psi, dPsi);
  153. nmie::bessel::calcZeta(n, z, Zeta, dZeta);
  154. // n_print = n_small;
  155. // printf("csj[%i] = %+10.5er%+10.5ei; csy[%i] = %+10.5er%+10.5ei\n", n_print,
  156. // csj[n_print].real(), csj[n_print].imag(), n_print,
  157. // csy[n_print].real(), csy[n_print].imag());
  158. // printf("WA csj = e r e i; WA csy = e r e i\n");
  159. // n_print = n_big;
  160. // printf("csj[%i] = %+10.5er%+10.5ei; csy[%i] = %+10.5er%+10.5ei\n", n_big,
  161. // csj[n_print].real(), csj[n_print].imag(), n_print,
  162. // csy[n_print].real(), csy[n_print].imag());
  163. // printf(" WA csj = e r e i; WA csy = e r e i\n");
  164. // n_print = n_small;
  165. // printf("csh[%i] = %+10.5er%+10.5ei\n", n_print,
  166. // csh[n_print].real(), csh[n_print].imag());
  167. // printf("WA csj = e r e i;\n");
  168. // n_print = n_big;
  169. // printf("csh[%i] = %+10.5er%+10.5ei\n", n_print,
  170. // csh[n_print].real(), csh[n_print].imag());
  171. // printf("WA csj = e r e i;\n");
  172. n_print = n_small;
  173. printf("Psi[%i] = %+10.5er%+10.5ei; Zeta[%i] = %+10.5er%+10.5ei\n", n_print,
  174. Psi[n_print].real(), Psi[n_print].imag(), n_print,
  175. Zeta[n_print].real(), Zeta[n_print].imag());
  176. printf("WA Psi = e r e i; WA Zeta = e r e i\n");
  177. n_print = n_big;
  178. printf("Psi[%i] = %+10.5er%+10.5ei; Zeta[%i] = %+10.5er%+10.5ei\n", n_big,
  179. Psi[n_print].real(), Psi[n_print].imag(), n_print,
  180. Zeta[n_print].real(), Zeta[n_print].imag());
  181. printf(" WA Psi = e r e i; WA Zeta = e r e i\n");
  182. n_print = n_small;
  183. printf("dPsi[%i] = %+10.5er%+10.5ei; dZeta[%i] = %+10.5er%+10.5ei\n", n_print,
  184. dPsi[n_print].real(), dPsi[n_print].imag(), n_print,
  185. dZeta[n_print].real(), dZeta[n_print].imag());
  186. printf("WA dPsi = 2.41792e r+1.27781 e i; WA dZeta = +1.99423e-01r-7.01483e-02i\n");
  187. n_print = n_big;
  188. printf("dPsi[%i] = %+10.5er%+10.5ei; dZeta[%i] = %+10.5er%+10.5ei\n", n_big,
  189. dPsi[n_print].real(), dPsi[n_print].imag(), n_print,
  190. dZeta[n_print].real(), dZeta[n_print].imag());
  191. printf(" WA dPsi = -1.03313e-11r-1.13267e-11i; WA dZeta = -2.11402e+11r+8.34528e+10i\n");
  192. nmax_ = nm;
  193. printf("----- Scattnlay (nmax_=%d)-----\n",nmax_);
  194. calcPsiZeta(z, Psi, Zeta);
  195. n_print = n_small;
  196. printf("Psi[%i] = %+10.5er%+10.5ei; Zeta[%i] = %+10.5er%+10.5ei\n", n_print,
  197. Psi[n_print].real(), Psi[n_print].imag(), n_print,
  198. Zeta[n_print].real(), Zeta[n_print].imag());
  199. printf("WA Psi = e r e i; WA Zeta = e r e i\n");
  200. n_print = n_big;
  201. printf("Psi[%i] = %+10.5er%+10.5ei; Zeta[%i] = %+10.5er%+10.5ei\n", n_big,
  202. Psi[n_print].real(), Psi[n_print].imag(), n_print,
  203. Zeta[n_print].real(), Zeta[n_print].imag());
  204. printf(" WA Psi = e r e i; WA Zeta = e r e i\n");
  205. printf("===== Big ========\n");
  206. z = z_big;
  207. printf("z = %+10.5er%+10.5ei\n", z.real(), z.imag());
  208. nmie::bessel::csphjy (n, z, nm, csj, cdj, csy, cdy );
  209. csh.resize(csj.size());
  210. for (unsigned int i = 0; i < csj.size(); ++i)
  211. csh[i] = csj[i]+c_i*csy[i];
  212. nmie::bessel::calcPsi(n, z, Psi, dPsi);
  213. nmie::bessel::calcZeta(n, z, Zeta, dZeta);
  214. // n_print = n_small;
  215. // printf("csj[%i] = %+10.5er%+10.5ei; csy[%i] = %+10.5er%+10.5ei\n", n_print,
  216. // csj[n_print].real(), csj[n_print].imag(), n_print,
  217. // csy[n_print].real(), csy[n_print].imag());
  218. // printf("WA csj = e r e i; WA csy = e r e i\n");
  219. // n_print = n_big;
  220. // printf("csj[%i] = %+10.5er%+10.5ei; csy[%i] = %+10.5er%+10.5ei\n", n_big,
  221. // csj[n_print].real(), csj[n_print].imag(), n_print,
  222. // csy[n_print].real(), csy[n_print].imag());
  223. // printf(" WA csj = e r e i; WA csy = e r e i\n");
  224. // n_print = n_small;
  225. // printf("csh[%i] = %+10.5er%+10.5ei\n", n_print,
  226. // csh[n_print].real(), csh[n_print].imag());
  227. // printf("WA csj = e r e i;\n");
  228. // n_print = n_big;
  229. // printf("csh[%i] = %+10.5er%+10.5ei\n", n_print,
  230. // csh[n_print].real(), csh[n_print].imag());
  231. // printf("WA csj = e r e i;\n");
  232. n_print = n_small;
  233. printf("Psi[%i] = %+10.5er%+10.5ei; Zeta[%i] = %+10.5er%+10.5ei\n", n_print,
  234. Psi[n_print].real(), Psi[n_print].imag(), n_print,
  235. Zeta[n_print].real(), Zeta[n_print].imag());
  236. printf("WA Psi = e r e i; WA Zeta = e r e i\n");
  237. n_print = n_big;
  238. printf("Psi[%i] = %+10.5er%+10.5ei; Zeta[%i] = %+10.5er%+10.5ei\n", n_big,
  239. Psi[n_print].real(), Psi[n_print].imag(), n_print,
  240. Zeta[n_print].real(), Zeta[n_print].imag());
  241. printf(" WA Psi = e r e i; WA Zeta = e r e i\n");
  242. n_print = n_small;
  243. printf("dPsi[%i] = %+10.5er%+10.5ei; dZeta[%i] = %+10.5er%+10.5ei\n", n_print,
  244. dPsi[n_print].real(), dPsi[n_print].imag(), n_print,
  245. dZeta[n_print].real(), dZeta[n_print].imag());
  246. printf("WA dPsi = e r e i; WA dZeta = -3.11025e-08r-2.90558e-08i\n");
  247. n_print = n_big;
  248. printf("dPsi[%i] = %+10.5er%+10.5ei; dZeta[%i] = %+10.5er%+10.5ei\n", n_big,
  249. dPsi[n_print].real(), dPsi[n_print].imag(), n_print,
  250. dZeta[n_print].real(), dZeta[n_print].imag());
  251. printf(" WA dPsi = -2.47740e+05r+3.05899e+05i; WA dZeta = -6.13497e-07r-1.14967e-06i\n");
  252. nmax_ = 100;
  253. printf("----- Scattnlay (nmax_=%d)-----\n",nmax_);
  254. calcPsiZeta(z, Psi, Zeta);
  255. n_print = n_small;
  256. printf("Psi[%i] = %+10.5er%+10.5ei; Zeta[%i] = %+10.5er%+10.5ei\n", n_print,
  257. Psi[n_print].real(), Psi[n_print].imag(), n_print,
  258. Zeta[n_print].real(), Zeta[n_print].imag());
  259. printf("WA Psi = e r e i; WA Zeta = e r e i\n");
  260. n_print = n_big;
  261. printf("Psi[%i] = %+10.5er%+10.5ei; Zeta[%i] = %+10.5er%+10.5ei\n", n_big,
  262. Psi[n_print].real(), Psi[n_print].imag(), n_print,
  263. Zeta[n_print].real(), Zeta[n_print].imag());
  264. printf(" WA Psi = e r e i; WA Zeta = e r e i\n");
  265. printf("===== Big real========\n");
  266. z = z_big_real;
  267. printf("z = %+10.5er%+10.5ei\n", z.real(), z.imag());
  268. nmie::bessel::csphjy (n, z, nm, csj, cdj, csy, cdy );
  269. csh.resize(csj.size());
  270. for (unsigned int i = 0; i < csj.size(); ++i)
  271. csh[i] = csj[i]+c_i*csy[i];
  272. nmie::bessel::calcPsi(n, z, Psi, dPsi);
  273. nmie::bessel::calcZeta(n, z, Zeta, dZeta);
  274. // n_print = n_small;
  275. // printf("csj[%i] = %+10.5er%+10.5ei; csy[%i] = %+10.5er%+10.5ei\n", n_print,
  276. // csj[n_print].real(), csj[n_print].imag(), n_print,
  277. // csy[n_print].real(), csy[n_print].imag());
  278. // printf("WA csj = e r e i; WA csy = e r e i\n");
  279. // n_print = n_big;
  280. // printf("csj[%i] = %+10.5er%+10.5ei; csy[%i] = %+10.5er%+10.5ei\n", n_big,
  281. // csj[n_print].real(), csj[n_print].imag(), n_print,
  282. // csy[n_print].real(), csy[n_print].imag());
  283. // printf(" WA csj = e r e i; WA csy = e r e i\n");
  284. // n_print = n_small;
  285. // printf("csh[%i] = %+10.5er%+10.5ei\n", n_print,
  286. // csh[n_print].real(), csh[n_print].imag());
  287. // printf("WA csj = e r e i;\n");
  288. // n_print = n_big;
  289. // printf("csh[%i] = %+10.5er%+10.5ei\n", n_print,
  290. // csh[n_print].real(), csh[n_print].imag());
  291. // printf("WA csj = e r e i;\n");
  292. n_print = n_small;
  293. printf("Psi[%i] = %+10.5er%+10.5ei; Zeta[%i] = %+10.5er%+10.5ei\n", n_print,
  294. Psi[n_print].real(), Psi[n_print].imag(), n_print,
  295. Zeta[n_print].real(), Zeta[n_print].imag());
  296. //
  297. //SphericalHankelH1(1,81)*81
  298. printf("WA Psi =-0.784462377 e e i; WA Zeta = -0.784462377r+0.620299278i\n");
  299. n_print = n_big;
  300. printf("Psi[%i] = %+10.5er%+10.5ei; Zeta[%i] = %+10.5er%+10.5ei\n", n_big,
  301. Psi[n_print].real(), Psi[n_print].imag(), n_print,
  302. Zeta[n_print].real(), Zeta[n_print].imag());
  303. printf(" WA Psi = 0.699946236744 e i; WA Zeta = 0.69994623 r+0.727239996i\n");
  304. // n_print = n_small;
  305. // printf("dPsi[%i] = %+10.5er%+10.5ei; dZeta[%i] = %+10.5er%+10.5ei\n", n_print,
  306. // dPsi[n_print].real(), dPsi[n_print].imag(), n_print,
  307. // dZeta[n_print].real(), dZeta[n_print].imag());
  308. // printf("WA dPsi = e r e i; WA dZeta = -6.20203e-01r-7.84344e-01i\n");
  309. // n_print = n_big;
  310. // printf("dPsi[%i] = %+10.5er%+10.5ei; dZeta[%i] = %+10.5er%+10.5ei\n", n_big,
  311. // dPsi[n_print].real(), dPsi[n_print].imag(), n_print,
  312. // dZeta[n_print].real(), dZeta[n_print].imag());
  313. // printf(" WA dPsi = e r e i; WA dZeta = -7.13982e-01r+6.86858e-01i\n");
  314. nmax_ = 100 ;
  315. printf("----- Scattnlay (nmax_=%d)-----\n",nmax_);
  316. calcPsiZeta(z, Psi, Zeta);
  317. n_print = n_small;
  318. printf("Psi[%i] = %+10.5er%+10.5ei; Zeta[%i] = %+10.5er%+10.5ei\n", n_print,
  319. Psi[n_print].real(), Psi[n_print].imag(), n_print,
  320. Zeta[n_print].real(), Zeta[n_print].imag());
  321. printf("WA Psi = e r e i; WA Zeta = e r e i\n");
  322. n_print = n_big;
  323. printf("Psi[%i] = %+10.5er%+10.5ei; Zeta[%i] = %+10.5er%+10.5ei\n", n_big,
  324. Psi[n_print].real(), Psi[n_print].imag(), n_print,
  325. Zeta[n_print].real(), Zeta[n_print].imag());
  326. printf(" WA Psi = e r e i; WA Zeta = e r e i\n");
  327. printf("===== Big imag========\n");
  328. z = z_big_imag;
  329. printf("z = %+10.5er%+10.5ei\n", z.real(), z.imag());
  330. nmie::bessel::csphjy (n, z, nm, csj, cdj, csy, cdy );
  331. csh.resize(csj.size());
  332. for (unsigned int i = 0; i < csj.size(); ++i)
  333. csh[i] = csj[i]+c_i*csy[i];
  334. nmie::bessel::calcPsi(n, z, Psi, dPsi);
  335. nmie::bessel::calcZeta(n, z, Zeta, dZeta);
  336. // n_print = n_small;
  337. // printf("csj[%i] = %+10.5er%+10.5ei; csy[%i] = %+10.5er%+10.5ei\n", n_print,
  338. // csj[n_print].real(), csj[n_print].imag(), n_print,
  339. // csy[n_print].real(), csy[n_print].imag());
  340. // printf("WA csj = e r e i; WA csy = e r e i\n");
  341. // n_print = n_big;
  342. // printf("csj[%i] = %+10.5er%+10.5ei; csy[%i] = %+10.5er%+10.5ei\n", n_big,
  343. // csj[n_print].real(), csj[n_print].imag(), n_print,
  344. // csy[n_print].real(), csy[n_print].imag());
  345. // printf(" WA csj = e r e i; WA csy = e r e i\n");
  346. // n_print = n_small;
  347. // printf("csh[%i] = %+10.5er%+10.5ei\n", n_print,
  348. // csh[n_print].real(), csh[n_print].imag());
  349. // printf("WA csj = e r e i;\n");
  350. // n_print = n_big;
  351. // printf("csh[%i] = %+10.5er%+10.5ei\n", n_print,
  352. // csh[n_print].real(), csh[n_print].imag());
  353. // printf("WA csj = e r e i;\n");
  354. // n_print = n_small;
  355. // printf("Psi[%i] = %+10.5er%+10.5ei; Zeta[%i] = %+10.5er%+10.5ei\n", n_print,
  356. // Psi[n_print].real(), Psi[n_print].imag(), n_print,
  357. // Zeta[n_print].real(), Zeta[n_print].imag());
  358. // printf("WA Psi = e r e i; WA Zeta = e r e i\n");
  359. // n_print = n_big;
  360. // printf("Psi[%i] = %+10.5er%+10.5ei; Zeta[%i] = %+10.5er%+10.5ei\n", n_big,
  361. // Psi[n_print].real(), Psi[n_print].imag(), n_print,
  362. // Zeta[n_print].real(), Zeta[n_print].imag());
  363. // printf(" WA Psi = e r e i; WA Zeta = e r e i\n");
  364. n_print = n_small;
  365. printf("dPsi[%i] = %+10.5er%+10.5ei; dZeta[%i] = %+10.5er%+10.5ei\n", n_print,
  366. dPsi[n_print].real(), dPsi[n_print].imag(), n_print,
  367. dZeta[n_print].real(), dZeta[n_print].imag());
  368. printf("WA dPsi = e r e i; WA dZeta = -2.47233e-22r-2.44758e-06i\n");
  369. n_print = n_big;
  370. printf("dPsi[%i] = %+10.5er%+10.5ei; dZeta[%i] = %+10.5er%+10.5ei\n", n_big,
  371. dPsi[n_print].real(), dPsi[n_print].imag(), n_print,
  372. dZeta[n_print].real(), dZeta[n_print].imag());
  373. printf(" WA dPsi = e r e i; WA dZeta = 8.39449e-19r+1.28767e-02i\n");
  374. }