8.2 不完全楕円積分のグラフ

任意の $ k\in[0,1]$ に対して、 $ F(\cdot;k)$, $ E(\cdot;k)$$ [-1,1]$ の範囲で奇関数かつ単調増加である。 その範囲でのグラフを描いてみよう。

こういうのどかなことをしているテキストは、なかなかないみたい。


boost には、

を計算する関数 ellint_1(), ellint_2(), ellint_3() が用意されている。

Math/Special FunctionsElliptic Integrals

testelliptic.cpp

/*
 * testelliptic.cpp --- 与えられた k に対し F(x;k), E(x;k) (-1≦x≦1)の値を計算
 *   g++ -I/opt/local/include testelliptic.cpp
 */

#include <iostream>
#include <iomanip>
using namespace std;

#include <boost/math/special_functions/ellint_1.hpp>
#include <boost/math/special_functions/ellint_2.hpp>

int main(int argc, char **argv)
{
  int i, n;
  double pi, k, dx, xmin, xmax;
  double *x, *y1, *y2;
  n = 100;
  x = new double [n+1];
  y1 = new double [n+1];
  y2 = new double [n+1];
  pi = 4 * atan(1.0);
  if (argc == 2)
    k = atof(argv[1]);
  else {
    cout << "k="; cin >> k;
  }
  cout << "# k=" << k << endl;
  // [-1,1] を100等分
  xmin = - 1.0; xmax = 1.0; n = 100;
  dx = (xmax - xmin) / n;
  for (i = 0; i <= n; i++) {
    x[i] = xmin + i * dx;
    y1[i] = boost::math::ellint_1(k, asin(x[i]));
    y2[i] = boost::math::ellint_2(k, asin(x[i]));
    //  cout << setiosflags(ios::scientific) << setprecision(8) << x[i] << " " << y1[i] << " " << y2[i] << endl;
    cout << setiosflags(ios::fixed) << setprecision(4) << x[i] << " "
         << setprecision(15) << y1[i] << " " << y2[i] << endl;
  }
  return 0;
}

図 10: $ k=0$
\includegraphics[width=0.9\textwidth]{elliptic_0.0.eps}
図 11: $ k=0.1$
\includegraphics[width=0.9\textwidth]{elliptic_0.1.eps}
図 12: $ k=0.2$
\includegraphics[width=0.9\textwidth]{elliptic_0.2.eps}
図 13: $ k=0.3$
\includegraphics[width=0.9\textwidth]{elliptic_0.3.eps}

図 14: $ k=0.4$
\includegraphics[width=0.9\textwidth]{elliptic_0.4.eps}
図 15: $ k=0.5$
\includegraphics[width=0.9\textwidth]{elliptic_0.5.eps}

図 16: $ k=0.6$
\includegraphics[width=0.9\textwidth]{elliptic_0.6.eps}
図 17: $ k=0.7$
\includegraphics[width=0.9\textwidth]{elliptic_0.7.eps}

図 18: $ k=0.8$
\includegraphics[width=0.9\textwidth]{elliptic_0.8.eps}
図 19: $ k=0.9$
\includegraphics[width=0.9\textwidth]{elliptic_0.9.eps}

図 20: $ k=0.99$
\includegraphics[width=0.9\textwidth]{elliptic_0.99.eps}
図 21: $ k=0.999$
\includegraphics[width=0.9\textwidth]{elliptic_0.999.eps}
図 22: $ k=0.9999$
\includegraphics[width=0.9\textwidth]{elliptic_0.9999.eps}
図 23: $ k=1$
\includegraphics[width=0.9\textwidth]{elliptic_1.0.eps}

参考: Mathmaticaならば
Manipulate[
  Plot[{EllipticF[ArcSin[x], k^2], EllipticE[ArcSin[x], k^2]},
   {x, -1, 1}, PlotRange -> {-3, 3}, AspectRatio -> 1],
  {k, 0.0, 0.999, 0.001}]

桂田 祐史