• 検索結果がありません。

Bessel の方程式

ドキュメント内 II ( (ページ 123-129)

第 9 章 円盤領域における差分法 56

D.6 Bessel の方程式と Bessel 関数

D.6.1 Bessel の方程式

ν

を定数とするとき、常微分方程式

(D.11) x

′′

+ 1

t x

+ (

1 ν

2

t

2

) x = 0

Bessel

ベッセ ル

(

微分

)

方程式と呼び、

ν

をその次数という。定数

ν

は実数に限らず、複素数と して良いが、一般性を失わずに

Re ν 0

と仮定する。

D.7 Gauss の微分方程式、超幾何関数

(

笠原

[5]

を見よ。

)

D.8 Fuchs 型方程式

(

笠原

[5]

を見よ。

)

付 録 E 可視化の手法

E.1 円盤領域で定義された関数の可視化

円盤領域で定義された関数を可視化することは、以前から簡単そうだがどうすれば良いか分 からない、悩ましい問題であった。

2007

2

月現在、

gnuplot

を呼び出して表示させることで 凌いでいる

(誤魔化している)。静止画像を作成して MPEG

データを作ることもできるので、

うるさいことを言わなければまあまあの使い勝手である。

E.1.1 call gnuplot.c

/*

* call_gnuplot.c --- gnuplot を用いて円板で定義された関数を可視化する

* version 2

*

* written by mk.

*

* GNUPLOT manual (in Japanese)

* http://www.meiji.ac.jp/servers/math/staffs/mk/on-computer/gnuplotj/index.html

*

*/

#include <sys/stat.h> /* S_IRUSR etc */

#include <stdio.h>

#include <unistd.h> /* unlink() */

#include <math.h> /* atan() etc */

#include <signal.h>

#include "matrix.h"

#include "call_gnuplot.h"

int msleep(int);

#define PANIC(a) do { \

perror(a); \

if (temp_name) unlink(temp_name);\

exit(1);\

} while(0) void goodbye(int dummy) {

close_gnuplot();

exit(0);

}

double pi;

char *temp_name = NULL;

FILE *gnuplot, *data;

int open_gnuplot() {

pi = 4.0 * atan(1.0);

if ((temp_name = tmpnam((char *) 0)) == 0)

PANIC("tmpnam failed");

/*

* stat.h

* S_IRUSR R for owner

* S_IWUSR W for owner

*/

if (mkfifo(temp_name, S_IRUSR | S_IWUSR) != 0) PANIC("mkfifo failed");

gnuplot = popen("gnuplot", "w");

fprintf(gnuplot, "set data style lines\n");

fprintf(gnuplot, "set parametric\n");

fprintf(gnuplot, "set hidden3d\n");

fprintf(gnuplot, "set contour\n");

fprintf(gnuplot, "set cntrparam levels 10\n");

fflush(gnuplot);

signal(SIGINT, goodbye);

return 0;

}

int disk(int nr, int nt, matrix u, char *label) {

int i, j;

double r, theta, x, y, z;

double dr, dt;

FILE *data;

dr = 1.0 / nr;

dt = 2.0 * pi / nt;

fprintf(gnuplot, "set nolabel\n");

fprintf(gnuplot, "set label \"%s\" at screen 0.4,0.85\n", label);

fprintf(gnuplot, "set zrange [-1:3]\n");

fprintf(gnuplot, "clear\n");

fprintf(gnuplot, "splot \"%s\" with lines\n", temp_name);

fflush(gnuplot);

data = fopen(temp_name, "w");

for (i = 0; i <= nr; i++) { r = i * dr;

for (j = 0; j <= nt; j++) { theta = j * dt;

x = r * cos(theta);

y = r * sin(theta);

z = u[i][j];

fprintf(data, "%f %f %f\n", x, y, z);

}

fprintf(data, "\n");

}

fclose(data);

msleep(100);

return 0;

}

int open_gnuplot2() {

pi = 4.0 * atan(1.0);

if ((temp_name = tmpnam((char *) 0)) == 0) PANIC("tmpnam failed");

/*

* stat.h

* S_IRUSR R for owner

* S_IWUSR W for owner

*/

if (mkfifo(temp_name, S_IRUSR | S_IWUSR) != 0) PANIC("mkfifo failed");

gnuplot = popen("gnuplot", "w");

fprintf(gnuplot, "set data style lines\n");

fprintf(gnuplot, "set parametric\n");

fprintf(gnuplot, "set hidden3d\n");

fprintf(gnuplot, "set contour\n");

fprintf(gnuplot, "set cntrparam levels 10\n");

fprintf(gnuplot, "set term jpeg\n");

fflush(gnuplot);

signal(SIGINT, goodbye);

return 0;

}

int disk2(int nr, int nt, matrix u, char *label, char *fname) {

int i, j;

double r, theta, x, y, z;

double dr, dt;

FILE *data;

dr = 1.0 / nr;

dt = 2.0 * pi / nt;

fprintf(gnuplot, "set nolabel\n");

fprintf(gnuplot, "set label \"%s\" at screen 0.4,0.85\n", label);

fprintf(gnuplot, "set zrange [-1:3]\n");

fprintf(gnuplot, "clear\n");

fprintf(gnuplot, "set output \"%s\"\n", fname);

fprintf(gnuplot, "splot \"%s\" with lines\n", temp_name);

fflush(gnuplot);

data = fopen(temp_name, "w");

for (i = 0; i <= nr; i++) { r = i * dr;

for (j = 0; j <= nt; j++) { theta = j * dt;

x = r * cos(theta);

y = r * sin(theta);

z = u[i][j];

fprintf(data, "%f %f %f\n", x, y, z);

}

fprintf(data, "\n");

}

fclose(data);

msleep(100);

return 0;

}

void close_gnuplot() {

pclose(gnuplot);

unlink(temp_name);

} /*

* msleep.c -- ミリ秒単位のタイマー

*/

#include <sys/types.h>

#include <sys/time.h>

int msleep(int ms) {

struct timeval timeout;

timeout.tv_sec = ms / 1000;

timeout.tv_usec = (ms % 1000) * 1000;

if (select(0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, &timeout) < 0) { perror("usleep");

return -1;

}

return 0;

}

関連図書

[1] Stanley J. Farlow. Partial Differential Equations for Scientists and Engineers. John Wiley & Sons, Inc, 1982.

邦訳

:

スタンリー・ファーロウ 著

,

入理 正夫・入理 由美 訳

,

偏 微分方程式

,

朝倉書店

(1996).

[2]

一松信. 特殊関数入門. 森北出版, 1999.

[3]

庵原謙治

.

古典的

bessel

函数入門

. http://nalab.mind.kobe-u.ac.jp/HOME/iohara/

doc/Bessel.pdf.

[4]

金子あきら

.

偏微分方程式入門

.

東京大学出版会

, 1998.

[5]

笠原晧司こ う じ

.

微分方程式の基礎

.

数理科学ライブラリー

.

朝倉書店

, 1982.

[6]

桂田祐史

.

解析概論

I

講義ノート

. http://nalab.mind.meiji.ac.jp/~mk/lecture/

kaisekigairon-1/pdf/textbook1-2002-full.pdf, 1995–2002.

[7]

桂田祐史. 微分方程式

2

講義ノート

(旧「応用解析 II」). http://nalab.mind.meiji.ac.

jp/~mk/lecture/pde/pde2013.pdf, 1997

年〜

.

[8]

桂田祐史

.

常微分方程式ノート

. http://nalab.mind.meiji.ac.jp/~mk/labo/text/

members/ODE.pdf, 2003.

[9]

桂田祐史

.

円柱領域における熱方程式に対する差分法

. http://nalab.mind.meiji.ac.

jp/~mk/labo/text/cylinder.pdf, 2004

12

月〜.

[10]

桂田祐史

. Bessel

関数の数値計算

. http://nalab.mind.meiji.ac.jp/%7Emk/labo/text/

computing-bessel-function.pdf, 2005

3

9

.

[11]

桂田祐史.

Laplacian

と極座標.

http://nalab.mind.meiji.ac.jp/~mk/labo/text/

polar-laplace.pdf, 2007

2

24

.

[12]

桂田祐史. 多変数の微分積分学

1

講義ノート.

http://nalab.mind.meiji.ac.jp/~mk/

lecture/tahensuu1-2013/tahensuu1-2011.pdf, 2011.

[13]

木村俊房

.

常微分方程式

II.

岩波講座 基礎数学

.

岩波書店

, 1977.

[14]

小松勇作. 特殊函数. 朝倉書店, 1967. 復刊

2004.

[15]

黒田しげとし成俊

.

関数解析

.

共立出版

, 1980.

[16]

岡田俊宣

.

円盤・円柱領域における熱方程式に対する差分法

. http://nalab.mind.meiji.

ac.jp/~mk/labo/report/open/2004-okada.pdf, 2005

2

月.

[17]

ときひろ

時弘哲治て つ じ

.

工学における特殊関数

.

工系数学講座

13.

共立出版

, 2006.

ドキュメント内 II ( (ページ 123-129)