dassl.xml, ode.xml and intg.xml updated. ilib_for_link only accepts the names of... 85/19085/5
Adeline CARNIS [Fri, 10 Feb 2017 14:12:30 +0000 (15:12 +0100)]
Change-Id: I0cf83aeb06aeeb5a9946bc7757ca11bd83c3ffce

14 files changed:
scilab/modules/differential_equations/help/en_US/dassl.xml
scilab/modules/differential_equations/help/en_US/intg.xml
scilab/modules/differential_equations/help/en_US/ode.xml
scilab/modules/differential_equations/help/fr_FR/intg.xml
scilab/modules/differential_equations/help/fr_FR/ode.xml
scilab/modules/differential_equations/help/ja_JP/dassl.xml
scilab/modules/differential_equations/help/ja_JP/intg.xml
scilab/modules/differential_equations/help/ja_JP/ode.xml
scilab/modules/differential_equations/help/pt_BR/dassl.xml
scilab/modules/differential_equations/help/pt_BR/intg.xml
scilab/modules/differential_equations/help/pt_BR/ode.xml
scilab/modules/differential_equations/help/ru_RU/dassl.xml
scilab/modules/differential_equations/help/ru_RU/intg.xml
scilab/modules/differential_equations/help/ru_RU/ode.xml

index 3d90536..1f0dba9 100644 (file)
@@ -366,6 +366,7 @@ y3=dassl([y0,yd0],0,t,list(chemres,0.04,1d4,3d7),list(chemjac,0.04,1d4,3d7));
 //using C code
 //------------
 // - create the C code
+cd TMPDIR
 rescode=['void chemres(double *t, double y[], double yd[], double r[], int *ires, double rpar[], int ipar[])'
          ' {'
          '   r[0] = -0.04*y[0]+1.0e4*y[1]*y[2]                -yd[0];'
@@ -389,13 +390,13 @@ jaccode=['void chemjac(double *t, double y[], double yd[], double pd[], double *
          '   pd[7] = -1.0e4*y[1];'
          '   pd[8] =  1.0;'
          ' }'];
-mputl([rescode;jaccode],fullfile(TMPDIR,'mycode.c')) //create the C file
+mputl([rescode;jaccode],'mycode.c') //create the C file
 
 // - compile it
-ilib_for_link(['chemres','chemjac'],fullfile(TMPDIR,'mycode.c'),[],'c','',fullfile(TMPDIR,'loader.sce'));//compile
+ilib_for_link(['chemres','chemjac'],'mycode.c',[],'c','','loader.sce');//compile
 
 // - link it with Scilab
-exec(fullfile(TMPDIR,'loader.sce')) //incremental linking
+exec('loader.sce') //incremental linking
 
 // - call dassl
 y4=dassl([y0,yd0],0,t,'chemres','chemjac');
index b807e8f..562834e 100644 (file)
@@ -186,10 +186,10 @@ F=['      double precision function ffun(x)'
    '      ffun=x*sin(30.0d+0*x)/sqrt(1.0d+0-(x/(2.0d+0*pi))**2)'
    '      return'
    '      end'];
-mputl(F,fullfile(TMPDIR,'ffun.f'))
+mputl(F,'ffun.f')
 
 // compile the function
-l=ilib_for_link('ffun',fullfile(TMPDIR,'ffun.f'),[],'f');
+l=ilib_for_link('ffun','ffun.f',[],'f');
 
 // add the function to the working environment
 link(l,'ffun','f')
@@ -207,10 +207,10 @@ C=['#include <math.h>'
    '  y=*x/(2.0e0*pi);'
    '  return *x*sin(30.0e0**x)/sqrt(1.0e0-y*y);'
    '}'];
-mputl(C,fullfile(TMPDIR,'cfun.c'))
+mputl(C,'cfun.c')
 
 // compile the function
-l=ilib_for_link('cfun',fullfile(TMPDIR,'cfun.c'),[],'c');
+l=ilib_for_link('cfun','cfun.c',[],'c');
 
 // add the function to the working environment
 link(l,'cfun','c')
index 258838e..919b8a1 100644 (file)
@@ -551,8 +551,9 @@ ccode=['#include <math.h>'
        '}']
 mputl(ccode,TMPDIR+'/myode.c') //create the C file
 // Compile
-ilib_for_link('myode','myode.c',[],'c',[],TMPDIR+'/loader.sce');
-exec(TMPDIR+'/loader.sce') //incremental linking
+cd TMPDIR
+ilib_for_link('myode','myode.c',[],'c',[],'loader.sce');
+exec('loader.sce') //incremental linking
 y0=0;
 t0=0;
 t=0:0.1:%pi;
index 21415bf..d273980 100644 (file)
@@ -172,10 +172,10 @@ F=['      double precision function ffun(x)'
    '      ffun=x*sin(30.0d+0*x)/sqrt(1.0d+0-(x/(2.0d+0*pi))**2)'
    '      return'
    '      end'];
-mputl(F,fullfile(TMPDIR,'ffun.f'))
+mputl(F,'ffun.f')
 
 // compilation du code Fortran
-l=ilib_for_link('ffun',fullfile(TMPDIR,'ffun.f'),[],'f');
+l=ilib_for_link('ffun','ffun.f',[],'f');
 
 // link incrémental
 link(l,'ffun','f')
@@ -193,10 +193,10 @@ C=['#include <math.h>'
    '  y=*x/(2.0e0*pi);'
    '  return *x*sin(30.0e0**x)/sqrt(1.0e0-y*y);'
    '}'];
-mputl(C,fullfile(TMPDIR,'cfun.c'))
+mputl(C,'cfun.c')
 
 // compilation du code C
-l=ilib_for_link('cfun',fullfile(TMPDIR,'cfun.c'),[],'c');
+l=ilib_for_link('cfun','cfun.c',[],'c');
 
 // incremental linking
 link(l,'cfun','c')
index 01449a0..a6fbf1f 100644 (file)
@@ -395,8 +395,9 @@ ccode=['#include <math.h>'
        '  ydot[0]=y[0]*y[0]-y[0]*sin(*t)+cos(*t);'
        '}']
 mputl(ccode,TMPDIR+'/myode.c') //create the C file
-ilib_for_link('myode','myode.c',[],'c',[],TMPDIR+'/loader.sce');//compile
-exec(TMPDIR+'/loader.sce') //incremental linking
+cd TMPDIR
+ilib_for_link('myode','myode.c',[],'c',[],'loader.sce');//compile
+exec('loader.sce') //incremental linking
 y0=0;t0=0;t=0:0.1:%pi;
 y=ode(y0,t0,t,'myode');
 
index 773675b..1620329 100644 (file)
  -->
 
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="dassl" xml:lang="ja">
-
+    
     <refnamediv>
-
+        
         <refname>dassl</refname>
-
+        
         <refpurpose>微分代数方程式</refpurpose>
-
+        
     </refnamediv>
-
+    
     <refsynopsisdiv>
-
+        
         <title>呼出し手順</title>
-
+        
         <synopsis>[r [,hd]]=dassl(x0,t0,t [,atol,[rtol]],res [,jac] [,info] [,hd])</synopsis>
-
+        
     </refsynopsisdiv>
-
+    
     <refsection>
-
+        
         <title>引数</title>
-
+        
         <variablelist>
-
+            
             <varlistentry>
-
+                
                 <term>x0</term>
-
+                
                 <listitem>
-
+                    
                     <para>
-
+                        
                         <literal>y0</literal> (<literal>ydot0</literal> は
-
+                        
                         0 を初期推定値として<literal>dassl</literal>で推定されたもの)
-
+                        
                         または行列<literal>[y0 ydot0]</literal>のどちらかです.
-
+                        
                         <literal>g(t,y0,ydot0)</literal>は 0 に等しい必要があります.
-
+                        
                         <literal>ydot0</literal>の推定値のみが既知の場合,
-
+                        
                         <literal>info(7)=1</literal> と設定してください.
-
+                        
                     </para>
-
+                    
                     <variablelist>
-
+                        
                         <varlistentry>
-
+                            
                             <term>y0</term>
-
+                            
                             <listitem>
-
+                                
                                 <para>初期条件の実数列ベクトル.</para>
-
+                                
                             </listitem>
-
+                            
                         </varlistentry>
-
+                        
                         <varlistentry>
-
+                            
                             <term>ydot0</term>
-
+                            
                             <listitem>
-
+                                
                                 <para>
-
+                                    
                                     <literal>t0</literal>における<literal>y</literal>の時間微分の
-
+                                    
                                     実数列ベクトル (推定値の場合もある).
-
+                                    
                                 </para>
-
+                                
                             </listitem>
-
+                            
                         </varlistentry>
-
+                        
                     </variablelist>
-
+                    
                 </listitem>
-
+                
             </varlistentry>
-
+            
             <varlistentry>
-
+                
                 <term>t0</term>
-
+                
                 <listitem>
-
+                    
                     <para>初期時間を表す実数.</para>
-
+                    
                 </listitem>
-
+                
             </varlistentry>
-
+            
             <varlistentry>
-
+                
                 <term>t</term>
-
+                
                 <listitem>
-
+                    
                     <para>実数のスカラーおよびベクトル. 解を求める時間を指定します.
-
+                        
                         <literal>info(2)=1</literal>を設定することにより,
-
+                        
                         dasslの各ステップ点での解を得ることができることに注意してください.
-
+                        
                     </para>
-
+                    
                 </listitem>
-
+                
             </varlistentry>
-
+            
             <varlistentry>
-
+                
                 <term>atol, rtol</term>
-
+                
                 <listitem>
-
+                    
                     <para>
-
+                        
                         実数スカラーまたは<literal>y</literal>と同じ大きさの列ベクトル.
-
+                        
                         <literal>atol, rtol</literal> はそれぞれ絶対および相対許容誤差を指定します.
-
+                        
                         ベクトルの場合,<literal>y</literal>の各要素毎に許容誤差が指定されます.
-
+                        
                     </para>
-
+                    
                 </listitem>
-
+                
             </varlistentry>
-
+            
             <varlistentry>
-
+                
                 <term>res</term>
-
+                
                 <listitem>
-
+                    
                     <para>
-
+                        
                         <link linkend="external">外部</link> (関数またはリストまたは文字列).
-
+                        
                         <literal>g(t,y,ydot)</literal>の値を計算. 以下のようにします :
-
+                        
                     </para>
-
+                    
                     <itemizedlist>
-
+                        
                         <listitem>
-
+                            
                             <para>Scilab関数.</para>
-
+                            
                             <para>呼び出し手順は
-
+                                
                                 <literal>[r,ires]=res(t,y,ydot)</literal> とする必要があり,
-
+                                
                                 <literal>res</literal> は残差
-
+                                
                                 <literal>r=g(t,y,ydot)</literal> と誤差フラグ<literal>ires</literal>を
-
+                                
                                 返す必要があります.
-
+                                
                                 <literal>res</literal>が<literal>r</literal>の計算に
-
+                                
                                 成功した場合には<literal>ires = 0</literal>,
-
+                                
                                 <literal>(t,x,xdot)</literal>のローカルな残差が定義されない
-
+                                
                                 場合には <literal>=-1</literal>,
-
+                                
                                 パラメータが許容範囲外の場合は <literal>=-2</literal> となります.
-
+                                
                             </para>
-
+                            
                         </listitem>
-
+                        
                         <listitem>
-
+                            
                             <para>リスト.</para>
-
+                            
                             <para>外部ルーチンのこの形式は
-
+                                
                                 関数にパラメータを指定する際に使用されます.
-
+                                
                                 以下のような形式とします:
-
+                                
                             </para>
-
+                            
                             <programlisting role="no-scilab-exec"><![CDATA[
 list(res,x1,x2,...)
  ]]></programlisting>
-
+                            
                             <para>
-
+                                
                                 ただし,ここで関数<literal>res</literal>の呼び出し手順は
-
+                                
                                 以下のようになります
-
+                                
                             </para>
-
+                            
                             <programlisting role="no-scilab-exec"><![CDATA[
 r=res(t,y,ydot,x1,x2,...)
  ]]></programlisting>
-
+                            
                             <para>
-
+                                
                                 この場合も<literal>res</literal> は
-
+                                
                                 <literal>(t,y,ydot,x1,x2,...)</literal>の関数として<literal>r=g(t,y,ydot)</literal>
-
+                                
                                 を返します.
-
+                                
                             </para>
-
+                            
                         </listitem>
-
+                        
                         <listitem>
-
+                            
                             <para>文字列.</para>
-
+                            
                             <para>
-
+                                
                                 ScilabにリンクされるCまたはFortranサブルーチンの名前を指します.
-
+                                
                             </para>
-
+                            
                             <para>Cの場合,呼び出し手順は次のようになります:</para>
-
+                            
                             <programlisting role="no-scilab-exec"><![CDATA[
 void res(double *t, double y[], double yd[], double r[],
          int *ires, double rpar[], int ipar[])
  ]]></programlisting>
-
+                            
                             <para>Fortranの場合,呼び出し手順は次のようになります:</para>
-
+                            
                             <programlisting role="no-scilab-exec"><![CDATA[
 subroutine res(t,y,yd,r,ires,rpar,ipar)
 double precision t, y(*),yd(*),r(*),rpar(*)
 integer ires,ipar(*)
  ]]></programlisting>
-
+                            
                             <para>
-
+                                
                                 <literal>rpar</literal> と <literal>ipar</literal> 配列は存在しますが,
-
+                                
                                 使用できません.
-
+                                
                             </para>
-
+                            
                         </listitem>
-
+                        
                     </itemizedlist>
-
+                    
                 </listitem>
-
+                
             </varlistentry>
-
+            
             <varlistentry>
-
+                
                 <term>jac</term>
-
+                
                 <listitem>
-
+                    
                     <para>外部 (関数またはリストまたは文字列).
-
+                        
                         指定したパラメータ<literal>cj</literal>の値を用いて
-
+                        
                         <literal>dg/dy+cj*dg/dydot</literal> の値を計算します.
-
+                        
                     </para>
-
+                    
                     <itemizedlist>
-
+                        
                         <listitem>
-
+                            
                             <para>Scilab関数.</para>
-
+                            
                             <para>その呼び出し手順は
-
+                                
                                 <literal>r=jac(t,y,ydot,cj)</literal> とする必要があり,
-
+                                
                                 <literal>jac</literal>関数は
-
+                                
                                 <literal>r=dg(t,y,ydot)/dy+cj*dg(t,y,ydot)/dydot</literal>を
-
+                                
                                 返す必要があります.
-
+                                
                                 ただし, <literal>cj</literal>は実数スカラーです
-
+                                
                             </para>
-
+                            
                         </listitem>
-
+                        
                         <listitem>
-
+                            
                             <para>リスト.</para>
-
+                            
                             <para>以下のようにする必要があります</para>
-
+                            
                             <programlisting role="no-scilab-exec"><![CDATA[
 list(jac,x1,x2,...)
  ]]></programlisting>
-
+                            
                             <para>
-
+                                
                                 ただしこの場合の関数<literal>jac</literal>の呼び出し手順は
-
+                                
                                 以下のようになります
-
+                                
                             </para>
-
+                            
                             <programlisting role="no-scilab-exec"><![CDATA[
 r=jac(t,y,ydot,cj,x1,x2,...)
  ]]></programlisting>
-
+                            
                             <para>
-
+                                
                                 この場合も<literal>jac</literal> は
-
+                                
                                 <literal>(t,y,ydot,cj,x1,x2,...)</literal>の関数として
-
+                                
                                 <literal>dg/dy+cj*dg/dydot</literal>を返します.
-
+                                
                             </para>
-
+                            
                         </listitem>
-
+                        
                         <listitem>
-
+                            
                             <para>文字列.</para>
-
+                            
                             <para>
-
+                                
                                 ScilabにリンクされるFortranサブルーチンの名前を指す
-
+                                
                                 必要があります
-
+                                
                             </para>
-
+                            
                             <para>Cの場合,呼び出し手順は次のようになります:</para>
-
+                            
                             <programlisting role="no-scilab-exec"><![CDATA[
 void jac(double *t, double y[], double yd[], double pd[],
          double *cj, double rpar[], int ipar[])
  ]]></programlisting>
-
+                            
                             <para>Fortranの場合, 呼び出し手順は次のようになります:</para>
-
+                            
                             <programlisting role="no-scilab-exec"><![CDATA[
 subroutine jac(t,y,yd,pd,cj,rpar,ipar)
 double precision t, y(*),yd(*),pd(*),cj,rpar(*)
 integer ipar(*)
  ]]></programlisting>
-
+                            
                         </listitem>
-
+                        
                     </itemizedlist>
-
+                    
                 </listitem>
-
+                
             </varlistentry>
-
+            
             <varlistentry>
-
+                
                 <term>info</term>
-
+                
                 <listitem>
-
+                    
                     <para>
-
+                        
                         <literal>7</literal> 個の要素を含むオプションのリスト.
-
+                        
                         デフォルト値は list([],0,[],[],[],0,0);
-
+                        
                     </para>
-
+                    
                     <variablelist>
-
+                        
                         <varlistentry>
-
+                            
                             <term>info(1)</term>
-
+                            
                             <listitem>
-
+                                
                                 <para>
-
+                                    
                                     <literal>g</literal>を評価できる時間の最大値
-
+                                    
                                     を指定する実数スカラー.
-
+                                    
                                     または,時間に制限を課さない場合には,空の行列
-
+                                    
                                     <literal>[]</literal>
-
+                                    
                                 </para>
-
+                                
                             </listitem>
-
+                            
                         </varlistentry>
-
+                        
                         <varlistentry>
-
+                            
                             <term>info(2)</term>
-
+                            
                             <listitem>
-
+                                
                                 <para>
-
+                                    
                                     <literal>dassl</literal> が
-
+                                    
                                     その中間的な計算値を返す(<literal>flag=1</literal>),
-
+                                    
                                     もしくはユーザが指定した時間においてのみ値を返す
-
+                                    
                                     (<literal>flag=0</literal>)
-
+                                    
                                     かどうかを指定するフラグ.
-
+                                    
                                 </para>
-
+                                
                             </listitem>
-
+                            
                         </varlistentry>
-
+                        
                         <varlistentry>
-
+                            
                             <term>info(3)</term>
-
+                            
                             <listitem>
-
+                                
                                 <para>
-
+                                    
                                     <literal>2</literal> 個の要素のベクトルで,
-
+                                    
                                     <literal>jac</literal>; <literal>r(i - j + ml + mu + 1,j) =
-
+                                        
                                         "dg(i)/dy(j)+cj*dg(i)/dydot(j)"
-
+                                        
                                     </literal>
-
+                                    
                                     により計算された
-
+                                    
                                     帯行列の定義<literal>[ml,mu]</literal>を指定します.
-
+                                    
                                     <literal>jac</literal> が完全な行列を返す場合,
-
+                                    
                                     <literal>info(3)=[]</literal> を指定します.
-
+                                    
                                 </para>
-
+                                
                             </listitem>
-
+                            
                         </varlistentry>
-
+                        
                         <varlistentry>
-
+                            
                             <term>info(4)</term>
-
+                            
                             <listitem>
-
+                                
                                 <para>実数スカラーで,
-
+                                    
                                     ステップの大きさの最大値を指定します.
-
+                                    
                                     制限をしない場合には,<literal>info(4)=[]</literal>
-
+                                    
                                     を指定してください.
-
+                                    
                                 </para>
-
+                                
                             </listitem>
-
+                            
                         </varlistentry>
-
+                        
                         <varlistentry>
-
+                            
                             <term>info(5)</term>
-
+                            
                             <listitem>
-
+                                
                                 <para>実数スカラーで,ステップの大きさの初期値を指定します.
-
+                                    
                                     指定しない場合には,<literal>info(5)=[]</literal>
-
+                                    
                                     を指定してください.
-
+                                    
                                 </para>
-
+                                
                             </listitem>
-
+                            
                         </varlistentry>
-
+                        
                         <varlistentry>
-
+                            
                             <term>info(6)</term>
-
+                            
                             <listitem>
-
+                                
                                 <para>
-
+                                    
                                     解が非負であることが既知の場合に<literal>info(6)=1</literal>に設定,
-
+                                    
                                     そうでない場合は <literal>info(6)=0</literal> に設定します.
-
+                                    
                                 </para>
-
+                                
                             </listitem>
-
+                            
                         </varlistentry>
-
+                        
                         <varlistentry>
-
+                            
                             <term>info(7)</term>
-
+                            
                             <listitem>
-
+                                
                                 <para>
-
+                                    
                                     <literal>ydot0</literal>が単なる推定値の場合は
-
+                                    
                                     <literal>info(7)=1</literal>,
-
+                                    
                                     <literal>g(t0,y0,ydot0)=0</literal>の場合は
-
+                                    
                                     <literal>info(7)=0</literal> を指定します.
-
+                                    
                                 </para>
-
+                                
                             </listitem>
-
+                            
                         </varlistentry>
-
+                        
                     </variablelist>
-
+                    
                 </listitem>
-
+                
             </varlistentry>
-
+            
             <varlistentry>
-
+                
                 <term>hd</term>
-
+                
                 <listitem>
-
+                    
                     <para>
-
+                        
                         実数ベクトルで,<literal>dassl</literal>のコンテキストを保存し,
-
+                        
                         積分を再開することを可能にします.
-
+                        
                     </para>
-
+                    
                 </listitem>
-
+                
             </varlistentry>
-
+            
             <varlistentry>
-
+                
                 <term>r</term>
-
+                
                 <listitem>
-
+                    
                     <para>実数行列. 各列はベクトル[t;x(t);xdot(t)]です.
-
+                        
                         ただし t は解を計算した時間です.
-
+                        
                     </para>
-
+                    
                 </listitem>
-
+                
             </varlistentry>
-
+            
         </variablelist>
-
+        
     </refsection>
-
+    
     <refsection>
-
+        
         <title>説明</title>
-
+        
         <para>
-
+            
             <literal>dassl</literal>関数は代数微分方程式を積分し,
-
+            
             指定した時間における <literal>y</literal> の
-
+            
             値を返します.
-
+            
         </para>
-
+        
         <programlisting role="no-scilab-exec"><![CDATA[
 g(t,y,ydot)=0
 y(t0)=y0  and   ydot(t0)=ydot0
   ]]></programlisting>
-
+        
     </refsection>
-
+    
     <refsection>
-
+        
         <title>例</title>
-
+        
         <programlisting role="example"><![CDATA[
 function [r,ires]=chemres(t,y,yd)
    r=[-0.04*y(1)+1d4*y(2)*y(3)-yd(1)
@@ -656,6 +656,7 @@ y3=dassl([y0,yd0],0,t,list(chemres,0.04,1d4,3d7),list(chemjac,0.04,1d4,3d7));
 // Cコードを使用
 //------------
 // - Cコードを作成
+cd TMPDIR
 rescode=['void chemres(double *t, double y[], double yd[], double r[], int *ires, double rpar[], int ipar[])'
          ' {'
          '   r[0] = -0.04*y[0]+1.0e4*y[1]*y[2]                -yd[0];'
@@ -678,60 +679,67 @@ jaccode=['void chemjac(double *t, double y[], double yd[], double pd[], double *
          '   pd[7] = -1.0e4*y[1];'
          '   pd[8] =  1.0;'
          ' }'];
-mputl([rescode;jaccode],fullfile(TMPDIR,'mycode.c')) //Cファイルを作成
+mputl([rescode;jaccode],'mycode.c') //Cファイルを作成
 // - コンパイル
-ilib_for_link(['chemres','chemjac'],fullfile(TMPDIR,'mycode.c'),[],'c','',fullfile(TMPDIR,'loader.sce'));//compile
+ilib_for_link(['chemres','chemjac'],'mycode.c',[],'c','','loader.sce');//compile
 // - Scilabにリンク
-exec(fullfile(TMPDIR,'loader.sce')) //incremental linking
+exec(loader.sce') //incremental linking
 // - dasslをコール
 y4=dassl([y0,yd0],0,t,'chemres','chemjac');
  ]]></programlisting>
-
+        
     </refsection>
-
+    
     <refsection role="see also">
-
+        
         <title>参照</title>
-
+        
         <simplelist type="inline">
-
+            
             <member>
-
+                
                 <link linkend="ode">ode</link>
-
+                
             </member>
-
+            
             <member>
-
+                
                 <link linkend="dasrt">dasrt</link>
-
+                
             </member>
-
+            
             <member>
-
+                
                 <link linkend="impl">impl</link>
-
+                
             </member>
-
+            
             <member>
+
                 <link linkend="call">call</link>
+                               
             </member>
-
+            
+            <member>    
+                <link linkend="fort">fort</link>
+                
+            </member>
+            
             <member>
-
+                
                 <link linkend="link">link</link>
-
+                
             </member>
-
+            
             <member>
-
+                
                 <link linkend="external">external</link>
-
+                
             </member>
-
+            
         </simplelist>
-
+        
     </refsection>
-
+    
 </refentry>
 
index 54790a5..b16e247 100644 (file)
  -->
 
 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="intg" xml:lang="ja">
-
+    
     <refnamediv>
-
+        
         <refname>intg</refname>
-
+        
         <refpurpose>定積分</refpurpose>
-
+        
     </refnamediv>
-
+    
     <refsynopsisdiv>
-
+        
         <title>呼び出し手順</title>
-
+        
         <synopsis>[v, err [,ierr]]=intg(a, b, f [,ea [,er]])</synopsis>
-
+        
     </refsynopsisdiv>
-
+    
     <refsection>
-
+        
         <title>引数</title>
-
+        
         <variablelist>
-
+            
             <varlistentry>
-
+                
                 <term>a, b</term>
-
+                
                 <listitem>
-
+                    
                     <para>実数</para>
-
+                    
                 </listitem>
-
+                
             </varlistentry>
-
+            
             <varlistentry>
-
+                
                 <term>f</term>
-
+                
                 <listitem>
-
+                    
                     <para>外部 (関数またはリストまたは文字列)</para>
-
+                    
                 </listitem>
-
+                
             </varlistentry>
-
+            
             <varlistentry>
-
+                
                 <term>ea, er</term>
-
+                
                 <listitem>
-
+                    
                     <para>実数</para>
-
+                    
                 </listitem>
-
+                
             </varlistentry>
-
+            
             <varlistentry>
-
+                
                 <term>ea</term>
-
+                
                 <listitem>
-
+                    
                     <para>結果に指定する絶対誤. デフォルト値:
-
+                        
                         1.d-14.
-
+                        
                     </para>
-
+                    
                 </listitem>
-
+                
             </varlistentry>
-
+            
             <varlistentry>
-
+                
                 <term>er</term>
-
+                
                 <listitem>
-
+                    
                     <para>結果に指定する相対誤差. デフォルト値:
-
+                        
                         1.d-8.
-
+                        
                     </para>
-
+                    
                 </listitem>
-
+                
             </varlistentry>
-
+            
             <varlistentry>
-
+                
                 <term>err</term>
-
+                
                 <listitem>
-
+                    
                     <para>結果に関する絶対誤差の推定値.</para>
-
+                    
                 </listitem>
-
+                
             </varlistentry>
-
+            
             <varlistentry>
-
+                
                 <term>ierr</term>
-
+                
                 <listitem>
-
+                    
                     <para>エラーフラグ番号(エラーが発生しなかった場合は 0).</para>
-
+                    
                 </listitem>
-
+                
             </varlistentry>
-
+            
         </variablelist>
-
+        
     </refsection>
-
+    
     <refsection>
-
+        
         <title>説明</title>
-
+        
         <para>
-
+            
             <literal>intg(a,b,f)</literal> は,
-
+            
             <literal>f(t)dt</literal>の
-
+            
             <literal>a</literal> から <literal>b</literal>までの
-
+            
             定積分を計算します.
-
+            
             関数 <literal>f(t)</literal> は連続である必要があります.
-
+            
         </para>
-
+        
         <para>
-
+            
             この計算は以下の精度を満たすことが期待されます:
-
+            
             <literal>abs(I-v)&lt;= max(ea,er*abs(I))</literal> ただし
-
+            
             <literal>I</literal> はこの積分の真値を意味します.
-
+            
         </para>
-
+        
         <para>
-
+            
             <literal>f</literal> は以下のような外部ルーチンです :
-
+            
         </para>
-
+        
         <para>
-
+            
             <literal>f</literal> が関数の場合,
-
+            
             <literal>y = f(t)</literal> のように定義されている必要があります.
-
+            
         </para>
-
+        
         <para>
-
+            
             <literal>f</literal> がリストの場合,
-
+            
             このリストは以下のようである必要があります:
-
+            
             <literal> list(f,x1,x2,...)</literal> ただし <literal>f</literal>
-
+            
             は呼び出し手順が <literal>f(t,x1,x2,...)</literal> の関数です.
-
+            
         </para>
-
+        
         <para>
-
+            
             <literal>f</literal> が文字列の場合,
-
+            
             以下の規定の呼出し手順を有する
-
+            
             Fortran関数またはCプロシージャの名前を指しています:
-
+            
         </para>
-
+        
         <para>
-
+            
             Fortran の場合, 呼出し手順は
-
+            
             <literal>double  precision function f(x)</literal> とします.
-
+            
             ただし, <literal>x</literal> も倍精度実数となります.
-
+            
         </para>
-
+        
         <para>
-
+            
             Cの場合, 呼出し手順は <literal>double
-
+                
                 f(double *x)
-
+                
             </literal>
-
+            
             とします.
-
+            
         </para>
-
+        
     </refsection>
-
+    
     <refsection>
-
+        
         <title>既知の制限</title>
-
+        
         <para>
-
+            
             他の積分ルーチンと同様に <literal>intg</literal> は
-
+            
             スパイク欠損の制約を受けます.
-
+            
         </para>
-
+        
         <para>
-
+            
             スパイクを有するフラットな関数は,
-
+            
             スパイクが十分にスティフな場合には完全にフラットな関数に見えます.
-
+            
         </para>
-
+        
         <para>
-
+            
             これは回避できず,積分処理の動作をよく知ることが必要です.
-
+            
             つまり,  <literal>intg</literal>は 21点 Gauss-Kronrod法を
-
+            
             使用します.
-
+            
             このため, 2つの連続する積分点の間にスパイクがある場合,
-
+            
             検出されず, この関数はスムーズであるとみなされます.
-
+            
         </para>
-
+        
         <para>
-
+            
             しかし, 関数が非常にスムースな場合には警告メッセージが発行されます.
-
+            
             この際,ユーザは積分区間を減らすよう提案されており,
-
+            
             スパイクを見失っていないかを検討する必要があります.
-
+            
         </para>
-
+        
         <para>
-
+            
             以下のグラフがこの現象を図示しています.
-
+            
         </para>
-
+        
         <scilab:image localized="true">
-
+            
             x = 0:.1:22;
-
+            
             y = zeros(1,221); y(1) = 3; y(96) = 1;
-
+            
             plot(x, y);
-
+            
             xtitle("Spike missed");
-
+            
         </scilab:image>
-
+        
         <para>
-
+            
             9番目と10番目の積分点の間に,検出されないスパイクがあり,
-
+            
             <literal>intg</literal> はこの関数をフラットであるとみなします.
-
+            
             次の図では, スパイクは十分に大きく,
-
+            
             積分点によりカバーされます.
-
+            
         </para>
-
+        
         <scilab:image localized="true">
-
+            
             x = 0:21;
-
+            
             y = zeros(1,22); y(1) = 3; y(10) = 1;
-
+            
             plot(x, y);
-
+            
             xtitle("Spike detected");
-
+            
         </scilab:image>
-
+        
         <para>
-
+            
             ソルバがエラーを発生した場合でも,
-
+            
             ユーザが計算された回を表示しようとすると,
-
+            
             3番目の出力引数<literal>ierr</literal>を追加する必要があり,
-
+            
             これによりエラーを警告に変換します.
-
+            
             これは主に丸め誤差の場合に使用されます.
-
+            
         </para>
-
+        
     </refsection>
-
+    
     <refsection>
-
+        
         <title>例</title>
-
+        
         <programlisting role="example"><![CDATA[
 //Scilabで記述された外部関数
 function y=f(x),y=x*sin(30*x)/sqrt(1-((x/(2*%pi))^2)),endfunction
@@ -349,9 +349,9 @@ F=['      double precision function ffun(x)'
    '      ffun=x*sin(30.0d+0*x)/sqrt(1.0d+0-(x/(2.0d+0*pi))**2)'
    '      return'
    '      end'];
-mputl(F,fullfile(TMPDIR,'ffun.f'))
+mputl(F,'ffun.f')
 // Fortranコードをコンパイル
-l=ilib_for_link('ffun',fullfile(TMPDIR,'ffun.f'),[],'f');
+l=ilib_for_link('ffun','ffun.f',[],'f');
 // インクリメンタルリンクの実行
 link(l,'ffun','f')
 // 関数の積分
@@ -366,73 +366,73 @@ C=['#include <math.h>'
    '  y=*x/(2.0e0*pi);'
    '  return *x*sin(30.0e0**x)/sqrt(1.0e0-y*y);'
    '}'];
-mputl(C,fullfile(TMPDIR,'cfun.c'))
+mputl(C,'cfun.c')
 // Cコードをコンパイル
-l=ilib_for_link('cfun',fullfile(TMPDIR,'cfun.c'),[],'c');
+l=ilib_for_link('cfun','cfun.c',[],'c');
 // インクリメンタルリンクの実行
 link(l,'cfun','c')
 // 関数の積分
 I=intg(0,2*%pi,'cfun')
 abs(exact-I)
  ]]></programlisting>
-
+        
     </refsection>
-
+    
     <refsection role="see also">
-
+        
         <title>参照</title>
-
+        
         <simplelist type="inline">
-
+            
             <member>
-
+                
                 <link linkend="intc">intc</link>
-
+                
             </member>
-
+            
             <member>
-
+                
                 <link linkend="intl">intl</link>
-
+                
             </member>
-
+            
             <member>
-
+                
                 <link linkend="inttrap">inttrap</link>
-
+                
             </member>
-
+            
             <member>
-
+                
                 <link linkend="intsplin">intsplin</link>
-
+                
             </member>
-
+            
             <member>
-
+                
                 <link linkend="ode">ode</link>
-
+                
             </member>
-
+            
         </simplelist>
-
+        
     </refsection>
-
+    
     <refsection>
-
+        
         <title>使用される関数</title>
-
+        
         <para>関連するルーチンは
-
+            
             SCI/modules/differential_equations/src/fortran ディレクトリにあります
-
+            
             :
-
+            
         </para>
-
+        
         <para>quadpackのdqags.f および dqagse.f</para>
-
+        
     </refsection>
-
+    
 </refentry>
 
index f3b966f..8a33bb8 100644 (file)
@@ -545,8 +545,9 @@ ccode=['#include <math.h>'
 mputl(ccode,TMPDIR+'/myode.c') //create the C file
 
 // Compile
-ilib_for_link('myode','myode.c',[],'c',[],TMPDIR+'/loader.sce');
-exec(TMPDIR+'/loader.sce') //incremental linking
+cd TMPDIR
+ilib_for_link('myode','myode.c',[],'c',[],'loader.sce');
+exec('loader.sce') //incremental linking
 y0=0;
 t0=0;
 t=0:0.1:%pi;
index b0bddac..22e9c0b 100644 (file)
@@ -357,6 +357,7 @@ y3=dassl([y0,yd0],0,t,list(chemres,0.04,1d4,3d7),list(chemjac,0.04,1d4,3d7));
 //utilizando código c
 //------------
 // - criando o código C
+cd TMPDIR
 rescode=['void chemres(double *t, double y[], double yd[], double r[], int *ires, double rpar[], int ipar[])'
          ' {'
          '   r[0] = -0.04*y[0]+1.0e4*y[1]*y[2]                -yd[0];'
@@ -380,13 +381,13 @@ jaccode=['void chemjac(double *t, double y[], double yd[], double pd[], double *
          '   pd[7] = -1.0e4*y[1];'
          '   pd[8] =  1.0;'
          ' }'];
-mputl([rescode;jaccode],fullfile(TMPDIR,'mycode.c')) //create the C file
+mputl([rescode;jaccode],'mycode.c') //create the C file
 
 // - compilando-o
-ilib_for_link(['chemres','chemjac'],fullfile(TMPDIR,'mycode.c'),[],'c','',fullfile(TMPDIR,'loader.sce'));//compilando
+ilib_for_link(['chemres','chemjac'],'mycode.c',[],'c','','loader.sce');//compilando
 
 // - ligando-o com o Scilab
-exec(fullfile(TMPDIR,'loader.sce')) //linking incremental
+exec('loader.sce') //linking incremental
 
 // - chamada a dassl
 y4=dassl([y0,yd0],0,t,'chemres','chemjac');
index 1a91c99..12f5b53 100644 (file)
@@ -133,11 +133,11 @@ F=['      double precision function ffun(x)'
    '      ffun=x*sin(30.0d+0*x)/sqrt(1.0d+0-(x/(2.0d+0*pi))**2)'
    '      return'
    '      end'];
-mputl(F,fullfile(TMPDIR,'ffun.f'))
+mputl(F,'ffun.f')
 
 
 // compile o código FORTRAN
-l=ilib_for_link('ffun',fullfile(TMPDIR,'ffun.f'),[],'f');
+l=ilib_for_link('ffun','ffun.f',[],'f');
 
 // linking incremental
 link(l,'ffun','f')
@@ -155,10 +155,10 @@ C=['#include <math.h>'
    '  y=*x/(2.0e0*pi);'
    '  return *x*sin(30.0e0**x)/sqrt(1.0e0-y*y);'
    '}'];
-mputl(C,fullfile(TMPDIR,'cfun.c'))
+mputl(C,'cfun.c')
 
 // compile o código C
-l=ilib_for_link('cfun',fullfile(TMPDIR,'cfun.c'),[],'c');
+l=ilib_for_link('cfun','cfun.c',[],'c');
 
 // linking incremental
 link(l,'cfun','c')
index 3f7a2e6..56ee672 100644 (file)
@@ -402,8 +402,9 @@ ccode=['#include <math.h>'
        '  ydot[0]=y[0]*y[0]-y[0]*sin(*t)+cos(*t);'
        '}']
 mputl(ccode,TMPDIR+'/myode.c') //criando o arquivo C
-ilib_for_link('myode','myode.c',[],'c',[],TMPDIR+'/loader.sce');//compilando
-exec(TMPDIR+'/loader.sce') //linking incremental
+cd TMPDIR
+ilib_for_link('myode','myode.c',[],'c',[],'loader.sce');//compilando
+exec('loader.sce') //linking incremental
 y0=0;t0=0;t=0:0.1:%pi;
 y=ode(y0,t0,t,'myode');
 
index 4e87114..6a84a6c 100644 (file)
@@ -366,6 +366,7 @@ y3=dassl([y0,yd0],0,t,list(chemres,0.04,1d4,3d7),list(chemjac,0.04,1d4,3d7));
 //использование C-кода
 //------------
 // - создаём C-код
+cd TMPDIR
 rescode=['void chemres(double *t, double y[], double yd[], double r[], int *ires, double rpar[], int ipar[])'
          ' {'
          '   r[0] = -0.04*y[0]+1.0e4*y[1]*y[2]                -yd[0];'
@@ -389,13 +390,13 @@ jaccode=['void chemjac(double *t, double y[], double yd[], double pd[], double *
          '   pd[7] = -1.0e4*y[1];'
          '   pd[8] =  1.0;'
          ' }'];
-mputl([rescode;jaccode],fullfile(TMPDIR,'mycode.c')) //создаём C-файл в директории TMPDIR
+mputl([rescode;jaccode],'mycode.c') //создаём C-файл в директории TMPDIR
 
 // - компилируем
-ilib_for_link(['chemres','chemjac'],fullfile(TMPDIR,'mycode.c'),[],'c','',fullfile(TMPDIR,'loader.sce'));
+ilib_for_link(['chemres','chemjac'],'mycode.c',[],'c','','loader.sce');
 
 // - связываем его с Scilab'ом
-exec(fullfile(TMPDIR,'loader.sce'))
+exec('loader.sce')
 
 // - вызов dassl
 y4=dassl([y0,yd0],0,t,'chemres','chemjac');
index 07c7255..8c176f6 100644 (file)
@@ -149,11 +149,11 @@ F=['      double precision function ffun(x)'
    '      ffun=x*sin(30.0d+0*x)/sqrt(1.0d+0-(x/(2.0d+0*pi))**2)'
    '      return'
    '      end'];
-mputl(F,fullfile(TMPDIR,'ffun.f'))
+mputl(F,'ffun.f')
 
 
 // компилируем функцию
- l=ilib_for_link('ffun',fullfile(TMPDIR,'ffun.f'),[],'f');
+ l=ilib_for_link('ffun','ffun.f',[],'f');
 
 // добавляем  функцию в рабочее окружение
 link(l,'ffun','f')
@@ -171,10 +171,10 @@ C=['#include <math.h>'
    '  y=*x/(2.0e0*pi);'
    '  return *x*sin(30.0e0**x)/sqrt(1.0e0-y*y);'
    '}'];
-mputl(C,fullfile(TMPDIR,'cfun.c'))
+mputl(C,'cfun.c')
 
 //  компилируем функцию
- l=ilib_for_link('cfun',fullfile(TMPDIR,'cfun.c'),[],'c');
+ l=ilib_for_link('cfun','cfun.c',[],'c');
 
 // добавляем  функцию в рабочее окружение
 link(l,'cfun','c')
index 5d0b5b4..41daceb 100644 (file)
@@ -547,8 +547,9 @@ ccode=['#include <math.h>'
        '}']
 mputl(ccode,TMPDIR+'/myode.c') // создаём C-файл
 // Компилируем
-ilib_for_link('myode','myode.c',[],'c',[],TMPDIR+'/loader.sce');
-exec(TMPDIR+'/loader.sce') // пошаговая компоновка
+cd TMPDIR
+ilib_for_link('myode','myode.c',[],'c',[],'loader.sce');
+exec('loader.sce') // пошаговая компоновка
 y0=0;
 t0=0;
 t=0:0.1:%pi;