[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

File: [local] / OpenXM / src / asir-contrib / packages / doc / tk_ode_by_mpfr / tk_ode_by_mpfr-ja.texi (download)

Revision 1.6, Mon Jun 14 23:07:27 2021 UTC (3 years ago) by takayama
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +25 -10 lines

tk_c_form accepts expression (@e)^n and translates to exp(n).

%% %% $OpenXM: OpenXM/src/asir-contrib/packages/doc/tk_ode_by_mpfr/tk_ode_by_mpfr-ja.texi,v 1.6 2021/06/14 23:07:27 takayama Exp $
%% debug に ln -s ../texinfo-ja.tex . をしておく.  txi-ja.tex も?
%% xetex tk_ode_by_mpfr-ja.texi   (.texi までつける. ) 
%% 以下コメントは @comment で始める.  \input texinfo 以降は普通の tex 命令は使えない.
\input texinfo-ja
@iftex
@catcode`@#=6
@def@fref#1{@xrefX[#1,,@code{#1},,,]}
@def@b#1{{@bf #1}}
@catcode`@#=@other
@end iftex
@c tex
@c \overfullrule=0pt
@c end tex
@documentlanguage ja
@c -*-texinfo-*-
@comment %**start of header
@comment --- おまじない終り ---

@comment --- GNU info ファイルの名前 ---
@setfilename asir-contrib-tk_ode

@comment --- タイトル ---
@settitle tk_ode

@comment %**end of header
@comment %@setchapternewpage odd

@comment --- おまじない ---
@ifinfo
@macro fref{name}
@ref{\name\,,@code{\name\}}
@end macro
@end ifinfo

@iftex
@comment @finalout
@end iftex

@titlepage
@comment --- おまじない終り ---

@comment --- タイトル, バージョン, 著者名, 著作権表示 ---
@title tk_ode
@subtitle ODE の数値解析のためのパッケージ群
@subtitle 1.0 版
@subtitle 2021 年 6 月 13 日

@author  by Nobuki Takayama
@page
@vskip 0pt plus 1filll
Copyright @copyright{} Risa/Asir committers
2020--2020. All rights reserved.
@end titlepage

@comment --- おまじない ---
@synindex vr fn
@comment --- おまじない終り ---

@comment --- @node は GNU info, HTML 用 ---
@comment --- @node  の引数は node-name,  next,  previous,  up ---
@node Top,, (dir), (dir)

@comment --- @menu は GNU info, HTML 用 ---
@comment --- chapter 名を正確に並べる ---
@comment --- この文書では chapter XYZ, Chapter Index がある.
@comment ---  Chapter XYZ には section XYZについて, section XYZに関する函数がある.
@menu
* tk_odeについて
* tk_ode_by_mpfr函数::
* tk_ode_sparse_interp函数::
* Index::
@end menu

@comment --- chapter の開始 ---
@comment --- 親 chapter 名を正確に. 親がない場合は Top ---
@node tk_odeについて,,, Top
@chapter tk_oderについて

この文書は ODE の数値解析を補助するパッケージ群のマニュアルである.
パッケージは多くのファイルに分かれており,
@example
load("tk_ode.rr")$
@end example
とするとすべてのパッケージをロードできる.

主なパッケージは単独で読み込める.
ODE(ordinary differential equation)をMPFR(任意精度小数パッケージ)を援用して数値解析するための
C言語のプログラムを生成パッケージが tk_ode_by_mpfr である.
下記のコマンドでこのパッケージがロードされる.
@example
load("tk_ode_by_mpfr.rr")$
@end example
@noindent

@sp 3

@noindent
このパッケージは HGM に出現する ODE の数値解析のために作成された.
HGM については次の web サイトを参照.
@itemize @bullet
@item [hgm] 
@uref{http://www.math.kobe-u.ac.jp/OpenXM/Math/hgm/ref-hgm.html}
@end itemize

@noindent
内部函数の仕様は man-asir2mpfr.tex 参照(まだ未公開).
@c Ref: num-ht2/man-asir2mpfr.tex

@node tk_ode_by_mpfr函数,,, Top
@chapter tk_ode_by_mpfr函数

@menu
* pari::
@end menu

@comment **********************************************************
@comment --- ◯◯◯◯  の説明 
@comment --- 個々の函数の説明の開始 ---
@comment --- section 名を正確に ---
@node code_solve_ode_by_rk4_with_defuse,,, tk_ode_by_mpfr函数
@section @code{tk_ode_by_mpfr}
@comment --- 索引用キーワード
@findex code_solve_ode_by_rk4_with_defuse

@table @t
@item code_solve_ode_by_rk4_with_defuse(@var{Pmat},@var{T0},@var{F0},@var{T1})
:: 係数 @var{Pmat} をもつ ODE の初期値問題を解くC言語のコードを生成する.
@end table

@comment --- 引数の簡単な説明 ---  以下まだ書いてない.
@table @var
@item return
C言語のコード. main 函数を含む.
@item Pmat
ODE dF/dt = P F の係数行列 P(t). t の式を成分とすること.
@item T0
初期時刻.
@item F0
初期条件.
@item T1
終了時刻. T1>T0 を満たすこと. 
@end table

@comment --- ここで函数の詳しい説明 ---
@comment --- @itemize〜@end itemize は箇条書き ---
@comment --- @bullet は黒点付き ---
@itemize @bullet
@item 
dF/dt = PF を F(T0)=F0 の初期条件の元, 時刻 T1 まで求める.
@item 
big float による matrix factorial を用いて計算する.
仮数部(significand)のビットサイズは生成したプログラムに PREC の値として定義されている.
仮数部のサイズを変更するには生成された C プログラムの #define PREC 64 の部分を
変更するかこの関数の option prec を用いる.
@item 
defusing heuristics や知られている値を用いて不安定性を
回避コードも含む.
初期値の値がエラーを含む場合, 本来の解でないものがドミナントとなる
場合がある. この方法はそれを修正して解くのに有効である.
また知られている値が誤差を含む場合も有効である.
これらは下記の option 引数でコントロールする.
@end itemize

@comment man-asir2mpfr.tex より
@c @verbatim
@c @end verbatim
@multitable {xxxxxxxxxx} {xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx} {xxxxxxxxxxxxxx}
@item Option @tab    @tab  default value 
@item @var{ verbose} @tab  @tab  0 
@item @var{ prec}    @tab  significand size of MPFR @tab  64 
@item @var{ progname} @tab  @tab  @var{ tmp-test} 
@item @var{ h}       @tab  step size @tab  0.001 
@item @var{ t_noproj}@tab  time to apply defusing @tab  0 
@item @var{ n_prune} @tab  number of eigen vectors to prune @tab  1 
@item @var{ strat}   @tab  projection strategy @tab  1 
@item @var{ n_defuse}@tab  number of the matrix factorial @tab  5 [1/h] 
@item @var{ ref_value_file}@tab  File name of exact values @tab  @var{ tmp_ref_value.txt} 
@end multitable


@sp 3
@noindent
例:
Airy の微分方程式
dF/dt=[[0,1],[t,0]]F, F(0)=[0.355028053887817,-0.258819403792807]
の解 F(t) を t=10.1 まで計算.
@comment tk_mat2mpfr.rr, test0908();
@smallformat
@example
--> load("tk_ode_by_mpfr.rr"); 
--> Code=tk_ode_by_mpfr.code_solve_ode_by_rk4_with_defuse([[0,1],[t,0]],
     0,[0.355028053887817,-0.258819403792807],10.1 | h=0.001)$
-->  util_write_string_to_a_file("tmp-test.c",Code)$

On the unix shell
ln -s $@{OpenXM_HOME@}/lib/asir-contrib/tk_ode_by_mpfr/proj.c tmp-proj.c 
cc -I$@{OpenXM_HOME@}/lib/asir-contrib/tk_ode_by_mpfr -DNN=2 -c tmp-proj.c
cc -o tmp-test tmp-test.c tmp-proj.o -lmpfr -lgmp  -lgsl -lgslcblas  -lm

./tmp-test --verbose --t_noproj 8.1 --n_defuse 2000 --n_prune 1
@end example
@end smallformat
@noindent
上記の compile 用のコマンドは上記のコマンドが出力する.
--t_noproj 8.1 は t<8.1 までは4次の Runge-Kutta 法を適用する.
t=8.1 以降は --n_prune で指定した個数の固有空間(Re(固有値)の順)の成分
を削除する.
--n_defuse 2000 は 2000 個の行列の matrix factorial を計算する.

@sp 3
@noindent
例:
H^k_n(1,t) k=10, n=1, 10000<=t<=10100 の計算とその値fと真の値Hとの relative error (f-H)/Hの計算.
"Hkn10000" は "h2" でもよい(alias).
@smallformat
@example
--> load("tk_ode_assert.rr");
--> tk_ode_assert.usage_assert();   // Usage of assert
--> tk_ode_assert.hkn2()
==>   Compile tmp-test.c following the instruction.
==>   ./tmp-test --go --output_stepsize 1 | grep '^gnuplot' | awk '{print $2,$3}' > t.txt
      // Data is stored in t.txt. 
-->  tk_ode_assert.output_relative_error("Hkn10000","t.txt"|zoom=10^4301); 
  // The initial value for tmp-test is multiplied by 10^4301. 
  // Output tmp-rerror.txt
==>   Start the gnuplot and plot "tmp-rerror.txt" w lp to show the relative error
@end example
@end smallformat
@noindent

@sp 3
@noindent
例: Airy や H^k_n(1,t) で 1<=t<=400 で同様.
@smallformat
@example
--> tk_ode_assert.airy1()
==>   Run tmp-test
--> tk_ode_assert.output_relative_error("a","t.txt"|zoom=1);

--> tk_ode_assert.hkn1()
==>   Run tmp-test
--> tk_ode_assert.output_relative_error("h","t.txt"|zoom=1);
@end example
@end smallformat
@noindent


@comment --- 参照(リンク)を書く ---
@table @t
@item 参照
@comment @ref{code_mat_fac_mpfr}
@end table

@comment --- ChangeLog を書く. ソースコードの位置. 変更日時 など CVSサーバを見るため
@noindent
ChangeLog
@itemize @bullet
@item
 tk_ode_by_mpfr/tk_man2mpfr.rr
@end itemize

@node tk_ode_sparse_interp函数,,, Top
@chapter tk_ode_sparse_interp函数

@menu
* pari::
@end menu

@comment --- おまじない ---
@node Index,,, Top
@unnumbered Index
@printindex fn
@printindex cp
@iftex
@vfill @eject
@end iftex
@summarycontents
@contents
@bye
@comment --- おまじない終り ---


@comment テンプレート.  start_of_template.
@comment **********************************************************
@comment --- ◯◯◯◯  の説明 
@comment --- 個々の函数の説明の開始 ---
@comment --- section 名を正確に ---
@node gtt_ekn3.hoge,,, 超幾何函数E(k,n)
@subsection @code{gtt_ekn3.hoge}
@comment --- 索引用キーワード
@findex gtt_ekn3.hoge

@table @t
@item gtt_ekn3.hoge(@var{i})
:: 
@end table

@comment --- 引数の簡単な説明 ---  以下まだ書いてない.
@table @var
@item i  hage
@item return  
@end table

@comment --- ここで函数の詳しい説明 ---
@comment --- @itemize〜@end itemize は箇条書き ---
@comment --- @bullet は黒点付き ---
@itemize @bullet
@item 説明.
@end itemize

@comment --- @example〜@end example は実行例の表示 ---
例: 
@example
[2221] gtt_ekn3.hoge([[1,4],[2,3]]);
@end example


@comment --- 参照(リンク)を書く ---
@table @t
@item 参照
@ref{gtt_ekn3.nc}
@ref{gtt_ekn3.gmvector}
@end table

@comment --- ChangeLog を書く. ソースコードの位置. 変更日時 など CVSサーバを見るため
@noindent
ChangeLog
@itemize @bullet
@item
@end itemize
@comment end_of_template