[BACK]Return to tk_ode_by_mpfr-ja.texi CVS log [TXT][DIR] Up to [local] / OpenXM / src / asir-contrib / packages / doc / tk_ode_by_mpfr

Annotation of OpenXM/src/asir-contrib/packages/doc/tk_ode_by_mpfr/tk_ode_by_mpfr-ja.texi, Revision 1.5

1.5     ! takayama    1: %% %% $OpenXM: OpenXM/src/asir-contrib/packages/doc/tk_ode_by_mpfr/tk_ode_by_mpfr-ja.texi,v 1.4 2021/06/04 06:19:10 takayama Exp $
1.2       takayama    2: %% debug に ln -s ../texinfo-ja.tex . をしておく.  txi-ja.tex も?
1.1       takayama    3: %% xetex tk_ode_by_mpfr-ja.texi   (.texi までつける. )
                      4: %% 以下コメントは @comment で始める.  \input texinfo 以降は普通の tex 命令は使えない.
                      5: \input texinfo-ja
                      6: @iftex
                      7: @catcode`@#=6
                      8: @def@fref#1{@xrefX[#1,,@code{#1},,,]}
                      9: @def@b#1{{@bf #1}}
                     10: @catcode`@#=@other
                     11: @end iftex
                     12: @c tex
                     13: @c \overfullrule=0pt
                     14: @c end tex
                     15: @documentlanguage ja
                     16: @c -*-texinfo-*-
                     17: @comment %**start of header
                     18: @comment --- おまじない終り ---
                     19:
                     20: @comment --- GNU info ファイルの名前 ---
1.3       takayama   21: @setfilename asir-contrib-tk_ode_by_mpfr
1.1       takayama   22:
                     23: @comment --- タイトル ---
1.4       takayama   24: @settitle tk_ode_by_mpfr
1.1       takayama   25:
                     26: @comment %**end of header
                     27: @comment %@setchapternewpage odd
                     28:
                     29: @comment --- おまじない ---
                     30: @ifinfo
                     31: @macro fref{name}
                     32: @ref{\name\,,@code{\name\}}
                     33: @end macro
                     34: @end ifinfo
                     35:
                     36: @iftex
                     37: @comment @finalout
                     38: @end iftex
                     39:
                     40: @titlepage
                     41: @comment --- おまじない終り ---
                     42:
                     43: @comment --- タイトル, バージョン, 著者名, 著作権表示 ---
                     44: @title tk_ode_by_mpfr
                     45: @subtitle MPFR で ODE の数値解析をするC言語のコードを生成
                     46: @subtitle 1.0 版
1.5     ! takayama   47: @subtitle 2021 年 6 月 11 日
1.1       takayama   48:
                     49: @author  by Nobuki Takayama
                     50: @page
                     51: @vskip 0pt plus 1filll
                     52: Copyright @copyright{} Risa/Asir committers
                     53: 2020--2020. All rights reserved.
                     54: @end titlepage
                     55:
                     56: @comment --- おまじない ---
                     57: @synindex vr fn
                     58: @comment --- おまじない終り ---
                     59:
                     60: @comment --- @node は GNU info, HTML 用 ---
                     61: @comment --- @node  の引数は node-name,  next,  previous,  up ---
                     62: @node Top,, (dir), (dir)
                     63:
                     64: @comment --- @menu は GNU info, HTML 用 ---
                     65: @comment --- chapter 名を正確に並べる ---
                     66: @comment --- この文書では chapter XYZ, Chapter Index がある.
                     67: @comment ---  Chapter XYZ には section XYZについて, section XYZに関する函数がある.
                     68: @menu
                     69: * tk_ode_by_mpfrについて
                     70: * tk_ode_by_mpfr函数::
                     71: * Index::
                     72: @end menu
                     73:
                     74: @comment --- chapter の開始 ---
                     75: @comment --- 親 chapter 名を正確に. 親がない場合は Top ---
                     76: @node tk_ode_by_mpfrについて,,, Top
                     77: @chapter tk_ode_by_mpfrについて
                     78:
                     79: ODE(ordinary differential equation)をMPFR(任意精度小数パッケージ)を援用して数値解析するための
                     80: C言語のプログラムを生成する.
                     81: 下記のコマンドでこのパッケージがロードされる.
                     82: @example
                     83: load("tk_ode_by_mpfr.rr")$
                     84: @end example
                     85: @noindent
                     86:
                     87: @sp 3
                     88:
                     89: @noindent
                     90: このパッケージは HGM に出現する ODE の数値解析のために作成された.
                     91: HGM については次の web サイトを参照.
                     92: @itemize @bullet
                     93: @item [hgm]
                     94: @uref{http://www.math.kobe-u.ac.jp/OpenXM/Math/hgm/ref-hgm.html}
                     95: @end itemize
                     96:
                     97: @noindent
                     98: 内部函数の仕様は man-asir2mpfr.tex 参照(まだ未公開).
                     99: @c Ref: num-ht2/man-asir2mpfr.tex
                    100:
                    101: @node tk_ode_by_mpfr函数,,, Top
                    102: @chapter tk_ode_by_mpfr函数
                    103:
                    104: @menu
                    105: * pari::
                    106: @end menu
                    107:
                    108: @comment **********************************************************
                    109: @comment --- ◯◯◯◯  の説明
                    110: @comment --- 個々の函数の説明の開始 ---
                    111: @comment --- section 名を正確に ---
                    112: @node code_solve_ode_by_rk4_with_defuse,,, tk_ode_by_mpfr函数
                    113: @section @code{tk_ode_by_mpfr}
                    114: @comment --- 索引用キーワード
                    115: @findex code_solve_ode_by_rk4_with_defuse
                    116:
                    117: @table @t
                    118: @item code_solve_ode_by_rk4_with_defuse(@var{Pmat},@var{T0},@var{F0},@var{T1})
                    119: :: 係数 @var{Pmat} をもつ ODE の初期値問題を解くC言語のコードを生成する.
                    120: @end table
                    121:
                    122: @comment --- 引数の簡単な説明 ---  以下まだ書いてない.
                    123: @table @var
                    124: @item return
                    125: C言語のコード. main 函数を含む.
                    126: @item Pmat
                    127: ODE dF/dt = P F の係数行列 P(t). t の式を成分とすること.
                    128: @item T0
                    129: 初期時刻.
                    130: @item F0
                    131: 初期条件.
                    132: @item T1
                    133: 終了時刻. T1>T0 を満たすこと.
                    134: @end table
                    135:
                    136: @comment --- ここで函数の詳しい説明 ---
                    137: @comment --- @itemize〜@end itemize は箇条書き ---
                    138: @comment --- @bullet は黒点付き ---
                    139: @itemize @bullet
                    140: @item
                    141: dF/dt = PF を F(T0)=F0 の初期条件の元, 時刻 T1 まで求める.
                    142: @item
                    143: big float による matrix factorial を用いて計算する.
1.4       takayama  144: 仮数部(significand)のビットサイズは生成したプログラムに PREC の値として定義されている.
                    145: 仮数部のサイズを変更するには生成された C プログラムの #define PREC 64 の部分を
                    146: 変更するかこの関数の option prec を用いる.
1.1       takayama  147: @item
1.2       takayama  148: defusing heuristics や知られている値を用いて不安定性を
                    149: 回避コードも含む.
                    150: 初期値の値がエラーを含む場合, 本来の解でないものがドミナントとなる
                    151: 場合がある. この方法はそれを修正して解くのに有効である.
                    152: また知られている値が誤差を含む場合も有効である.
1.1       takayama  153: これらは下記の option 引数でコントロールする.
                    154: @end itemize
                    155:
                    156: @comment man-asir2mpfr.tex より
                    157: @c @verbatim
                    158: @c @end verbatim
                    159: @multitable {xxxxxxxxxx} {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} {xxxxxxxxxxxxxx}
                    160: @item Option @tab    @tab  default value
1.5     ! takayama  161: @item @var{ verbose} @tab  @tab  0
        !           162: @item @var{ prec}    @tab  significand size of MPFR @tab  64
        !           163: @item @var{ progname} @tab  @tab  @var{ tmp-test}
        !           164: @item @var{ h}       @tab  step size @tab  0.001
        !           165: @item @var{ t_noproj}@tab  time to apply defusing @tab  0
        !           166: @item @var{ n_prune} @tab  number of eigen vectors to prune @tab  1
        !           167: @item @var{ strat}   @tab  projection strategy @tab  1
        !           168: @item @var{ n_defuse}@tab  number of the matrix factorial @tab  5 [1/h]
        !           169: @item @var{ ref_value_file}@tab  File name of exact values @tab  @var{ tmp_ref_value.txt}
1.1       takayama  170: @end multitable
                    171:
                    172:
                    173: @sp 3
                    174: @noindent
                    175: 例:
                    176: Airy の微分方程式
                    177: dF/dt=[[0,1],[t,0]]F, F(0)=[0.355028053887817,-0.258819403792807]
                    178: の解 F(t) を t=10.1 まで計算.
                    179: @comment tk_mat2mpfr.rr, test0908();
                    180: @smallformat
                    181: @example
                    182: --> load("tk_ode_by_mpfr.rr");
                    183: --> Code=tk_ode_by_mpfr.code_solve_ode_by_rk4_with_defuse([[0,1],[t,0]],
                    184:      0,[0.355028053887817,-0.258819403792807],10.1 | h=0.001)$
                    185: -->  util_write_string_to_a_file("tmp-test.c",Code)$
                    186:
                    187: On the unix shell
1.5     ! takayama  188: ln -s $@{OpenXM_HOME@}/lib/asir-contrib/tk_ode_by_mpfr/proj.c tmp-proj.c
        !           189: cc -I$@{OpenXM_HOME@}/lib/asir-contrib/tk_ode_by_mpfr -DNN=2 -c tmp-proj.c
1.1       takayama  190: cc -o tmp-test tmp-test.c tmp-proj.o -lmpfr -lgmp  -lgsl -lgslcblas  -lm
                    191:
                    192: ./tmp-test --verbose --t_noproj 8.1 --n_defuse 2000 --n_prune 1
                    193: @end example
                    194: @end smallformat
                    195: @noindent
                    196: 上記の compile 用のコマンドは上記のコマンドが出力する.
                    197: --t_noproj 8.1 は t<8.1 までは4次の Runge-Kutta 法を適用する.
                    198: t=8.1 以降は --n_prune で指定した個数の固有空間(Re(固有値)の順)の成分
                    199: を削除する.
                    200: --n_defuse 2000 は 2000 個の行列の matrix factorial を計算する.
                    201:
1.4       takayama  202: @sp 3
                    203: @noindent
                    204: 例:
                    205: H^k_n(1,t) k=10, n=1, 10000<=t<=10100 の計算とその値fと真の値Hとの relative error (f-H)/Hの計算.
                    206: "Hkn10000" は "h2" でもよい(alias).
                    207: @smallformat
                    208: @example
                    209: --> load("tk_ode_assert.rr");
                    210: --> tk_ode_assert.usage_assert();   // Usage of assert
                    211: --> tk_ode_assert.hkn2()
                    212: ==>   Compile tmp-test.c following the instruction.
                    213: ==>   ./tmp-test --go --output_stepsize 1 | grep '^gnuplot' | awk '{print $2,$3}' > t.txt
                    214:       // Data is stored in t.txt.
                    215: -->  tk_ode_assert.output_relative_error("Hkn10000","t.txt"|zoom=10^4301);
                    216:   // The initial value for tmp-test is multiplied by 10^4301.
                    217:   // Output tmp-rerror.txt
                    218: ==>   Start the gnuplot and plot "tmp-rerror.txt" w lp to show the relative error
                    219: @end example
                    220: @end smallformat
1.1       takayama  221: @noindent
                    222:
1.4       takayama  223: @sp 3
                    224: @noindent
                    225: 例: Airy や H^k_n(1,t) で 1<=t<=400 で同様.
                    226: @smallformat
                    227: @example
                    228: --> tk_ode_assert.airy1()
                    229: ==>   Run tmp-test
                    230: --> tk_ode_assert.output_relative_error("a","t.txt"|zoom=1);
                    231:
                    232: --> tk_ode_assert.hkn1()
                    233: ==>   Run tmp-test
                    234: --> tk_ode_assert.output_relative_error("h","t.txt"|zoom=1);
                    235: @end example
                    236: @end smallformat
                    237: @noindent
1.1       takayama  238:
                    239:
                    240: @comment --- 参照(リンク)を書く ---
                    241: @table @t
                    242: @item 参照
                    243: @comment @ref{code_mat_fac_mpfr}
                    244: @end table
                    245:
                    246: @comment --- ChangeLog を書く. ソースコードの位置. 変更日時 など CVSサーバを見るため
                    247: @noindent
                    248: ChangeLog
                    249: @itemize @bullet
                    250: @item
                    251:  tk_ode_by_mpfr/tk_man2mpfr.rr
                    252: @end itemize
                    253:
                    254:
                    255: @comment --- おまじない ---
                    256: @node Index,,, Top
                    257: @unnumbered Index
                    258: @printindex fn
                    259: @printindex cp
                    260: @iftex
                    261: @vfill @eject
                    262: @end iftex
                    263: @summarycontents
                    264: @contents
                    265: @bye
                    266: @comment --- おまじない終り ---
                    267:
                    268:
                    269: @comment テンプレート.  start_of_template.
                    270: @comment **********************************************************
                    271: @comment --- ◯◯◯◯  の説明
                    272: @comment --- 個々の函数の説明の開始 ---
                    273: @comment --- section 名を正確に ---
                    274: @node gtt_ekn3.hoge,,, 超幾何函数E(k,n)
                    275: @subsection @code{gtt_ekn3.hoge}
                    276: @comment --- 索引用キーワード
                    277: @findex gtt_ekn3.hoge
                    278:
                    279: @table @t
                    280: @item gtt_ekn3.hoge(@var{i})
                    281: ::
                    282: @end table
                    283:
                    284: @comment --- 引数の簡単な説明 ---  以下まだ書いてない.
                    285: @table @var
                    286: @item i  hage
                    287: @item return
                    288: @end table
                    289:
                    290: @comment --- ここで函数の詳しい説明 ---
                    291: @comment --- @itemize〜@end itemize は箇条書き ---
                    292: @comment --- @bullet は黒点付き ---
                    293: @itemize @bullet
                    294: @item 説明.
                    295: @end itemize
                    296:
                    297: @comment --- @example〜@end example は実行例の表示 ---
                    298: 例:
                    299: @example
                    300: [2221] gtt_ekn3.hoge([[1,4],[2,3]]);
                    301: @end example
                    302:
                    303:
                    304: @comment --- 参照(リンク)を書く ---
                    305: @table @t
                    306: @item 参照
                    307: @ref{gtt_ekn3.nc}
                    308: @ref{gtt_ekn3.gmvector}
                    309: @end table
                    310:
                    311: @comment --- ChangeLog を書く. ソースコードの位置. 変更日時 など CVSサーバを見るため
                    312: @noindent
                    313: ChangeLog
                    314: @itemize @bullet
                    315: @item
                    316: @end itemize
                    317: @comment end_of_template
                    318:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>