* Bug 16145 fixed: intg() integrate() intc() default atol 49/21049/15
Samuel GOUGEON [Mon, 22 Jul 2019 21:40:24 +0000 (23:40 +0200)]
  http://bugzilla.scilab.org/16145

  intl : The current undocumented default abserr and relerr values
         clearly differ from the intg() ones => unchanged, since anyway
         intl() will soon be declared obsolete and removed.
  Note:  intl() and intc() will be merged into integrate() when
         processing http://bugzilla.scilab.org/7761

Change-Id: Ie6c74b2c2aec74e3c35e05c85262a4a59a37b57c

37 files changed:
scilab/CHANGES.md
scilab/modules/differential_equations/help/en_US/intc.xml
scilab/modules/differential_equations/help/en_US/integrate.xml
scilab/modules/differential_equations/help/en_US/intg.xml
scilab/modules/differential_equations/help/fr_FR/intc.xml
scilab/modules/differential_equations/help/fr_FR/integrate.xml
scilab/modules/differential_equations/help/fr_FR/intg.xml
scilab/modules/differential_equations/help/ja_JP/intc.xml
scilab/modules/differential_equations/help/ja_JP/integrate.xml
scilab/modules/differential_equations/help/ja_JP/intg.xml
scilab/modules/differential_equations/help/pt_BR/intc.xml
scilab/modules/differential_equations/help/pt_BR/integrate.xml
scilab/modules/differential_equations/help/pt_BR/intg.xml
scilab/modules/differential_equations/help/ru_RU/intc.xml
scilab/modules/differential_equations/help/ru_RU/integrate.xml
scilab/modules/differential_equations/help/ru_RU/intg.xml
scilab/modules/differential_equations/macros/intc.sci
scilab/modules/differential_equations/macros/integrate.sci
scilab/modules/differential_equations/macros/intl.sci
scilab/modules/helptools/etc/images_md5.txt
scilab/modules/helptools/images/Graphics_1.png
scilab/modules/helptools/images/Graphics_26.png
scilab/modules/helptools/images/Graphics_30.png
scilab/modules/helptools/images/_LaTeX_integrate.xml_1.png [new file with mode: 0644]
scilab/modules/helptools/images/_MathML_integrate.xml_2.png [deleted file]
scilab/modules/helptools/images/_MathML_integrate.xml_fr_FR_1.png [deleted file]
scilab/modules/helptools/images/_MathML_integrate.xml_pt_BR_1.png [deleted file]
scilab/modules/helptools/images/_MathML_integrate.xml_ru_RU_1.png [deleted file]
scilab/modules/helptools/images/intg_en_US_1.png
scilab/modules/helptools/images/intg_en_US_2.png [deleted file]
scilab/modules/helptools/images/intg_fr_FR_1.png
scilab/modules/helptools/images/intg_fr_FR_2.png [deleted file]
scilab/modules/helptools/images/intg_ja_JP_1.png
scilab/modules/helptools/images/intg_ja_JP_2.png [deleted file]
scilab/modules/helptools/images/intg_pt_BR_1.png
scilab/modules/helptools/images/intg_pt_BR_2.png [deleted file]
scilab/modules/helptools/images/intg_ru_RU_1.png [new file with mode: 0644]

index 28ae29b..c7695b9 100644 (file)
@@ -434,6 +434,7 @@ Bug Fixes
 * [#16140](https://bugzilla.scilab.org/16140): `playsnd` could not directly accept an audio file and could not repeat the input sound.
 * [#16143](https://bugzilla.scilab.org/16143): `clc(n)` cleared n+1 lines instead of n>0. Thus, it was not possible to clear only one line.
 * [#16144](https://bugzilla.scilab.org/16144): Addition of sparse matrices gave incorrect results.
+* [#16145](https://bugzilla.scilab.org/16145): `integrate` and `intg` default absolute tolerances atol were no longer the same. `integrate`'s default relative tolerance rtol was not the same in case of 3 or 4 input arguments.
 * [#16148](https://bugzilla.scilab.org/16148): `setPreferencesValue` is a general usage function and deserved to be renamed `xmlSetValues`.
 * [#16149](https://bugzilla.scilab.org/16149): `fullpath` did not support symbolic links in paths
 * [#16152](https://bugzilla.scilab.org/16152): For sparse or boolean sparse matrix `s`, `s([])` returned `[]` instead of `sparse([])`.
index 4179904..ab446a1 100644 (file)
@@ -3,8 +3,8 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA - Farid BELAHCENE
  * Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: added error control
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="intc">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+          xml:lang="en" xml:id="intc">
     <refnamediv>
         <refname>intc</refname>
-        <refpurpose>Cauchy integral</refpurpose>
+        <refpurpose>integral along a straight path in the complex plan</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>[y  [,err]] = intc(a, b, f [,abserr [,relerr]])</synopsis>
+        <synopsis>
+          [y, err] = intc(a, b, f)
+          [y, err] = intc(a, b, f, abserr)
+          [y, err] = intc(a, b, f, abserr, relerr)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Arguments</title>
             <varlistentry>
                 <term>a, b</term>
                 <listitem>
-                    <para>two complex scalars</para>
+                      two complex numbers: starting and ending points of the integral in the
+                      complex plan.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>f</term>
                 <listitem>
-                    <para>"external" function</para>
+                    Identifier of the function to be integrated.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>abserr, rerr</term>
+                <term>abserr, relerr</term>
                 <listitem>
-                    <para>real scalars, absolute and relative errors.
-                        Default values: <literal>1.d-14</literal> and <literal>1d-8</literal>.
-                    </para>
+                    real scalars: absolute and relative errors.
+                    Default values: <literal>1.d-13</literal> and <literal>1d-8</literal>.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>err</term>
                 <listitem>
-                    <para>real number, estimated absolute error on the result.</para>
+                    real number: estimated absolute error on the result.
+                    <para/>
                 </listitem>
             </varlistentry>
         </variablelist>
@@ -58,8 +69,9 @@
         <title>Description</title>
         <para>
             If <literal>f</literal> is a complex-valued function, <literal>intc(a, b, f)</literal>
-            computes the integral from <literal>a</literal> to <literal>b</literal> of <literal>f(z)dz</literal> along the
-            straight line <literal>[a b]</literal> of the complex plane.
+            computes the integral from <literal>a</literal> to <literal>b</literal> of
+            <literal>f(z)dz</literal> along the  straight line <literal>[a b]</literal>
+            of the complex plan.
         </para>
     </refsection>
     <refsection>
@@ -92,6 +104,13 @@ intc(1+%i, 4-%i, f)
                 <revnumber>5.5.0</revnumber>
                 <revremark>Absolute and relative (input) and absolute (output) errors management added.</revremark>
             </revision>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revremark>
+                    The default abserr value becomes 10<superscript>-13</superscript> instead of
+                    10<superscript>-14</superscript>.
+                </revremark>
+            </revision>
         </revhistory>
     </refsection>
 </refentry>
index ed4a802..3d2495c 100644 (file)
@@ -2,8 +2,8 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="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="integrate" xml:lang="en">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="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="integrate" xml:lang="en">
     <refnamediv>
         <refname>integrate</refname>
         <refpurpose>integration of an expression by quadrature</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>x=integrate(expr,v,x0,x1 [,atol [,rtol]])</synopsis>
+        <synopsis>
+           y = integrate(expr, v, x0, x1)
+           y = integrate(expr, v, x0, x1, atol)
+           y = integrate(expr, v, x0, x1, atol, rtol)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Arguments</title>
             <varlistentry>
                 <term>expr</term>
                 <listitem>
-                    <para>a character string defining a Scilab expression.</para>
+                    a character string defining a Scilab expression.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>v</term>
                 <listitem>
-                    <para>a character string, the integration variable name.</para>
+                    a character string, the integration variable name.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>x0</term>
                 <listitem>
-                    <para>a real number, the lower bound of integration.</para>
+                    a real number, the lower bound of integration.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>x1</term>
                 <listitem>
-                    <para>a vector of real numbers, upper bounds of integration.</para>
+                    a vector of real numbers, upper bounds of integration.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>atol</term>
                 <listitem>
-                    <para>a real number (absolute error bound). Default value: 1e-8.</para>
+                    a real number (absolute error bound). Default value: 1e-13.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>rtol</term>
                 <listitem>
-                    <para>a real number, (relative error bound). Default value:
-                        1e-14.
-                    </para>
+                    a real number, (relative error bound). Default value: 1e-8.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>x</term>
+                <term>y</term>
                 <listitem>
-                    <para>a vector of real numbers, the integral value for each
-                        <literal>x1(i)</literal>.
-                    </para>
+                    a vector of real numbers, the integral value for each <literal>x1(i)</literal>.
+                    <para/>
                 </listitem>
             </varlistentry>
         </variablelist>
     <refsection>
         <title>Description</title>
         <para>
-            <literal>x=integrate(expr,v,x0,x1 [,atol [,rtol]])</literal> computes :
-            <subscript>
-                <inlinemediaobject>
-                    <imageobject>
-                        <imagedata>
-                            <mml:math display="block">
-                                <mml:mi mathvariant="normal">x</mml:mi>
-                                <mml:mrow>
-                                    <mml:mrow>
-                                        <mml:mo>(</mml:mo><mml:mi mathvariant="normal">i</mml:mi><mml:mo>)</mml:mo>
-                                    </mml:mrow>
-                                    <mml:mo>=</mml:mo>
-                                    <mml:mrow>
-                                        <mml:msubsup>
-                                            <mml:mo>∫</mml:mo>
-                                            <mml:msub>
-                                                <mml:mi mathvariant="normal">x</mml:mi><mml:mn>0</mml:mn>
-                                            </mml:msub>
-                                            <mml:mrow>
-                                                <mml:msub>
-                                                    <mml:mi mathvariant="normal">x</mml:mi><mml:mn>1</mml:mn>
-                                                </mml:msub>
-                                                <mml:mrow>
-                                                    <mml:mo>(</mml:mo><mml:mi mathvariant="normal">i</mml:mi><mml:mo>)</mml:mo>
-                                                </mml:mrow>
-                                            </mml:mrow>
-                                        </mml:msubsup>
-                                        <mml:mi mathvariant="normal">f</mml:mi>
-                                    </mml:mrow>
-                                </mml:mrow>
-                                <mml:mrow>
-                                    <mml:mo>(</mml:mo><mml:mi mathvariant="normal">v</mml:mi><mml:mo>)</mml:mo>
-                                </mml:mrow>
-                                <mml:mi>d</mml:mi><mml:mi mathvariant="normal">v</mml:mi><mml:annotation mml:encoding="StarMath 5.0">x(i)=int_{x_0}^{x_1(i)}
-                                    f(v)dv
-                                </mml:annotation>
-                            </mml:math>
-                        </imagedata>
-                    </imageobject>
-                </inlinemediaobject>
-            </subscript>
-            for
-            <literal>i=1:size(x1,'*')</literal>
-            where
-            <inlinemediaobject>
-                <imageobject>
-                    <imagedata>
-                        <mml:math display="block">
-                            <mml:mi mathvariant="normal">f</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="normal">v</mml:mi><mml:mo>)</mml:mo>
-                        </mml:math>
-                    </imagedata>
-                </imageobject>
-            </inlinemediaobject>
-            is given by the expression
-            <literal>expr</literal>.
+            <literal>y = integrate(expr, v, x0, x1 [,atol [,rtol]])</literal> computes
+            <latex alt="y(i) = integral_{x_0}^{x_1(i)} f(v).dv">
+                y(i) = \int_{x_0}^{x_1(i)} f(v)\,dv
+            </latex>
+            for <literal>i=1:size(x1,'*')</literal>, where <emphasis>f(v)</emphasis>
+            is given by the expression <literal>expr</literal>.
         </para>
         <para>The evaluation hopefully satisfies following claim for accuracy:
-            <literal>abs(I-x)&lt;= max(atol,rtol*abs(I))</literal> where
+            <literal>abs(I - y) &lt;= max(atol, rtol*abs(I))</literal> where
             <literal>I</literal> stands for the exact value of the integral.
         </para>
-    </refsection>
-    <refsection>
-        <title>Restriction</title>
-        <para>The given expression should not use variable names with a leading
-            <literal>%</literal>.
+        <para>
+            <warning>
+                Restriction: The given expression must not use variable names with a leading
+                <literal>%</literal>.
+            </warning>
         </para>
     </refsection>
     <refsection>
         <title>Examples</title>
         <programlisting role="example"><![CDATA[
-x0=0;x1=0:0.1:2*%pi;
-X=integrate('sin(x)','x',x0,x1);
-norm(cos(x1)-(1-X))
+x1 = 0:0.1:2*%pi;
+Y = integrate('sin(x)', 'x', 0, x1);
+norm(cos(x1)-(1-Y))
 
- x1=-10:0.1:10;
-X=integrate(['if x==0 then 1,';
-             'else sin(x)/x,end'],'x',0,x1)
+x1 = -10:0.1:10;
+Y = integrate(['if x==0 then 1,';
+               'else sin(x)/x,end'], 'x', 0, x1)
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
@@ -172,4 +133,16 @@ X=integrate(['if x==0 then 1,';
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revdescription>
+                    Default atol value increased from
+                    10<superscript>-14</superscript> to 10<superscript>-13</superscript>.
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index d05c115..14960a4 100644 (file)
@@ -3,8 +3,8 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA
  * ...
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<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="en">
+<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="en">
     <refnamediv>
         <refname>intg</refname>
         <refpurpose>definite integral</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>[v, err [,ierr]]=intg(a, b, f [,ea [,er]])</synopsis>
+        <synopsis>
+            [v, err] = intg(a, b, f)
+            [v, err] = intg(a, b, f, atol)
+            [v, err] = intg(a, b, f, atol, rtol)
+            [v, err, ierr] = intg(..)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Arguments</title>
             <varlistentry>
                 <term>a, b</term>
                 <listitem>
-                    <para>real numbers.</para>
+                      Finite real numbers : bounds of the integral.
+                      <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>f</term>
                 <listitem>
-                    <para>external (function or list or string).</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>ea, er</term>
-                <listitem>
-                    <para>real numbers.</para>
+                      function to be integrated, specified either by its literal name (ex:
+                      "sind") or by its identifier (ex: sind), or by a list (in case of function
+                      parameters).
+                      <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>ea</term>
+                <term>atol</term>
                 <listitem>
-                    <para>absolute error required on the result. Default value:
-                        1.d-13.
-                    </para>
+                       real number: tolerance on the absolute error accepted on the result.
+                       Default value: 1.d-13.
+                      <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>er</term>
+                <term>rtol</term>
                 <listitem>
-                    <para>relative error required on the result. Default value:
-                        1.d-8.
-                    </para>
+                        real number: tolerance on the relative error accepted on the result.
+                        Default value: 1.d-8.
+                      <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>err</term>
                 <listitem>
-                    <para>estimated absolute error on the result.</para>
+                      estimated absolute error on the result.
+                      <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>ierr</term>
                 <listitem>
-                    <para>error flag number (= 0 if no error occurred).</para>
+                      error flag number (= 0 if no error occurred).
+                      <para/>
                 </listitem>
             </varlistentry>
         </variablelist>
@@ -82,7 +90,7 @@
             The function <literal>f(t)</literal> should be continuous.
         </para>
         <para>The evaluation hopefully satisfies following claim for accuracy:
-            <literal>abs(I-v)&lt;= max(ea,er*abs(I))</literal> where
+            <literal>abs(I-v)&lt;= max(atol, rtol*abs(I))</literal> where
             <literal>I</literal> stands for the exact value of the integral.
         </para>
         <para>
             double precision number.
         </para>
         <para>
-            In the C case the syntax should be <literal>double
-                f(double *x)
-            </literal>
-            .
+            In the C case the syntax should be <literal>double f(double *x)</literal>.
+        </para>
+        <para>
+            <emphasis role="bold">Used Functions</emphasis> : The associated routines
+            dqags.f and dqagse.f from quadpack can be found in the
+            SCI/modules/differential_equations/src/fortran directory.
         </para>
     </refsection>
     <refsection>
             if the spike is stiff enough.
         </para>
         <para>
-            This cannot be bypassed, it is easy to understand why when we know how the integrator operates.
-            Indeed, <literal>intg</literal> uses the 21-point Gauss-Kronrod rule,
-            so if there is a spike in-between two consecutive integration points,
-            then it will go undetected, the function will be considered smooth.
+            This cannot be bypassed. It is easy to understand why when we know how the integrator operates.
+            Indeed, <literal>intg</literal> uses the 21-point Gauss-Kronrod rule.
+            Hence, any spike in-between two consecutive integration points will be undetected,
+            and the function will be considered smooth.
         </para>
         <para>
             However, a warning message will be issued if the function is considered very smooth.
             should he think that spikes were missed.
         </para>
         <para>
-            The following graphs illustrate that phenomenon.
+            The following graphs illustrate that phenomenon:
         </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>
-            Being in-between the 9th and 10th integration points,
-            that spike is not detected and
-            <literal>intg</literal> considers the function flat.
-            In the next image, the spike is large enough to be covered by the integration points.
-        </para>
-        <scilab:image localized="true">
+            subplot(1,2,1)
+            plot(x, y, "r");
+            title(_("Unsampled Spike => missed by intg()"), "fontsize",3);
+            xlabel(_("Indices of integration points, as seen by intg()"))
+
             x = 0:21;
             y = zeros(1,22); y(1) = 3; y(10) = 1;
-            plot(x, y);
-            xtitle("Spike detected");
+            subplot(1,2,2)
+            plot(x, y, "r");
+            title(_("Sampled spike => detected by intg()"), "fontsize",3);
+            xlabel(_("Indices of integration points, as seen by intg()"))
+
+            gcf().axes_size = [700 350];
         </scilab:image>
         <para>
-            If the user wants to display the computed solution even if the solver has encountered an error,
-            he should add the third output argument <literal>ierr</literal>, that will transform the
-            errors into warnings. This is mostly used in the case of rounding errors.
+            On the left image, the spike lays between the 9th and 10th integration points,
+            and is not detected. <literal>intg</literal> considers the function flat.
+            On the right, the spike is large enough to be covered by the integration points.
         </para>
+        <note>
+            When we want to display the computed solution even if the solver has encountered an error,
+            we should add the third output argument <literal>ierr</literal>. Then errors become
+            simple warnings. This is mostly used in the case of rounding errors.
+        </note>
     </refsection>
     <refsection>
         <title>Examples</title>
@@ -172,10 +186,9 @@ I=intg(0,2*%pi,f)
 abs(exact-I)
 
 // Function with an argument written in the Scilab language
-function y=f1(x,w),y=x*sin(w*x)/sqrt(1-((x/(2*%pi))^2)),endfunction
-I=intg(0,2*%pi,list(f1,30))
-abs(exact-I)
-
+function y = f1(x,w), y = x*sin(w*x)/sqrt(1-((x/(2*%pi))^2)), endfunction
+I = intg(0, 2*%pi, list(f1,30))
+abs(exact - I)
 
 // Function written in Fortran (a Fortran compiler is required)
 // define a Fortran function
@@ -189,14 +202,14 @@ F=['      double precision function ffun(x)'
 mputl(F,'ffun.f')
 
 // compile the function
-l=ilib_for_link('ffun','ffun.f',[],'f');
+l = ilib_for_link('ffun', 'ffun.f', [], 'f');
 
 // add the function to the working environment
-link(l,'ffun','f')
+link(l, 'ffun', 'f')
 
 // integrate the function
-I=intg(0,2*%pi,'ffun')
-abs(exact-I)
+I = intg(0, 2*%pi, 'ffun')
+abs(exact - I)
 
 // Function written in C (a C compiler is required)
 // define a C function
@@ -207,17 +220,17 @@ C=['#include <math.h>'
    '  y=*x/(2.0e0*pi);'
    '  return *x*sin(30.0e0**x)/sqrt(1.0e0-y*y);'
    '}'];
-mputl(C,'cfun.c')
+mputl(C, 'cfun.c')
 
 // compile the function
-l=ilib_for_link('cfun','cfun.c',[],'c');
+l = ilib_for_link('cfun', 'cfun.c', [], 'c');
 
 // add the function to the working environment
-link(l,'cfun','c')
+link(l, 'cfun', 'c')
 
 // integrate the function
-I=intg(0,2*%pi,'cfun')
-abs(exact-I)
+I = intg(0, 2*%pi, 'cfun')
+abs(exact - I)
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
@@ -240,11 +253,16 @@ abs(exact-I)
             </member>
         </simplelist>
     </refsection>
-    <refsection>
-        <title>Used Functions</title>
-        <para>The associated routines can be found in SCI/modules/differential_equations/src/fortran directory
-            :
-        </para>
-        <para>dqags.f and dqagse.f from quadpack</para>
+    <refsection role="history">
+        <title>History</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.0.2</revnumber>
+                <revdescription>
+                    The default value atol of the absolute tolerance is increased from
+                    10<superscript>-14</superscript> to 10<superscript>-13</superscript>.
+                </revdescription>
+            </revision>
+        </revhistory>
     </refsection>
 </refentry>
index bda7251..f515d8d 100644 (file)
@@ -3,8 +3,8 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA - Farid BELAHCENE
  * Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: ajout du contrôle d'erreur
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="fr" xml:id="intc">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+          xml:lang="fr" xml:id="intc">
     <refnamediv>
         <refname>intc</refname>
-        <refpurpose>intégrale de Cauchy</refpurpose>
+        <refpurpose>intégrale dans le plan complexe, selon un chemin rectiligne</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Séquence d'appel</title>
-        <synopsis>[y [,err]] = intc(a, b, f [,abserr [,relerr]])</synopsis>
+        <synopsis>
+          [y, err] = intc(a, b, f)
+          [y, err] = intc(a, b, f, abserr)
+          [y, err] = intc(a, b, f, abserr, relerr)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Paramètres</title>
             <varlistentry>
                 <term>a, b</term>
                 <listitem>
-                    <para>scalaires complexes</para>
+                      scalaires complexes : points de départ et d'arrivée de l'intégrale, dans le
+                      plan complexe.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>f</term>
                 <listitem>
-                    <para>fonction "externe"</para>
+                    Identifiant d'une fonction (exemple: sin)
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>abserr, rerr</term>
                 <listitem>
-                    <para>scalaires réels, erreurs absolue et relative recherchées.
-                        Valeurs par défaut: <literal>1.d-14</literal> et <literal>1d-8</literal>.
-                    </para>
+                     Scalaires réels : erreurs absolue et relative recherchées.
+                        Valeurs par défaut: <literal>1.d-13</literal> et <literal>1d-8</literal>.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>err</term>
                 <listitem>
-                    <para>scalaire réel, erreur absolue estimée sur le résultat.</para>
+                    Scalaire réel : erreur absolue estimée sur le résultat.
+                    <para/>
                 </listitem>
             </varlistentry>
         </variablelist>
@@ -58,8 +69,8 @@
         <title>Description</title>
         <para>
             Si <literal>f</literal> est une fonction complexe, <literal>intc(a, b, f)</literal>
-            calcule l'intérgale de <literal>a</literal> à <literal>b</literal> de <literal>f(z)dz</literal> le long
-            du segment <literal>[a b]</literal> du plan complexe.
+            calcule l'intérgale de <literal>a</literal> à <literal>b</literal> de
+            <literal>f(z)dz</literal> le long du segment <literal>[a b]</literal> du plan complexe.
         </para>
     </refsection>
     <refsection>
@@ -92,6 +103,13 @@ intc(1+%i, 4-%i, f)
                 <revnumber>5.5.0</revnumber>
                 <revremark>Ajout des erreurs absolue et relative (entrée) et absolue (sortie).</revremark>
             </revision>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revremark>
+                    La valeur par défaut de abserr devient 10<superscript>-13</superscript>
+                    (au lieu de 10<superscript>-14</superscript>).
+                </revremark>
+            </revision>
         </revhistory>
     </refsection>
 </refentry>
index 176765d..5867c3b 100644 (file)
@@ -2,8 +2,8 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<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="integrate" xml:lang="fr">
+<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="integrate" xml:lang="fr">
     <refnamediv>
         <refname>integrate</refname>
         <refpurpose>intégration numérique d'une expression</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Séquence d'appel</title>
-        <synopsis>x=integrate(expr,v,x0,x1 [,atol [,rtol]])</synopsis>
+        <synopsis>
+          y = integrate(expr, v, x0, x1)
+          y = integrate(expr, v, x0, x1, atol)
+          y = integrate(expr, v, x0, x1, atol, rtol)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Paramètres</title>
             <varlistentry>
                 <term>expr</term>
                 <listitem>
-                    <para>chaîne de caractères, définit l'expression scilab</para>
+                    chaîne de caractères : expression scilab fournissant l'intégrande.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>v</term>
                 <listitem>
-                    <para>chaîne de caractères, le nom de la variable
-                        d'intégration.
-                    </para>
+                    chaîne de caractères : nom de la variable d'intégration.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>x0</term>
                 <listitem>
-                    <para>nombre réel, la borne inférieure de l'intégration.</para>
+                    nombre réel, la borne inférieure de l'intégration.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>x1</term>
                 <listitem>
-                    <para>vecteur de nombres réels, les bornes supérieures
-                        d'intégration.
-                    </para>
+                    vecteur de nombres réels, les bornes supérieures d'intégration.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>atol</term>
                 <listitem>
-                    <para>nombre réel positif (borne sur l'erreur absolue) par défaut :
-                        1d-8
-                    </para>
+                    nombre réel positif: erreur absolue maximale acceptable. Par défaut : 1d-13
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>rtol</term>
                 <listitem>
-                    <para>nombre réel positif (borne sur l'erreur relative) par défaut :
-                        1.d-14
-                    </para>
+                    nombre réel positif: erreur relative maximale acceptable. Par défaut : 1d-8
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>x</term>
+                <term>y</term>
                 <listitem>
-                    <para>vecteur de nombres réels, la valeur de l'intégrale pour chaque
-                        <literal>x1(i)</literal>.
-                    </para>
+                    vecteur de nombres réels, la valeur de l'intégrale pour chaque
+                    <literal>x1(i)</literal>.
+                    <para/>
                 </listitem>
             </varlistentry>
         </variablelist>
     <refsection>
         <title>Description</title>
         <para>
-            calcule :
-            <subscript>
-                <inlinemediaobject>
-                    <imageobject>
-                        <imagedata>
-                            <mml:math display="block" scilab:localized="true">
-                                <mml:mi mathvariant="normal">x</mml:mi>
-                                <mml:mrow>
-                                    <mml:mrow>
-                                        <mml:mo>(</mml:mo><mml:mi mathvariant="normal">i</mml:mi><mml:mo>)</mml:mo>
-                                    </mml:mrow>
-                                    <mml:mo>=</mml:mo>
-                                    <mml:mrow>
-                                        <mml:msubsup>
-                                            <mml:mo>∫</mml:mo>
-                                            <mml:msub>
-                                                <mml:mi mathvariant="normal">x</mml:mi><mml:mn>0</mml:mn>
-                                            </mml:msub>
-                                            <mml:mrow>
-                                                <mml:msub>
-                                                    <mml:mi mathvariant="normal">x</mml:mi><mml:mn>1</mml:mn>
-                                                </mml:msub>
-                                                <mml:mrow>
-                                                    <mml:mo>(</mml:mo><mml:mi mathvariant="normal">i</mml:mi><mml:mo>)</mml:mo>
-                                                </mml:mrow>
-                                            </mml:mrow>
-                                        </mml:msubsup>
-                                        <mml:mi mathvariant="normal">f</mml:mi>
-                                    </mml:mrow>
-                                </mml:mrow>
-                                <mml:mrow>
-                                    <mml:mo>(</mml:mo><mml:mi mathvariant="normal">v</mml:mi><mml:mo>)</mml:mo>
-                                </mml:mrow>
-                                <mml:mi>d</mml:mi><mml:mi mathvariant="normal">v</mml:mi><mml:annotation mml:encoding="StarMath 5.0">x(i)=int_{x_0}^{x_1(i)}
-                                    f(v)dv
-                                </mml:annotation>
-                            </mml:math>
-                        </imagedata>
-                    </imageobject>
-                </inlinemediaobject>
-            </subscript>
-            pour
-            <literal>i=1:size(x1,'*')</literal>
+            calcule
+            <latex alt="y(i) = integral_{x_0}^{x_1(i)} f(v).dv">
+                y(i) = \int_{x_0}^{x_1(i)} f(v)\,dv
+            </latex>
+            pour <literal>i=1:size(x1,'*')</literal>,
+            où <emphasis>f(v)</emphasis> est donnée par l'expression <literal>expr</literal>.
         </para>
         <para>
-            où
-            <inlinemediaobject>
-                <imageobject>
-                    <imagedata>
-                        <mml:math display="block">
-                            <mml:mi mathvariant="normal">f</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="normal">v</mml:mi><mml:mo>)</mml:mo>
-                        </mml:math>
-                    </imagedata>
-                </imageobject>
-            </inlinemediaobject>
-            est donnée par l'expression
-            <literal>expr</literal>
-        </para>
-        <para>L'approximation satisfait (on l'espère) l'affirmation suivante sur
-            l'erreur :
+            L'approximation satisfait (on l'espère) l'affirmation suivante sur l'erreur :
         </para>
         <para>
-            <literal>abs(I-x)&lt;= max(atol,rtol*abs(I))</literal>
+            <literal>abs(I-y) &lt;= max(atol, rtol*abs(I))</literal>
         </para>
         <para>
-            où <literal>I</literal> représente la valeur exacte de
-            l'intégrale.
+            où <literal>I</literal> représente la valeur exacte de l'intégrale.
         </para>
-    </refsection>
-    <refsection>
-        <title>Restriction</title>
-        <para>L'expression fournie ne doit pas référencer de variables dont le nom
-            commence avec un <literal>%</literal>.
+        <para>
+            <warning>
+                Restriction : l'expression fournie ne doit pas contenir de noms de variables
+                commençant par <literal>%</literal>.
+            </warning>
         </para>
     </refsection>
     <refsection>
         <title>Exemples</title>
         <programlisting role="example"><![CDATA[
-x0=0;x1=0:0.1:2*%pi;
-X=integrate('sin(x)','x',x0,x1);
-norm(cos(x1)-(1-X))
+x1 = 0:0.1:2*%pi;
+Y = integrate('sin(x)', 'x', 0, x1);
+norm(cos(x1)-(1-Y))
 
-x1=-10:0.1:10;
-X=integrate(['if x==0 then 1,';
-             'else sin(x)/x,end'],'x',0,x1)
+x1 = -10:0.1:10;
+Y = integrate(['if x==0 then 1,';
+               'else sin(x)/x,end'], 'x', 0, x1)
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
@@ -186,4 +139,16 @@ X=integrate(['if x==0 then 1,';
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>Historique</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revdescription>
+                    Valeur par défaut de atol : 10<superscript>-13</superscript> (au lieu de
+                    10<superscript>-14</superscript>).
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index 17624ef..638f916 100644 (file)
@@ -1,12 +1,35 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<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="fr">
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA
+ * ...
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
+<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="fr">
     <refnamediv>
         <refname>intg</refname>
         <refpurpose>intégration numérique adaptative</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Séquence d'appel</title>
-        <synopsis>[v,err [,ierr]]=intg(a,b,f [,ea [,er])</synopsis>
+        <synopsis>
+            [v, err] = intg(a, b, f)
+            [v, err] = intg(a, b, f, atol)
+            [v, err] = intg(a, b, f, atol, rtol)
+            [v, err, ierr] = intg(..)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Paramètres</title>
             <varlistentry>
                 <term>a, b</term>
                 <listitem>
-                    <para>nombres réels.</para>
+                    nombres réels finis : bornes de l'intégrale.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>f</term>
                 <listitem>
-                    <para>fonction externe (fonction Scilab ou chaîne de caractères ou
-                        liste).
-                    </para>
+                    fonction à intégrer, spécifiée soit par son nom litéral (ex: "sind"),
+                    soit par son identifiant (ex : sind), soit par une liste (si la fonction
+                    attend en outre des paramètres).
+                      <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>ea, er</term>
+                <term>atol</term>
                 <listitem>
-                    <para>nombres réels.</para>
+                      nombre réel positif : erreur absolue maximale tolérée sur le résultat
+                      (1.d-13 par défaut).
+                      <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>ea</term>
+                <term>rtol</term>
                 <listitem>
-                    <para>erreur absolue désirée (1.d-13 par défaut).</para>
-                </listitem>
-            </varlistentry>
-            <varlistentry>
-                <term>er</term>
-                <listitem>
-                    <para>erreur relative (1.d-8 par défaut).</para>
+                      nombre réel positif : erreur relative maximale tolérée sur le résultat
+                      (1.d-8 par défaut).
+                      <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>err</term>
                 <listitem>
-                    <para>estimation de l'erreur absolue sur le résultat.</para>
+                      estimation de l'erreur absolue sur le résultat.
+                      <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>ierr</term>
                 <listitem>
-                    <para>numéro d'erreur (= 0 si absence d'erreur).</para>
+                      numéro d'erreur (= 0 si absence d'erreur).
+                      <para/>
                 </listitem>
             </varlistentry>
         </variablelist>
@@ -66,7 +91,7 @@
         </para>
         <para>
             L'évaluation satisfait si possible <literal>abs(I-v)&lt;=
-                max(ea,er*abs(I))
+                max(atol,er*abs(I))
             </literal>
             où <literal>I</literal> représente la valeur exacte de
             l'intégrale.
             nombre double precision.
         </para>
         <para>
-            Dans la cas C la liste d'appel doit être: <literal>double f(double
-                *x)
-            </literal>
-            .
+            Dans le cas d'une fonction en C, la liste d'appel doit être:
+            <literal>double f(double *x)</literal>.
+        </para>
+        <para>
+            <emphasis role="bold">Fonctions Utilisées</emphasis> : les programmes correspondants
+            (dqags.f et dqagse.f de quadpack) se trouvent dans le répertoire
+            SCI/modules/differential_equations/src/fortran/.
         </para>
     </refsection>
     <refsection>
             Comme tous les intégrateurs, <literal>intg</literal> est susceptible de manquer des pics.
         </para>
         <para>
-            Une fonction plate contenant un pic sera considérée totalement plate si le pic est suffisamment raide.
+            Une fonction plate contenant un pic sera considérée totalement plate si le pic est
+            suffisamment raide.
         </para>
         <para>
-            Cela ne peut pas être évité, on comprend facilement pourquoi dès que l'on comprend comment l'intégrateur opère.
-            En effet, <literal>intg</literal> utilise la méthode des 21 points de Gauss-Kronrod,
-            donc s'il y a un pic entre deux points d'intégration consécutifs,
-            il ne sera pas détecté, la fonction sera considérée lisse.
+            Cela ne peut pas être évité. On comprend facilement pourquoi dès que l'on comprend
+            comment l'intégrateur opère.
+            En effet, <literal>intg</literal> utilise la méthode des 21 points de Gauss-Kronrod.
+            Ainsi, s'il y a un pic entre deux points d'intégration consécutifs,
+            il ne sera pas détecté. La fonction sera localement considérée comme lisse.
         </para>
         <para>
             Cependant, un warning s'affichera si la fonction est considérée très lisse,
             s'il pense que des pics ont été manqués.
         </para>
         <para>
-            Les graphes suivants illustrent ce phénomène.
+            Les graphes suivants illustrent ce phénomène :
         </para>
         <scilab:image localized="true">
             x = 0:.1:22;
             y = zeros(1,221); y(1) = 3; y(96) = 1;
-            plot(x, y);
-            xtitle("Pic manqué");
-        </scilab:image>
-        <para>
-            Se situant entre les 9è and 10è points d'intégration, le pic n'est pas détecté et
-            <literal>intg</literal> considère la fonction comme plate.
-            Dans l'image suivante, le pic est suffisamment large pour être détecté.
-        </para>
-        <scilab:image localized="true">
+            subplot(1,2,1)
+            plot(x, y, "r");
+            title(_("Unsampled Spike => missed by intg()"), "fontsize",3);
+            xlabel(_("Indices of integration points, as seen by intg()"))
+
             x = 0:21;
             y = zeros(1,22); y(1) = 3; y(10) = 1;
-            plot(x, y);
-            xtitle("Pic détecté");
+            subplot(1,2,2)
+            plot(x, y, "r");
+            title(_("Sampled spike => detected by intg()"), "fontsize",3);
+            xlabel(_("Indices of integration points, as seen by intg()"))
+
+            gcf().axes_size = [700 350];
         </scilab:image>
         <para>
+            Sur le graphe de gauche, le pic réside entre les points d'intégration n° 9 et 10.
+            Il n'est pas détecté. <literal>intg</literal> considère la fonction comme plate.
+            À droite, le pic est suffisamment large pour être échantillonné par intg().
+        </para>
+        <note>
             Si l'utilisateur veut afficher la solution même si le solveur a rencontré une erreur,
             il doit ajouter le troisième argument de sortie <literal>ierr</literal>, ce qui transformera
             les erreurs en warnings. Ceci est surtout utilisé dans les cas d'erreurs d'arrondi.
-        </para>
+        </note>
     </refsection>
     <refsection>
         <title>Exemples</title>
         <programlisting role="example"><![CDATA[
-//External écrit en Scilab
-function y=f(x),y=x*sin(30*x)/sqrt(1-((x/(2*%pi))^2)),endfunction
-exact=-2.5432596188;
-I=intg(0,2*%pi,f)
-abs(exact-I)
-
-//External écrit en Scilab avec un argument
-function y=f1(x,w),y=x*sin(w*x)/sqrt(1-((x/(2*%pi))^2)),endfunction
-I=intg(0,2*%pi,list(f1,30))
-abs(exact-I)
+// External écrit en Scilab
+function y = f(x), y = x*sin(30*x)/sqrt(1-((x/(2*%pi))^2)), endfunction
+exact = -2.5432596188;
+I = intg(0, 2*%pi, f)
+abs(exact - I)
 
+// External écrit en Scilab avec un argument
+function y = f1(x,w), y = x*sin(w*x)/sqrt(1-((x/(2*%pi))^2)), endfunction
+I = intg(0, 2*%pi, list(f1,30))
+abs(exact - I)
 
 // External écrit en Fortran (un compilateur Fortran est nécessaire)
 // Ecriture du code fortran
@@ -172,17 +206,17 @@ 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,'ffun.f')
+mputl(F, 'ffun.f')
 
 // compilation du code Fortran
-l=ilib_for_link('ffun','ffun.f',[],'f');
+l = ilib_for_link('ffun','ffun.f',[],'f');
 
 // link incrémental
 link(l,'ffun','f')
 
 // integration de la fonction
-I=intg(0,2*%pi,'ffun')
-abs(exact-I)
+I = intg(0, 2*%pi, 'ffun')
+abs(exact - I)
 
 // External écrit en C (un compilateur C est nécessaire)
 // Ecriture du code C
@@ -196,14 +230,14 @@ C=['#include <math.h>'
 mputl(C,'cfun.c')
 
 // compilation du code C
-l=ilib_for_link('cfun','cfun.c',[],'c');
+l = ilib_for_link('cfun', 'cfun.c', [], 'c');
 
 // incremental linking
-link(l,'cfun','c')
+link(l, 'cfun', 'c')
 
 // integration de la fonction
-I=intg(0,2*%pi,'cfun')
-abs(exact-I)
+I = intg(0, 2*%pi, 'cfun')
+abs(exact - I)
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
@@ -226,10 +260,16 @@ abs(exact-I)
             </member>
         </simplelist>
     </refsection>
-    <refsection>
-        <title>Fonctions Utilisées</title>
-        <para>Les programmes correspondants (dqags.f et dqagse.f de quadpack) se
-            trouvent dans le répertoire SCI/modules/differential_equations/src/fortran/.
-        </para>
+    <refsection role="history">
+        <title>Historique</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.0.2</revnumber>
+                <revdescription>
+                    La valeur par défaut atol de l'erreur absolue passe de
+                    10<superscript>-14</superscript> à 10<superscript>-13</superscript>.
+                </revdescription>
+            </revision>
+        </revhistory>
     </refsection>
 </refentry>
index be3e580..b8436df 100644 (file)
@@ -2,8 +2,8 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA - Farid BELAHCENE
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ja" xml:id="intc">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+          xml:lang="ja" xml:id="intc">
     <refnamediv>
         <refname>intc</refname>
         <refpurpose>コーシー積分</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>呼び出し手順</title>
-        <synopsis>[y  [,err]] = intc(a, b, f [,abserr [,relerr]])</synopsis>
+        <synopsis>
+          [y, err] = intc(a, b, f)
+          [y, err] = intc(a, b, f, abserr)
+          [y, err] = intc(a, b, f, abserr, relerr)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>パラメータ</title>
             <varlistentry>
                 <term>a,b</term>
                 <listitem>
-                    <para>2つの複素数スカラー</para>
+                    2つの複素数スカラー
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>f</term>
                 <listitem>
-                    <para>"外部" 関数</para>
+                    "外部" 関数
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>abserr, rerr</term>
+                <term>abserr, relerr</term>
                 <listitem>
-                    <para>
-                        実スカラー, 絶対および相対エラー.
-                        デフォルト値: <literal>1.d-14</literal> および
-                        <literal>1d-8</literal>.
-                    </para>
+                    実スカラー, 絶対および相対エラー.
+                    デフォルト値: <literal>1.d-13</literal> および
+                    <literal>1d-8</literal>.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>err</term>
                 <listitem>
-                    <para>
-                        実数, 推定された結果の絶対誤差.
-                    </para>
+                    実数, 推定された結果の絶対誤差.
+                    <para/>
                 </listitem>
             </varlistentry>
         </variablelist>
@@ -73,6 +80,7 @@
 function y = f(z)
   y = z^(3 + %pi * %i);
 endfunction
+
 intc(1+%i, 4-%i, f)
 [r, err] = intc(1+%i, 4-%i, f, 1d-10, 1d-6)
  ]]></programlisting>
@@ -95,7 +103,12 @@ intc(1+%i, 4-%i, f)
                 <revnumber>5.5.0</revnumber>
                 <revremark>絶対および相対(入力)および絶対 (出力)
                     誤差管理が追加されました.
-
+                </revremark>
+            </revision>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revremark>
+                    The default abserr value is increased from 1e-14 to 1e-13.
                 </revremark>
             </revision>
         </revhistory>
index 8c1aef1..4602074 100644 (file)
@@ -1,10 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="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="integrate" xml:lang="ja">
-
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="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="integrate" xml:lang="ja">
     <refnamediv>
-
         <refname>integrate</refname>
-
         <refpurpose>求積法による式の積分</refpurpose>
-
     </refnamediv>
-
     <refsynopsisdiv>
-
         <title>呼び出し手順</title>
-
-        <synopsis>x=integrate(expr,v,x0,x1 [,atol [,rtol]])</synopsis>
-
+        <synopsis>
+          y = integrate(expr, v, x0, x1)
+          y = integrate(expr, v, x0, x1, atol)
+          y = integrate(expr, v, x0, x1, atol, rtol)
+        </synopsis>
     </refsynopsisdiv>
-
     <refsection>
-
         <title>引数</title>
-
         <variablelist>
-
             <varlistentry>
-
                 <term>expr</term>
-
                 <listitem>
-
-                    <para>文字列, Scilab 式を定義</para>
-
+                    文字列, Scilab 式を定義
+                    <para/>
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>v</term>
-
                 <listitem>
-
-                    <para>文字列, 積分変数名</para>
-
+                    文字列, 積分変数名
+                    <para/>
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>x0</term>
-
                 <listitem>
-
-                    <para>実数, 積分区間の下限</para>
-
+                    実数, 積分区間の下限
+                    <para/>
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>x1</term>
-
                 <listitem>
-
-                    <para>実数のベクトル, 積分区間の上限</para>
-
+                    実数のベクトル, 積分区間の上限
+                    <para/>
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>atol</term>
-
                 <listitem>
-
-                    <para>実数 (絶対許容誤差) デフォルト値: 1.-8</para>
-
+                    実数 (絶対許容誤差) デフォルト値: 1e-13
+                    <para/>
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
                 <term>rtol</term>
-
                 <listitem>
-
-                    <para>実数, (相対許容誤差) デフォルト値:
-
-                        1e-14
-
-                    </para>
-
+                    実数, (相対許容誤差) デフォルト値: 1e-8
+                    <para/>
                 </listitem>
-
             </varlistentry>
-
             <varlistentry>
-
-                <term>x</term>
-
+                <term>y</term>
                 <listitem>
-
-                    <para>実数のベクトル,
-
-                        各<literal>x1(i)</literal>に関する積分値.
-
-                    </para>
-
+                    実数のベクトル, 各<literal>x1(i)</literal>に関する積分値.
+                    <para/>
                 </listitem>
-
             </varlistentry>
-
         </variablelist>
-
     </refsection>
-
     <refsection>
-
         <title>説明</title>
-
         <para>
-
-            以下を計算します :
-
-            <subscript>
-
-                <inlinemediaobject>
-
-                    <imageobject>
-
-                        <imagedata>
-
-                            <mml:math display="block">
-
-                                <mml:mi mathvariant="normal">x</mml:mi>
-
-                                <mml:mrow>
-
-                                    <mml:mrow>
-
-                                        <mml:mo>(</mml:mo><mml:mi mathvariant="normal">i</mml:mi><mml:mo>)</mml:mo>
-
-                                    </mml:mrow>
-
-                                    <mml:mo>=</mml:mo>
-
-                                    <mml:mrow>
-
-                                        <mml:msubsup>
-
-                                            <mml:mo>∫</mml:mo>
-
-                                            <mml:msub>
-
-                                                <mml:mi mathvariant="normal">x</mml:mi><mml:mn>0</mml:mn>
-
-                                            </mml:msub>
-
-                                            <mml:mrow>
-
-                                                <mml:msub>
-
-                                                    <mml:mi mathvariant="normal">x</mml:mi><mml:mn>1</mml:mn>
-
-                                                </mml:msub>
-
-                                                <mml:mrow>
-
-                                                    <mml:mo>(</mml:mo><mml:mi mathvariant="normal">i</mml:mi><mml:mo>)</mml:mo>
-
-                                                </mml:mrow>
-
-                                            </mml:mrow>
-
-                                        </mml:msubsup>
-
-                                        <mml:mi mathvariant="normal">f</mml:mi>
-
-                                    </mml:mrow>
-
-                                </mml:mrow>
-
-                                <mml:mrow>
-
-                                    <mml:mo>(</mml:mo><mml:mi mathvariant="normal">v</mml:mi><mml:mo>)</mml:mo>
-
-                                </mml:mrow>
-
-                                <mml:mi>d</mml:mi><mml:mi mathvariant="normal">v</mml:mi><mml:annotation mml:encoding="StarMath 5.0">x(i)=int_{x_0}^{x_1(i)}
-
-                                    f(v)dv
-
-                                </mml:annotation>
-
-                            </mml:math>
-
-                        </imagedata>
-
-                    </imageobject>
-
-                </inlinemediaobject>
-
-            </subscript>
-
-            for
-
-            <literal>i=1:size(x1,'*')</literal>
-
-        </para>
-
-        <para>
-
-            ただし
-
-            <inlinemediaobject>
-
-                <imageobject>
-
-                    <imagedata>
-
-                        <mml:math display="block">
-
-                            <mml:mi mathvariant="normal">f</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="normal">v</mml:mi><mml:mo>)</mml:mo>
-
-                        </mml:math>
-
-                    </imagedata>
-
-                </imageobject>
-
-            </inlinemediaobject>
-
-            は式
-
-            <literal>expr</literal>で指定されます.
-
+            以下を計算します
+            <latex alt="y(i) = integral_{x_0}^{x_1(i)} f(v).dv">
+                y(i) = \int_{x_0}^{x_1(i)} f(v)\,dv
+            </latex>
+            for <literal>i=1:size(x1,'*')</literal>, ただし <emphasis>f(v)</emphasis>
+            は式 <literal>expr</literal>で指定されます.
         </para>
-
         <para>
-
             この処理は以下の精度指標を満足することが期待されます:
-
-            <literal>abs(I-x)&lt;= max(atol,rtol*abs(I))</literal> ただし
-
+            <literal>abs(I-y) &lt;= max(atol, rtol*abs(I))</literal> ただし
             <literal>I</literal>はこの積分の真値を意味します.
-
         </para>
-
-    </refsection>
-
-    <refsection>
-
-        <title>制約</title>
-
         <para>
-
-            式を指定する際に
-
-            <literal>%</literal>から始まる変数名を使用することはできません.
-
+            <warning>
+                制約: 式を指定する際に <literal>%</literal>から始まる変数名を使用することはできません.
+            </warning>
         </para>
-
     </refsection>
-
     <refsection>
-
         <title>例</title>
-
         <programlisting role="example"><![CDATA[
-x0=0;x1=0:0.1:2*%pi;
-X=integrate('sin(x)','x',x0,x1);
-norm(cos(x1)-(1-X))
- x1=-10:0.1:10;
-X=integrate(['if x==0 then 1,';
-             'else sin(x)/x,end'],'x',0,x1)
- ]]></programlisting>
+x1 = 0:0.1:2*%pi;
+Y = integrate('sin(x)', 'x', 0, x1);
+norm(cos(x1)-(1-Y))
 
+x1 = -10:0.1:10;
+Y = integrate(['if x==0 then 1,';
+               'else sin(x)/x,end'], 'x', 0, x1)
+ ]]></programlisting>
     </refsection>
-
     <refsection role="see also">
-
         <title>参照</title>
-
         <simplelist type="inline">
-
             <member>
-
                 <link linkend="intg">intg</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>
-
-</refentry>
-
+    <refsection role="history">
+        <title>履歴</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revdescription>
+                    Default atol value increased from
+                    10<superscript>-14</superscript> to 10<superscript>-13</superscript>.
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
+</refentry>
\ No newline at end of file
index 30b0f54..1c575d9 100644 (file)
@@ -1,11 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
-
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA
  * ...
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-
-<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">
-    
+<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>
-        
+        <synopsis>
+            [v, err] = intg(a, b, f)
+            [v, err] = intg(a, b, f, atol)
+            [v, err] = intg(a, b, f, atol, rtol)
+            [v, err, ierr] = intg(..)
+        </synopsis>
     </refsynopsisdiv>
-    
     <refsection>
-        
         <title>引数</title>
-        
         <variablelist>
-            
             <varlistentry>
-                
                 <term>a, b</term>
-                
                 <listitem>
-                    
-                    <para>実数</para>
-                    
+                    実数
+                    <para/>
                 </listitem>
-                
             </varlistentry>
-            
             <varlistentry>
-                
                 <term>f</term>
-                
-                <listitem>
-                    
-                    <para>外部 (関数またはリストまたは文字列)</para>
-                    
-                </listitem>
-                
-            </varlistentry>
-            
-            <varlistentry>
-                
-                <term>ea, er</term>
-                
                 <listitem>
-                    
-                    <para>実数</para>
-                    
+                    外部 (関数またはリストまたは文字列)
+                    <para/>
                 </listitem>
-                
             </varlistentry>
-            
             <varlistentry>
-                
-                <term>ea</term>
-                
+                <term>atol</term>
                 <listitem>
-                    
-                    <para>結果に指定する絶対誤. デフォルト値:
-                        
-                        1.d-13.
-                        
-                    </para>
-                    
+                    実数. 結果に指定する絶対誤. デフォルト値: 1.d-13.
+                    <para/>
                 </listitem>
-                
             </varlistentry>
-            
             <varlistentry>
-                
-                <term>er</term>
-                
+                <term>rtol</term>
                 <listitem>
-                    
-                    <para>結果に指定する相対誤差. デフォルト値:
-                        
-                        1.d-8.
-                        
-                    </para>
-                    
+                    実数. 結果に指定する相対誤差. デフォルト値: 1.d-8.
+                    <para/>
                 </listitem>
-                
             </varlistentry>
-            
             <varlistentry>
-                
                 <term>err</term>
-                
                 <listitem>
-                    
-                    <para>結果に関する絶対誤差の推定値.</para>
-                    
+                    結果に関する絶対誤差の推定値.
+                    <para/>
                 </listitem>
-                
             </varlistentry>
-            
             <varlistentry>
-                
                 <term>ierr</term>
-                
                 <listitem>
-                    
-                    <para>エラーフラグ番号(エラーが発生しなかった場合は 0).</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>abs(I-v)&lt;= max(atol, rtol*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>
-        
+        <para>
+            <emphasis role="bold">使用される関数</emphasis> : 関連するルーチンは
+            SCI/modules/differential_equations/src/fortran ディレクトリにあります :
+            quadpackのdqags.f および dqagse.f
+        </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">
-            
+            subplot(1,2,1)
+            plot(x, y, "r");
+            title(_("Unsampled Spike => missed by intg()"), "fontsize",3);
+            xlabel(_("Indices of integration points, as seen by intg()"))
+
             x = 0:21;
-            
             y = zeros(1,22); y(1) = 3; y(10) = 1;
-            
-            plot(x, y);
-            
-            xtitle("Spike detected");
-            
+            subplot(1,2,2)
+            plot(x, y, "r");
+            title(_("Sampled spike => detected by intg()"), "fontsize",3);
+            xlabel(_("Indices of integration points, as seen by intg()"))
+
+            gcf().axes_size = [700 350];
         </scilab:image>
-        
         <para>
-            
-            ソルバがエラーを発生した場合でも,
-            
-            ユーザが計算された回を表示しようとすると,
-            
-            3番目の出力引数<literal>ierr</literal>を追加する必要があり,
-            
-            これによりエラーを警告に変換します.
-            
-            これは主に丸め誤差の場合に使用されます.
-            
+            On the left image, the spike lays between the 9th and 10th integration points,
+            and is not detected. <literal>intg</literal> considers the function flat.
+            On the right, the spike is large enough to be covered by the integration points.
         </para>
-        
+        <note>
+            ソルバがエラーを発生した場合でも, ユーザが計算された回を表示しようとすると,
+            3番目の出力引数<literal>ierr</literal>を追加する必要があり,
+            これによりエラーを警告に変換します. これは主に丸め誤差の場合に使用されます.
+        </note>
     </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
-exact=-2.5432596188;
-I=intg(0,2*%pi,f)
-abs(exact-I)
+function y = f(x), y = x*sin(30*x)/sqrt(1-((x/(2*%pi))^2)), endfunction
+exact = -2.5432596188;
+I = intg(0, 2*%pi, f)
+abs(exact - I)
+
 //1つの引数を有するScilabで記述された関数
-function y=f1(x,w),y=x*sin(w*x)/sqrt(1-((x/(2*%pi))^2)),endfunction
-I=intg(0,2*%pi,list(f1,30))
+function y = f1(x,w), y = x*sin(w*x)/sqrt(1-((x/(2*%pi))^2)), endfunction
+I = intg(0, 2*%pi, list(f1,30))
 abs(exact-I)
+
 // Fortranで記述された外部関数 (Fortranコンパイラが必要)
 // Fortranコードの記述
 cd TMPDIR;
@@ -350,13 +204,17 @@ F=['      double precision function ffun(x)'
    '      return'
    '      end'];
 mputl(F,'ffun.f')
+
 // Fortranコードをコンパイル
-l=ilib_for_link('ffun','ffun.f',[],'f');
+l = ilib_for_link('ffun', 'ffun.f', [], 'f');
+
 // インクリメンタルリンクの実行
-link(l,'ffun','f')
+link(l, 'ffun', 'f')
+
 // 関数の積分
-I=intg(0,2*%pi,'ffun')
-abs(exact-I)
+I = intg(0, 2*%pi, 'ffun')
+abs(exact - I)
+
 // Cで記述された外部関数 (Cコンパイラが必要)
 // Cコードの記述
 C=['#include <math.h>'
@@ -366,73 +224,49 @@ C=['#include <math.h>'
    '  y=*x/(2.0e0*pi);'
    '  return *x*sin(30.0e0**x)/sqrt(1.0e0-y*y);'
    '}'];
-mputl(C,'cfun.c')
+mputl(C, 'cfun.c')
+
 // Cコードをコンパイル
-l=ilib_for_link('cfun','cfun.c',[],'c');
+l = ilib_for_link('cfun', 'cfun.c', [], 'c');
+
 // インクリメンタルリンクの実行
-link(l,'cfun','c')
+link(l, 'cfun', 'c')
+
 // 関数の積分
-I=intg(0,2*%pi,'cfun')
-abs(exact-I)
+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 role="history">
+        <title>履歴</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.0.2</revnumber>
+                <revdescription>
+                    The default value atol of the absolute tolerance is increased from
+                    10<superscript>-14</superscript> to 10<superscript>-13</superscript>.
+                </revdescription>
+            </revision>
+        </revhistory>
     </refsection>
-    
-</refentry>
-
+</refentry>
\ No newline at end of file
index 0004e18..26a95ca 100644 (file)
@@ -2,8 +2,8 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA - Farid BELAHCENE
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<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="intc" xml:lang="pt">
+<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="intc" xml:lang="pt">
     <refnamediv>
         <refname>intc</refname>
         <refpurpose>integral de Cauchy</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Seqüência de Chamamento</title>
-        <synopsis>[y]=intc(a,b,f)</synopsis>
+        <synopsis>
+          [y, err] = intc(a, b, f)
+          [y, err] = intc(a, b, f, abserr)
+          [y, err] = intc(a, b, f, abserr, relerr)
+               </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Parâmetros</title>
                     <para>função externa</para>
                 </listitem>
             </varlistentry>
+            <varlistentry>
+                <term>abserr, relerr</term>
+                <listitem>
+                    real scalars: absolute and relative errors.
+                    Default values: <literal>1.d-13</literal> and <literal>1d-8</literal>.
+                    <para/>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>err</term>
+                <listitem>
+                    real number: estimated absolute error on the result.
+                    <para/>
+                </listitem>
+            </varlistentry>
         </variablelist>
     </refsection>
     <refsection>
             <literal>a b</literal> do plano complexo.
         </para>
     </refsection>
+    <refsection>
+        <title>Exemplos</title>
+        <programlisting role="example"><![CDATA[
+function y = f(z)
+  y = z^(3 + %pi * %i);
+endfunction
+
+intc(1+%i, 4-%i, f)
+
+[r, err] = intc(1+%i, 4-%i, f, 1d-10, 1d-6)
+ ]]></programlisting>
+    </refsection>
     <refsection role="see also">
         <title>Ver Também</title>
         <simplelist type="inline">
             </member>
         </simplelist>
     </refsection>
+    <refsection>
+        <title>Histórico</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.5.0</revnumber>
+                <revremark>Absolute and relative (input) and absolute (output) errors management added.</revremark>
+            </revision>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revremark>
+                    The default abserr value becomes 10<superscript>-13</superscript> instead of
+                    10<superscript>-14</superscript>.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index 1f262e9..ff4ccf9 100644 (file)
@@ -2,8 +2,8 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="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="integrate" xml:lang="pt">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="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="integrate" xml:lang="pt">
     <refnamediv>
         <refname>integrate</refname>
         <refpurpose>integração pela quadratura</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Seqüência de Chamamento</title>
-        <synopsis>x=integrate(expr,v,x0,x1 [,atol [,rtol]])</synopsis>
+        <synopsis>
+          y = integrate(expr, v, x0, x1)
+          y = integrate(expr, v, x0, x1, atol)
+          y = integrate(expr, v, x0, x1, atol, rtol)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Parâmetros</title>
             <varlistentry>
                 <term>expr</term>
                 <listitem>
-                    <para>string definindo uma expressão Scilab</para>
+                    string definindo uma expressão Scilab.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>v</term>
                 <listitem>
-                    <para>string (variável da integração) </para>
+                    string : variável da integração.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>x0</term>
                 <listitem>
-                    <para>número real (limite inferior de integração) </para>
+                    número real : limite inferior de integração.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>x1</term>
                 <listitem>
-                    <para>vetor de números reais, limites superiores de
-                        integração
-                    </para>
+                    vetor de números reais : limites superiores de integração.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>atol</term>
                 <listitem>
-                    <para>número real (erro absoluto). Valor padrão: 1.-8</para>
+                    número real : erro absoluto. Valor padrão: 1e-13.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>rtol</term>
                 <listitem>
-                    <para>número real (erro relativo). Valor padrão: 1e-14</para>
+                    número real : erro relativo. Valor padrão: 1e-8.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>x</term>
+                <term>y</term>
                 <listitem>
-                    <para>vetor de números reais, o valor da integral para cada
-                        <literal>x1(i)</literal>.
-                    </para>
+                    vetor de números reais : o valor da integral para cada <literal>x1(i)</literal>.
+                    <para/>
                 </listitem>
             </varlistentry>
         </variablelist>
     <refsection>
         <title>Descrição</title>
         <para>
-            Computa :
-            <subscript>
-                <inlinemediaobject>
-                    <imageobject>
-                        <imagedata>
-                            <mml:math display="block" scilab:localized="true">
-                                <mml:mi mathvariant="normal">x</mml:mi>
-                                <mml:mrow>
-                                    <mml:mrow>
-                                        <mml:mo>(</mml:mo><mml:mi mathvariant="normal">i</mml:mi><mml:mo>)</mml:mo>
-                                    </mml:mrow>
-                                    <mml:mo>=</mml:mo>
-                                    <mml:mrow>
-                                        <mml:msubsup>
-                                            <mml:mo>∫</mml:mo>
-                                            <mml:msub>
-                                                <mml:mi mathvariant="normal">x</mml:mi><mml:mn>0</mml:mn>
-                                            </mml:msub>
-                                            <mml:mrow>
-                                                <mml:msub>
-                                                    <mml:mi mathvariant="normal">x</mml:mi><mml:mn>1</mml:mn>
-                                                </mml:msub>
-                                                <mml:mrow>
-                                                    <mml:mo>(</mml:mo><mml:mi mathvariant="normal">i</mml:mi><mml:mo>)</mml:mo>
-                                                </mml:mrow>
-                                            </mml:mrow>
-                                        </mml:msubsup>
-                                        <mml:mi mathvariant="normal">f</mml:mi>
-                                    </mml:mrow>
-                                </mml:mrow>
-                                <mml:mrow>
-                                    <mml:mo>(</mml:mo><mml:mi mathvariant="normal">v</mml:mi><mml:mo>)</mml:mo>
-                                </mml:mrow>
-                                <mml:mi>d</mml:mi><mml:mi mathvariant="normal">v</mml:mi><mml:annotation mml:encoding="StarMath 5.0">x(i)=int_{x_0}^{x_1(i)}
-                                    f(v)dv
-                                </mml:annotation>
-                            </mml:math>
-                        </imagedata>
-                    </imageobject>
-                </inlinemediaobject>
-            </subscript>
-            para
-            <literal>i=1:size(x1,'*')</literal>
-        </para>
-        <para>
-            Onde
-            <inlinemediaobject>
-                <imageobject>
-                    <imagedata>
-                        <mml:math display="block">
-                            <mml:mi mathvariant="normal">f</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="normal">v</mml:mi><mml:mo>)</mml:mo>
-                        </mml:math>
-                    </imagedata>
-                </imageobject>
-            </inlinemediaobject>
-            é dado pela expressão
-            <literal>expr</literal>.
+            Computa
+            <latex alt="y(i) = integral_{x_0}^{x_1(i)} f(v).dv">
+                y(i) = \int_{x_0}^{x_1(i)} f(v)\,dv
+            </latex>
+            para <literal>i=1:size(x1,'*')</literal>, onde <emphasis>f(v)</emphasis> é dado
+            pela expressão <literal>expr</literal>.
         </para>
         <para>A avaliação procura satisfazer à seguinte precisão:
-            <literal>abs(I-x)&lt;= max(atol,rtol*abs(I))</literal> onde I é o valor
+            <literal>abs(I-y) &lt;= max(atol, rtol*abs(I))</literal> onde I é o valor
             exato da integral.
         </para>
-    </refsection>
-    <refsection>
-        <title>Restrição</title>
-        <para>A expressão dada não deve utilizar nomes de variáveis começando por
-            <literal>%</literal>.
+        <para>
+            <warning>
+                Restrição : A expressão dada não deve utilizar nomes de variáveis começando por
+                <literal>%</literal>.
+            </warning>
         </para>
     </refsection>
     <refsection>
         <title>Exemplos</title>
         <programlisting role="example"><![CDATA[
-x0=0;x1=0:0.1:2*%pi;
-X=integrate('sin(x)','x',x0,x1);
-norm(cos(x1)-(1-X))
+x1 = 0:0.1:2*%pi;
+Y = integrate('sin(x)', 'x', 0, x1);
+norm(cos(x1)-(1-Y))
 
-x1=-10:0.1:10;
-X=integrate(['if x==0 then 1,';
-  'else sin(x)/x,end'],'x',0,x1)
+x1 = -10:0.1:10;
+Y = integrate(['if x==0 then 1,';
+               'else sin(x)/x,end'], 'x', 0, x1)
  ]]></programlisting>
     </refsection>
     <refsection>
@@ -174,4 +133,16 @@ X=integrate(['if x==0 then 1,';
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>Histórico</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revdescription>
+                    Default atol value increased from
+                    10<superscript>-14</superscript> to 10<superscript>-13</superscript>.
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index 230c901..5228794 100644 (file)
@@ -3,8 +3,8 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA
  * ...
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<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="pt">
+<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="pt">
     <refnamediv>
         <refname>intg</refname>
         <refpurpose>integral definida</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Seqüência de Chamamento</title>
-        <synopsis>[v,err]=intg(a,b,f [,ea [,er])</synopsis>
+        <synopsis>
+            [v, err] = intg(a, b, f)
+            [v, err] = intg(a, b, f, atol)
+            [v, err] = intg(a, b, f, atol, rtol)
+            [v, err, ierr] = intg(..)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Parâmetros</title>
             <varlistentry>
                 <term>a, b</term>
                 <listitem>
-                    <para>números reais</para>
+                    Números reais finitos: limites da integral.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>f</term>
                 <listitem>
-                    <para>função externa (função, lista ou string)</para>
+                    função externa (função, lista ou string)
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>ea, er</term>
+                <term>atol</term>
                 <listitem>
-                    <para>números reais</para>
+                    Número real: erro absoluto requerido no resultado. Valor padrão: 1.d-13.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>ea</term>
+                <term>rtol</term>
                 <listitem>
-                    <para>erro absoluto requerido no resultado. Valor padrão:
-                        1.d-13.
-                    </para>
+                    Número real: erro relativo requerido no resultado. Valor padrão: 1.d-8.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>er</term>
+                <term>err</term>
                 <listitem>
-                    <para>erro relativo requerido no resultado. Valor padrão:
-                        1.d-8.
-                    </para>
+                    erro absoluto estimado no resultado
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>err</term>
+                <term>ierr</term>
                 <listitem>
-                    <para>erro absoluto estimado no resultado</para>
+                      error flag number (= 0 if no error occurred).
+                      <para/>
                 </listitem>
             </varlistentry>
         </variablelist>
@@ -76,7 +86,7 @@
             A função <literal>f(t)</literal> deve ser contínua.
         </para>
         <para>Espera-se que a avaliação satisfaça à seguinte precisão:
-            <literal>abs(I-v)&lt;= max(ea,er*abs(I))</literal> onde I é o valor exato
+            <literal>abs(I-v)&lt;= max(atol,er*abs(I))</literal> onde I é o valor exato
             da integral.
         </para>
         <para>
             função FORTRAN ou procedure C com dada seqüência de chamamento:
         </para>
         <para>
-            No caso FORTRAN, a seqüência de chamamento deve ser <literal>double
-                precision function f(x)
-            </literal>
-            onde <literal>x</literal> tabém é um
-            número de dupla precisão.
+            No caso FORTRAN, a seqüência de chamamento deve ser
+            <literal>double precision function f(x)</literal>
+            onde <literal>x</literal> tabém é um número de dupla precisão.
         </para>
         <para>
-            No caso C, a seqüência de chamamento é <literal>double f(double
-                *x)
-            </literal>
-            .
+            No caso C, a seqüência de chamamento é <literal>double f(double *x)</literal>.
+        </para>
+        <para>
+            <emphasis role="bold">Funções Utilizadas</emphasis> :
+            As rotinas associadas (dqags.f e dqagse.f de quadpack) podem ser encontradas
+            no diretório SCI/modules/differential_equations/src/fortran.
         </para>
     </refsection>
     <refsection>
+        <title>Known Limitation</title>
+        <para>
+            Like all the integrators, <literal>intg</literal> is subject to spike missing.
+        </para>
+        <para>
+            A flat function with a spike will be seen as a fully flat function
+            if the spike is stiff enough.
+        </para>
+        <para>
+            This cannot be bypassed. It is easy to understand why when we know how the integrator operates.
+            Indeed, <literal>intg</literal> uses the 21-point Gauss-Kronrod rule.
+            Hence, any spike in-between two consecutive integration points will be undetected,
+            and the function will be considered smooth.
+        </para>
+        <para>
+            However, a warning message will be issued if the function is considered very smooth.
+            The user will then be suggested to reduce the integration interval,
+            should he think that spikes were missed.
+        </para>
+        <para>
+            The following graphs illustrate that phenomenon:
+        </para>
+        <scilab:image localized="true">
+            x = 0:.1:22;
+            y = zeros(1,221); y(1) = 3; y(96) = 1;
+            subplot(1,2,1)
+            plot(x, y, "r");
+            title(_("Unsampled Spike => missed by intg()"), "fontsize",3);
+            xlabel(_("Indices of integration points, as seen by intg()"))
+
+            x = 0:21;
+            y = zeros(1,22); y(1) = 3; y(10) = 1;
+            subplot(1,2,2)
+            plot(x, y, "r");
+            title(_("Sampled spike => detected by intg()"), "fontsize",3);
+            xlabel(_("Indices of integration points, as seen by intg()"))
+
+            gcf().axes_size = [700 350];
+        </scilab:image>
+        <para>
+            On the left image, the spike lays between the 9th and 10th integration points,
+            and is not detected. <literal>intg</literal> considers the function flat.
+            On the right, the spike is large enough to be covered by the integration points.
+        </para>
+        <note>
+            When we want to display the computed solution even if the solver has encountered an error,
+            we should add the third output argument <literal>ierr</literal>. Then errors become
+            simple warnings. This is mostly used in the case of rounding errors.
+        </note>
+    </refsection>
+    <refsection>
         <title>Exemplos</title>
         <programlisting role="example"><![CDATA[
-//caso de função Scilab
-function y=f(x),y=x*sin(30*x)/sqrt(1-((x/(2*%pi))^2)),endfunction
-exact=-2.5432596188;
-I=intg(0,2*%pi,f)
-abs(exact-I)
+// caso de função Scilab
+function y = f(x), y = x*sin(30*x)/sqrt(1-((x/(2*%pi))^2)), endfunction
+exact = -2.5432596188;
+I = intg(0, 2*%pi, f)
+abs(exact - I)
 
-//caso de função Scilab com parâmetros
-function y=f1(x,w),y=x*sin(w*x)/sqrt(1-((x/(2*%pi))^2)),endfunction
-I=intg(0,2*%pi,list(f1,30))
-abs(exact-I)
+// caso de função Scilab com parâmetros
+function y = f1(x,w), y = x*sin(w*x)/sqrt(1-((x/(2*%pi))^2)), endfunction
+I = intg(0, 2*%pi, list(f1,30))
+abs(exact - I)
 
 // caso de código FORTRAN (compilador FORTRAN requerido)
 // escreve o código FORTRAN
@@ -133,18 +194,17 @@ 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,'ffun.f')
-
+mputl(F, 'ffun.f')
 
 // compile o código FORTRAN
-l=ilib_for_link('ffun','ffun.f',[],'f');
+l = ilib_for_link('ffun', 'ffun.f', [], 'f');
 
 // linking incremental
-link(l,'ffun','f')
+link(l, 'ffun', 'f')
 
-//integrando a função
-I=intg(0,2*%pi,'ffun')
-abs(exact-I)
+// integrando a função
+I = intg(0, 2*%pi, 'ffun')
+abs(exact - I)
 
 // caso de código C (compilador C requerido)
 // escreva o código C
@@ -155,17 +215,17 @@ C=['#include <math.h>'
    '  y=*x/(2.0e0*pi);'
    '  return *x*sin(30.0e0**x)/sqrt(1.0e0-y*y);'
    '}'];
-mputl(C,'cfun.c')
+mputl(C, 'cfun.c')
 
 // compile o código C
-l=ilib_for_link('cfun','cfun.c',[],'c');
+l = ilib_for_link('cfun', 'cfun.c', [], 'c');
 
 // linking incremental
-link(l,'cfun','c')
+link(l, 'cfun', 'c')
 
 //integrando a função
-I=intg(0,2*%pi,'cfun')
-abs(exact-I)
+I = intg(0, 2*%pi, 'cfun')
+abs(exact - I)
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
@@ -188,11 +248,16 @@ abs(exact-I)
             </member>
         </simplelist>
     </refsection>
-    <refsection>
-        <title>Funções Utilizadas</title>
-        <para>As rotinas associadas podem ser encontradas no diretório
-            SCI/modules/differential_equations/src/fortran :
-        </para>
-        <para>dqags.f e dqagse.f de quadpack</para>
+    <refsection role="history">
+        <title>Histórico</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.0.2</revnumber>
+                <revdescription>
+                    The default value atol of the absolute tolerance is increased from
+                    10<superscript>-14</superscript> to 10<superscript>-13</superscript>.
+                </revdescription>
+            </revision>
+        </revhistory>
     </refsection>
 </refentry>
index 61917b9..3311ca0 100644 (file)
@@ -2,8 +2,9 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA - Farid BELAHCENE
- *
+ * Copyright (C) 2013 - Scilab Enterprises - Paul Bignier: added error control
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="ru" xml:id="intc">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
+          xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
+          xml:lang="ru" xml:id="intc">
     <refnamediv>
         <refname>intc</refname>
-        <refpurpose>интеграл Коши</refpurpose>
+        <refpurpose>интеграл вдоль прямой на комплексной плоскости</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Синтаксис</title>
-        <synopsis>[y]=intc(a,b,f)</synopsis>
+        <synopsis>
+          [y, err] = intc(a, b, f)
+          [y, err] = intc(a, b, f, abserr)
+          [y, err] = intc(a, b, f, abserr, relerr)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Аргументы</title>
             <varlistentry>
                 <term>a, b</term>
                 <listitem>
-                    <para>два комплексных числа</para>
+                    два комплексных числа: начальная и конечная точки интеграла
+                    на комплексной плоскости.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>f</term>
                 <listitem>
-                    <para>"внешняя" функция</para>
+                    "внешняя" функция.
+                    <para/>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>abserr, relerr</term>
+                <listitem>
+                    вещественные скаляры, абсолютная и относительная ошибки.
+                    Значения по умолчанию: <literal>1.d-13</literal> и <literal>1d-8</literal>.
+                    <para/>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>err</term>
+                <listitem>
+                    вещественное число, оценённая абсолютная ошибка результата.
+                    <para/>
                 </listitem>
             </varlistentry>
         </variablelist>
     <refsection>
         <title>Описание</title>
         <para>
-            Если <literal>f</literal> -- комплекснозначная функция, то <literal> intc(a,b,f) </literal>
-            вычисляет интеграл функции <literal>f(z)dz</literal> от <literal>a</literal> до <literal>b</literal>
-            вдоль прямой линии <literal>a b</literal> на комплексной плоскости.
+            Если <literal>f</literal> - это комплекснозначная функция,
+            <literal>intc(a, b, f)</literal>
+            вычисляет интеграл <literal>f(z)dz</literal> от <literal>a</literal> до
+            <literal>b</literal> вдоль прямой линии <literal>[a b]</literal>
+            на комплексной плоскости.
         </para>
     </refsection>
     <refsection>
         <title>Примеры</title>
         <programlisting role="example"><![CDATA[
-function y=f(z)
-  y = z^(3 + %pi * %i)
+function y = f(z)
+  y = z^(3 + %pi * %i);
 endfunction
 
 intc(1+%i, 4-%i, f)
+
+[r, err] = intc(1+%i, 4-%i, f, 1d-10, 1d-6)
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
@@ -68,4 +98,23 @@ intc(1+%i, 4-%i, f)
             </member>
         </simplelist>
     </refsection>
+    <refsection>
+        <title>История</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.5.0</revnumber>
+                <revremark>
+                    Добавлено управление абсолютной и относительной (на входе) и
+                    абсолютной (на выходе) ошибками.
+                </revremark>
+            </revision>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revremark>
+                    По умолчанию значение abserr увеличена от
+                    10<superscript>-14</superscript> до 10<superscript>-13</superscript>.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index f4e1348..b62bb73 100644 (file)
@@ -2,8 +2,8 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2008 - INRIA
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2020 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="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="integrate" xml:lang="ru">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="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="integrate" xml:lang="ru">
     <refnamediv>
         <refname>integrate</refname>
         <refpurpose>интегрирование выражения квадратурами</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Синтаксис</title>
-        <synopsis>x=integrate(expr,v,x0,x1 [,atol [,rtol]])</synopsis>
+        <synopsis>
+          y = integrate(expr, v, x0, x1)
+          y = integrate(expr, v, x0, x1, atol)
+          y = integrate(expr, v, x0, x1, atol, rtol)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Аргументы</title>
             <varlistentry>
                 <term>expr</term>
                 <listitem>
-                    <para>символьная строка, определяющая Scilab-выражение.</para>
+                    символьная строка, определяющая Scilab-выражение.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>v</term>
                 <listitem>
-                    <para>символьная строка, имя переменной по которой производится интегрирование.</para>
+                    символьная строка, имя переменной по которой производится интегрирование.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>x0</term>
                 <listitem>
-                    <para>вещественное число, нижний предел интегрирования.</para>
+                    вещественное число, нижний предел интегрирования.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>x1</term>
                 <listitem>
-                    <para>вектор вещественных чисел, верхние пределы интегрирования.</para>
+                    вектор вещественных чисел, верхние пределы интегрирования.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>atol</term>
                 <listitem>
-                    <para>вещественное число (предел абсолютной ошибки). Значение по умолчанию: 1e-8.</para>
+                    вещественное число (предел абсолютной ошибки). Значение по умолчанию: 1e-13.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>rtol</term>
                 <listitem>
-                    <para>вещественное число (предел относительной ошибки). Значение по умолчанию:
-                        1e-14.
-                    </para>
+                    вещественное число (предел относительной ошибки). Значение по умолчанию: 1e-8.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>x</term>
+                <term>y</term>
                 <listitem>
-                    <para>
-                        вектор вещественных чисел, значение интеграла для каждого <literal>x1(i)</literal>.
-                    </para>
+                    вектор вещественных чисел, значение интеграла для каждого <literal>x1(i)</literal>.
+                    <para/>
                 </listitem>
             </varlistentry>
         </variablelist>
     <refsection>
         <title>Описание</title>
         <para>
-            <literal>x=integrate(expr,v,x0,x1 [,atol [,rtol]])</literal> computes :
-            <subscript>
-                <inlinemediaobject>
-                    <imageobject>
-                        <imagedata>
-                            <mml:math display="block" scilab:localized="true">
-                                <mml:mi mathvariant="normal">x</mml:mi>
-                                <mml:mrow>
-                                    <mml:mrow>
-                                        <mml:mo>(</mml:mo><mml:mi mathvariant="normal">i</mml:mi><mml:mo>)</mml:mo>
-                                    </mml:mrow>
-                                    <mml:mo>=</mml:mo>
-                                    <mml:mrow>
-                                        <mml:msubsup>
-                                            <mml:mo>∫</mml:mo>
-                                            <mml:msub>
-                                                <mml:mi mathvariant="normal">x</mml:mi><mml:mn>0</mml:mn>
-                                            </mml:msub>
-                                            <mml:mrow>
-                                                <mml:msub>
-                                                    <mml:mi mathvariant="normal">x</mml:mi><mml:mn>1</mml:mn>
-                                                </mml:msub>
-                                                <mml:mrow>
-                                                    <mml:mo>(</mml:mo><mml:mi mathvariant="normal">i</mml:mi><mml:mo>)</mml:mo>
-                                                </mml:mrow>
-                                            </mml:mrow>
-                                        </mml:msubsup>
-                                        <mml:mi mathvariant="normal">f</mml:mi>
-                                    </mml:mrow>
-                                </mml:mrow>
-                                <mml:mrow>
-                                    <mml:mo>(</mml:mo><mml:mi mathvariant="normal">v</mml:mi><mml:mo>)</mml:mo>
-                                </mml:mrow>
-                                <mml:mi>d</mml:mi><mml:mi mathvariant="normal">v</mml:mi><mml:annotation mml:encoding="StarMath 5.0">x(i)=int_{x_0}^{x_1(i)}
-                                    f(v)dv
-                                </mml:annotation>
-                            </mml:math>
-                        </imagedata>
-                    </imageobject>
-                </inlinemediaobject>
-            </subscript>
-            для
-            <literal>i=1:size(x1,'*')</literal>,
-            где
-            <inlinemediaobject>
-                <imageobject>
-                    <imagedata>
-                        <mml:math display="block">
-                            <mml:mi mathvariant="normal">f</mml:mi><mml:mo>(</mml:mo><mml:mi mathvariant="normal">v</mml:mi><mml:mo>)</mml:mo>
-                        </mml:math>
-                    </imagedata>
-                </imageobject>
-            </inlinemediaobject>
-            задано выражением
-            <literal>expr</literal>.
+            <literal>y = integrate(expr, v, x0, x1 [,atol [,rtol]])</literal> computes
+            <latex alt="y(i) = integral_{x_0}^{x_1(i)} f(v).dv">
+                y(i) = \int_{x_0}^{x_1(i)} f(v)\,dv
+            </latex>
+            для <literal>i=1:size(x1,'*')</literal>, где <emphasis>f(v)</emphasis> задано
+            выражением <literal>expr</literal>.
         </para>
         <para>
             Вычисление, как можно надеяться, удовлетворяет следующему условию точности:
-            <literal>abs(I-x)&lt;= max(atol,rtol*abs(I))</literal>, где
+            <literal>abs(I-y)&lt;= max(atol, rtol*abs(I))</literal>, где
             <literal>I</literal> обозначает точное значение интеграла.
         </para>
-    </refsection>
-    <refsection>
-        <title>Ограничение</title>
         <para>
-            Указанное выражение не должно использовать имена переменных, начинающихся с символа
-            <literal>%</literal>.
+            <warning>
+                Ограничение: Указанное выражение не должно использовать имена переменных,
+                начинающихся с символа <literal>%</literal>.
+            </warning>
         </para>
     </refsection>
     <refsection>
         <title>Примеры</title>
         <programlisting role="example"><![CDATA[
-x0=0;x1=0:0.1:2*%pi;
-X=integrate('sin(x)','x',x0,x1);
-norm(cos(x1)-(1-X))
+x1 = 0:0.1:2*%pi;
+Y = integrate('sin(x)', 'x', 0, x1);
+norm(cos(x1)-(1-Y))
 
- x1=-10:0.1:10;
-X=integrate(['if x==0 then 1,';
-             'else sin(x)/x,end'],'x',0,x1)
+x1 = -10:0.1:10;
+Y = integrate(['if x==0 then 1,';
+               'else sin(x)/x,end'], 'x', 0, x1)
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
@@ -174,4 +134,16 @@ X=integrate(['if x==0 then 1,';
             </member>
         </simplelist>
     </refsection>
+    <refsection role="history">
+        <title>История</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.1.0</revnumber>
+                <revdescription>
+                    Default atol value increased from
+                    10<superscript>-14</superscript> to 10<superscript>-13</superscript>.
+                </revdescription>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index 08040ad..b1ec058 100644 (file)
  * along with this program.
  *
  -->
-<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="ru">
+<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="ru">
     <refnamediv>
         <refname>intg</refname>
         <refpurpose>определённый интеграл</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Синтаксис</title>
-        <synopsis>[v,err]=intg(a,b,f [,ea [,er])</synopsis>
+        <synopsis>
+            [v, err] = intg(a, b, f)
+            [v, err] = intg(a, b, f, atol)
+            [v, err] = intg(a, b, f, atol, rtol)
+            [v, err, ierr] = intg(..)
+        </synopsis>
     </refsynopsisdiv>
     <refsection>
         <title>Аргументы</title>
             <varlistentry>
                 <term>a, b</term>
                 <listitem>
-                    <para>вещественные числа</para>
+                    Конечные действительные числа: границы интеграла.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
                 <term>f</term>
                 <listitem>
-                    <para>внешняя функция (функция, список или строка)</para>
+                    внешняя функция (функция, список или строка)
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>ea, er</term>
+                <term>atol</term>
                 <listitem>
-                    <para>вещественные числа</para>
+                    абсолютная ошибка, требуемая для результата. Значение по умолчанию: 1.d-13.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>ea</term>
+                <term>rtol</term>
                 <listitem>
-                    <para>
-                        абсолютная ошибка, требуемая для результата. Значение по
-                        умолчанию: 1.d-13.
-                    </para>
+                    относительная ошибка, требуемая для результата. Значение по умолчанию: 1.d-8.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>er</term>
+                <term>err</term>
                 <listitem>
-                    <para>
-                        относительная ошибка, требуемая для результата. Значение по
-                        умолчанию: 1.d-8.
-                    </para>
+                    оцененная абсолютная ошибка результата.
+                    <para/>
                 </listitem>
             </varlistentry>
             <varlistentry>
-                <term>err</term>
+                <term>ierr</term>
                 <listitem>
-                    <para>
-                        оцененная абсолютная ошибка результата.
-                    </para>
+                      error flag number (= 0 if no error occurred).
+                      <para/>
                 </listitem>
             </varlistentry>
         </variablelist>
@@ -82,7 +88,7 @@
         </para>
         <para>
             Вычисление, как можно ожидать, удовлетворяет следующему условию точности:
-            <literal>abs(I-v)&lt;= max(ea,er*abs(I))</literal>, где
+            <literal>abs(I-v)&lt;= max(atol, rtol*abs(I))</literal>, где
             <literal>I</literal> -- точное значение интеграла.
         </para>
         <para>
                 </listitem>
             </itemizedlist>
         </itemizedlist>
+        <para>
+            <emphasis role="bold">Используемые функции</emphasis> :
+            Связанные подпрограммы можно найти в директории
+            SCI/modules/differential_equations/src/fortran: dqags.f и dqagse.f из quadpack.
+        </para>
+    </refsection>
+    <refsection>
+        <title>Known Limitation</title>
+        <para>
+            Like all the integrators, <literal>intg</literal> is subject to spike missing.
+        </para>
+        <para>
+            A flat function with a spike will be seen as a fully flat function
+            if the spike is stiff enough.
+        </para>
+        <para>
+            This cannot be bypassed. It is easy to understand why when we know how the integrator operates.
+            Indeed, <literal>intg</literal> uses the 21-point Gauss-Kronrod rule.
+            Hence, any spike in-between two consecutive integration points will be undetected,
+            and the function will be considered smooth.
+        </para>
+        <para>
+            However, a warning message will be issued if the function is considered very smooth.
+            The user will then be suggested to reduce the integration interval,
+            should he think that spikes were missed.
+        </para>
+        <para>
+            The following graphs illustrate that phenomenon:
+        </para>
+        <scilab:image localized="true">
+            x = 0:.1:22;
+            y = zeros(1,221); y(1) = 3; y(96) = 1;
+            subplot(1,2,1)
+            plot(x, y, "r");
+            title(_("Unsampled Spike => missed by intg()"), "fontsize",3);
+            xlabel(_("Indices of integration points, as seen by intg()"))
+
+            x = 0:21;
+            y = zeros(1,22); y(1) = 3; y(10) = 1;
+            subplot(1,2,2)
+            plot(x, y, "r");
+            title(_("Sampled spike => detected by intg()"), "fontsize",3);
+            xlabel(_("Indices of integration points, as seen by intg()"))
+
+            gcf().axes_size = [700 350];
+        </scilab:image>
+        <para>
+            On the left image, the spike lays between the 9th and 10th integration points,
+            and is not detected. <literal>intg</literal> considers the function flat.
+            On the right, the spike is large enough to be covered by the integration points.
+        </para>
+        <note>
+            When we want to display the computed solution even if the solver has encountered an error,
+            we should add the third output argument <literal>ierr</literal>. Then errors become
+            simple warnings. This is mostly used in the case of rounding errors.
+        </note>
     </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
-exact=-2.5432596188;
-I=intg(0,2*%pi,f)
-abs(exact-I)
+function y = f(x), y = x*sin(30*x)/sqrt(1-((x/(2*%pi))^2)), endfunction
+exact = -2.5432596188;
+I = intg(0, 2*%pi, f)
+abs(exact - I)
 
 // Функция с аргументом, написанном на языке Scilab
-function y=f1(x,w),y=x*sin(w*x)/sqrt(1-((x/(2*%pi))^2)),endfunction
-I=intg(0,2*%pi,list(f1,30))
-abs(exact-I)
-
+function y = f1(x,w), y=x*sin(w*x)/sqrt(1-((x/(2*%pi))^2)), endfunction
+I = intg(0, 2*%pi, list(f1,30))
+abs(exact - I)
 
 // Функция, написанная на Fortran (требуется компилятор Fortran)
 // определение функции Fortran
@@ -149,18 +210,18 @@ 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,'ffun.f')
+mputl(F, 'ffun.f')
 
 
 // компилируем функцию
- l=ilib_for_link('ffun','ffun.f',[],'f');
+ l = ilib_for_link('ffun', 'ffun.f', [], 'f');
 
 // добавляем  функцию в рабочее окружение
-link(l,'ffun','f')
+link(l, 'ffun', 'f')
 
 // интегрируем функцию
-I=intg(0,2*%pi,'ffun')
-abs(exact-I)
+I = intg(0, 2*%pi, 'ffun')
+abs(exact - I)
 
 // Функция, написанная на C (требуется компилятор C)
 // определение C-функции
@@ -171,17 +232,17 @@ C=['#include <math.h>'
    '  y=*x/(2.0e0*pi);'
    '  return *x*sin(30.0e0**x)/sqrt(1.0e0-y*y);'
    '}'];
-mputl(C,'cfun.c')
+mputl(C, 'cfun.c')
 
 //  компилируем функцию
- l=ilib_for_link('cfun','cfun.c',[],'c');
+l = ilib_for_link('cfun', 'cfun.c', [], 'c');
 
 // добавляем  функцию в рабочее окружение
-link(l,'cfun','c')
+link(l, 'cfun', 'c')
 
 // интегрируем функцию
-I=intg(0,2*%pi,'cfun')
-abs(exact-I)
+I = intg(0, 2*%pi, 'cfun')
+abs(exact - I)
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
@@ -204,11 +265,16 @@ abs(exact-I)
             </member>
         </simplelist>
     </refsection>
-    <refsection>
-        <title>Используемые функции</title>
-        <para>Связанные подпрограммы можно найти в директории
-            SCI/modules/differential_equations/src/fortran:
-        </para>
-        <para>dqags.f и dqagse.f из quadpack</para>
+    <refsection role="history">
+        <title>История</title>
+        <revhistory>
+            <revision>
+                <revnumber>6.0.2</revnumber>
+                <revdescription>
+                    The default value atol of the absolute tolerance is increased from
+                    1O<superscript>-14</superscript> to 1O<superscript>-13</superscript>.
+                </revdescription>
+            </revision>
+        </revhistory>
     </refsection>
 </refentry>
index 6c38ae8..75ad341 100644 (file)
@@ -15,46 +15,48 @@ function [r, err] = intc(a, b, f, abserr, relerr)
     // If f is a complex-valued macro, intc(a, b, f) computes
     // the integral from a to b of f(z)dz along the straight
     // line a-b of the complex plane.
-    // abserr: absolute error required. Default: 1d-14.
+    // abserr: absolute error required. Default: 1d-13.
     // relerr: relative error required. Default: 1d-8.
     // err : estimated absolute error on the result.
 
     [lhs, rhs] = argn();
 
+    // CHECKING ARGUMENTS
+    // ------------------
     if rhs < 3 then
         error(msprintf(_("%s: Wrong number of input argument(s): at least %d expected.\n"), "intc", 3));
     end
-
-    if rhs == 3 then
-        abserr = 1d-14;
-        relerr = 1d-8;
-    elseif rhs == 4 then
-        if type(abserr) <> 1 then
-            error(msprintf(_("%s: Wrong type for input argument #%d: Real expected.\n"), "intc", 4));
-        end
-        if ~isscalar(abserr) then
-            error(msprintf(_("%s: Wrong size for input argument #%d: (%d,%d) expected.\n"), "intc", 4, 1, 1));
-        end
-        relerr = 1d-8;
-    else
-        if type(abserr) <> 1 then
-            error(msprintf(_("%s: Wrong type for input argument #%d: Real expected.\n"), "intc", 4));
-        end
-        if ~isscalar(abserr) then
-            error(msprintf(_("%s: Wrong size for input argument #%d: (%d,%d) expected.\n"), "intc", 4, 1, 1));
-        end
-        if type(relerr) <> 1 then
-            error(msprintf(_("%s: Wrong type for input argument #%d: Real expected.\n"), "intc", 5));
-        end
-        if ~isscalar(relerr) then
-            error(msprintf(_("%s: Wrong size for input argument #%d: (%d,%d) expected.\n"), "intc", 5, 1, 1));
-        end
+    // relerr
+    if ~isdef("relerr","l") | relerr==[] then
+        relerr = 1d-8
     end
-
+    if type(relerr) <> 1 then
+        msg = _("%s: Wrong type for input argument #%d: Real expected.\n")
+        error(msprintf(msg, "intc", 5));
+    end
+    if ~isscalar(relerr) then
+        msg = _("%s: Argument #%d: Scalar (1 element) expected.\n")
+        error(msprintf(msg, "intc", 5));
+    end
+    // abserr
+    if ~isdef("abserr","l") then
+        abserr = 1d-13
+    end
+    if type(abserr) <> 1 then
+        msg = _("%s: Wrong type for input argument #%d: Real expected.\n")
+        error(msprintf(msg, "intc", 4));
+    end
+    if ~isscalar(abserr) then
+        msg = _("%s: Argument #%d: Scalar (1 element) expected.\n")
+        error(msprintf(msg, "intc", 4));
+    end
+    // f
     if and(type(f) <> [13 130]) then
         error(msprintf(_("%s: Wrong type for input argument #%d: Scilab function expected.\n"), "intc", 3));
     end
 
+    // PROCESSING
+    // ----------
     // Define two functions which define the real part and
     // imaginary part of f(g(t))*g'(t) where g(t) is a
     // parametrization of the line a-b.
index 06415df..38bb7ac 100644 (file)
@@ -10,7 +10,7 @@
 // For more information, see the COPYING file which you should have received
 // along with this program.
 
-function %x=integrate(%expr,%var,%x0,%x1,%ea,%er)
+function %x = integrate(%expr, %var, %x0, %x1, %ea, %er)
     // x=integrate(expr,v,x0,x1 [,ea [,er]])  computes
     //                      /x1
     //                     [
@@ -18,7 +18,6 @@ function %x=integrate(%expr,%var,%x0,%x1,%ea,%er)
     //                     ]
     //                    /x0
     //
-    //
     //examples:
     //integrate('sin(x)','x',0,%pi)
     //integrate(['if x==0 then 1,';
@@ -29,11 +28,11 @@ function %x=integrate(%expr,%var,%x0,%x1,%ea,%er)
         error(msprintf(gettext("%s: Wrong number of input argument(s): At least %d expected.\n"),"integrate",4));
     end
 
-    select rhs
-    case 4 then
-        %ea=1d-14;%er=1.d-8
-    case 5 then
-        %er=1d-14;
+    if ~isdef("%ea","l") | %ea==[]
+        %ea = 1e-13
+    end
+    if ~isdef("%er","l")
+        %er = 1e-8
     end
 
     if size(%x0,"*")<>1 then
@@ -55,12 +54,12 @@ function %x=integrate(%expr,%var,%x0,%x1,%ea,%er)
     if norm(imag(%x1),1)<>0 then
         error(msprintf(gettext("%s: Wrong type for input argument #%d: A real expected.\n"),"integrate",4));
     else
-        %x1=real(%x1)
+        %x1 = real(%x1)
     end
     //
 
     try
-        if %expr==%var then
+        if %expr == %var then
             deff(%var+"=%func("+%var+")",%expr)
         else
             deff("ans=%func("+%var+")",%expr)
@@ -76,20 +75,20 @@ function %x=integrate(%expr,%var,%x0,%x1,%ea,%er)
     [%x1,%ks]=gsort(%x1,"g","i")
     %x=zeros(%x1)
 
-    %kkk=find((%x1(1:$-1)<%x0) & (%x1(2:$)>=%x0))
-    if %kkk <>[] then
-        %xx0=%x0;
-        for %kk=1:%kkk
-            %x(%kk)=-intg(%xx0,%x1(%kk),%func,%ea,%er);
-            %xx0=%x1(%kk);
+    %kkk = find((%x1(1:$-1)<%x0) & (%x1(2:$)>=%x0))
+    if %kkk <> [] then
+        %xx0 = %x0;
+        for %kk = 1:%kkk
+            %x(%kk) = -intg(%xx0,%x1(%kk), %func, %ea, %er);
+            %xx0 = %x1(%kk);
         end
     end
-    %xx0=%x0;
-    for %kk=1:size(%x1,"*")
-        %x(%kk)=intg(%xx0,%x1(%kk),%func,%ea,%er);
-        %xx0=%x1(%kk);
+    %xx0 = %x0;
+    for %kk = 1:size(%x1,"*")
+        %x(%kk) = intg(%xx0, %x1(%kk), %func, %ea, %er);
+        %xx0 = %x1(%kk);
     end
-    %x=cumsum(%x)
-    %x=matrix(%x(%ks),size(%x1));
+    %x = cumsum(%x)
+    %x = matrix(%x(%ks), size(%x1));
 
 endfunction
index 0942d29..103b128 100644 (file)
@@ -10,7 +10,7 @@
 // For more information, see the COPYING file which you should have received
 // along with this program.
 
-function r=intl(a,b,z0,r,f,ea,er)
+function r = intl(a, b, z0, r, f, ea, er)
     //If f is a complex-valued function, intl(a,b,z0,r,f) computes
     //the integral of f(z)dz along the complex plane curve defined by
     //  z0 + r.exp(%i*t)
@@ -18,26 +18,23 @@ function r=intl(a,b,z0,r,f,ea,er)
     //(part of the circle with center z0 and radius r with phase between a and b)
     //!
 
-    //First compile f if necessary:
-
-    rhs=argn(2)
-    if rhs<7 then
-        er=%eps;
+    if ~isdef("ea","l") | ea==[] then
+        ea = %eps;  // could be 1d-13 as with intg, integrate and intc
     end
-    if rhs<6 then
-        ea=1.d-12;
+    if ~isdef("er","l") | er==[] then
+        er = 1d-12;  // could be 1d-8 as with intg, integrate and intc
     end
 
     //Define two functions for the real part and
     //imaginary part of f(g(t))*g'(t) where g(t) is a
     //parametrization of the circle.
-    deff("y=real1(t)",[
-    "z=r*exp(%i*((1-t)*a+t*b))"
-    "y=real(f(z+z0)*%i*(b-a)*z)"] )
+    deff("y = real1(t)",[
+    "z = r*exp(%i*((1-t)*a+t*b))"
+    "y = real(f(z+z0)*%i*(b-a)*z)"] )
 
-    deff("y=imag1(t)",[
-    "z=r*exp(%i*((1-t)*a+t*b))"
-    "y=imag(f(z+z0)*%i*(b-a)*z)"] )
+    deff("y = imag1(t)",[
+    "z = r*exp(%i*((1-t)*a+t*b))"
+    "y = imag(f(z+z0)*%i*(b-a)*z)"] )
 
-    r=intg(0,1,real1,ea,er)+%i*intg(0,1,imag1,ea,er)
+    r = intg(0,1,real1, ea, er) + %i*intg(0, 1, imag1, ea, er)
 endfunction
index 78662eb..f6e4114 100644 (file)
@@ -60,12 +60,12 @@ Graphics_22.png=1769acb58167f96070f6c71dcd54cbf2
 Graphics_23.png=c6b390df4f9b9e5ff3db3f891f1e5dce
 Graphics_24.png=90067203ae72d8ba7f61061a17f7d016
 Graphics_25.png=02e80dc6ec334a5caf5b2c918e68bad3
-Graphics_26.png=4bc6636c30fd29609f4bd77bfeaea661
+Graphics_26.png=066b94090d46cf054a92b56d45271b59
 Graphics_27.png=f81c4cf83b99442956c35722e86ec478
 Graphics_28.png=7fe04f65bcbeb65eef5f90b3759be02e
 Graphics_29.png=87ec396c51a7cc6aafb148e1aa5f9256
 Graphics_3.png=9d4c072a9f27f8f0e07f7d098ee533ec
-Graphics_30.png=67f6ae9c0d36df93eb50e514746aac13
+Graphics_30.png=340da0d425ed4d7cfd9edce7510846db
 Graphics_31.png=26826b399f567100ed0118a54c896b5a
 Graphics_32.png=26826b399f567100ed0118a54c896b5a
 Graphics_36.png=76950c3a78d543018ca046b7e5709d88
@@ -305,6 +305,8 @@ _LaTeX_grand.xml_2.png=4065036eed5d60beaa7f246c013cbff0
 _LaTeX_hank.xml_1.png=fc6c604bc8c86af20a8f0673047332db
 _LaTeX_histc.xml_1.png=86e9e40df666b60dcf23b351b0d7ede9
 _LaTeX_histplot.xml_1.png=f1c5acc5939d55326dfab4af50e13f97
+_LaTeX_integrate.xml_1.png=2beee4d4fbe5e2aeb20027186400b73e
+_LaTeX_integrate_1.png=2beee4d4fbe5e2aeb20027186400b73e
 _LaTeX_interp.xml_1.png=b99c07a3557a83033fdeedd84352b082
 _LaTeX_interp.xml_10.png=e257b3b19cc16006687169337c38dc2a
 _LaTeX_interp.xml_11.png=b99c07a3557a83033fdeedd84352b082
@@ -449,11 +451,6 @@ _MathML_bvode.xml_ru_RU_7.png=bf99445553185140244e57466f859bd5
 _MathML_convol.xml_1.png=99ca156723e23394e879c2035745d736
 _MathML_cspect.xml_1.png=1219d0564561afe97ea367612399e26a
 _MathML_delip.xml_1.png=69d9a5b9453c4b10349d9c25e33f0a64
-_MathML_integrate.xml_1.png=905e696eacda4fe1df6c72b6bbb8a0d3
-_MathML_integrate.xml_2.png=e674adcfdb3435295438f0d040596095
-_MathML_integrate.xml_fr_FR_1.png=797aceb1aba80a1d083dc5963bcc22a2
-_MathML_integrate.xml_pt_BR_1.png=797aceb1aba80a1d083dc5963bcc22a2
-_MathML_integrate.xml_ru_RU_1.png=797aceb1aba80a1d083dc5963bcc22a2
 _MathML_pspect.xml_1.png=1219d0564561afe97ea367612399e26a
 acos_1.png=17d595e24e7d60478a837a3b8abe0798
 acosd_1.png=a933487424afe251b71aaf38fb285f1c
@@ -816,14 +813,11 @@ interp2d_4.png=6721e8c874b8c8c2badc14cb66dfc335
 interp_1.png=f58742fc485ae0236bf69ee2ca56a18c
 interp_2.png=07cd179b04b37e191b2e7cf21ba64dbe
 interpln_1.png=bd4566ba45e721c3a1d47695a7166240
-intg_en_US_1.png=24ad1ebaeea773a33928890cfddb6bb5
-intg_en_US_2.png=5a9e789d2138a80876bf52ca51b591f8
-intg_fr_FR_1.png=49896f43a08105afed470fca8530de7f
-intg_fr_FR_2.png=77946e65b25325b6e167f39b82deedd4
-intg_ja_JP_1.png=24ad1ebaeea773a33928890cfddb6bb5
-intg_ja_JP_2.png=5a9e789d2138a80876bf52ca51b591f8
-intg_pt_BR_1.png=24ad1ebaeea773a33928890cfddb6bb5
-intg_pt_BR_2.png=5a9e789d2138a80876bf52ca51b591f8
+intg_en_US_1.png=2088693099d251fbe5e6b999903bc209
+intg_fr_FR_1.png=2088693099d251fbe5e6b999903bc209
+intg_ja_JP_1.png=2088693099d251fbe5e6b999903bc209
+intg_pt_BR_1.png=2088693099d251fbe5e6b999903bc209
+intg_ru_RU_1.png=2088693099d251fbe5e6b999903bc209
 isoview_1.png=e790c7133eeb3870b6ecf6aff552fa19
 isoview_en_US_2.png=7f599cee0ebf55f0e9656eb280e7af3c
 isoview_fr_FR_2.png=8e441a3c56e558a5b5bafdf3dba2d61c
index ca8aa4f..41d09c1 100644 (file)
Binary files a/scilab/modules/helptools/images/Graphics_1.png and b/scilab/modules/helptools/images/Graphics_1.png differ
index bdf7d07..6b87c9d 100644 (file)
Binary files a/scilab/modules/helptools/images/Graphics_26.png and b/scilab/modules/helptools/images/Graphics_26.png differ
index d9a5d29..9a1fbfd 100644 (file)
Binary files a/scilab/modules/helptools/images/Graphics_30.png and b/scilab/modules/helptools/images/Graphics_30.png differ
diff --git a/scilab/modules/helptools/images/_LaTeX_integrate.xml_1.png b/scilab/modules/helptools/images/_LaTeX_integrate.xml_1.png
new file mode 100644 (file)
index 0000000..9c4a34e
Binary files /dev/null and b/scilab/modules/helptools/images/_LaTeX_integrate.xml_1.png differ
diff --git a/scilab/modules/helptools/images/_MathML_integrate.xml_2.png b/scilab/modules/helptools/images/_MathML_integrate.xml_2.png
deleted file mode 100644 (file)
index 65a8f86..0000000
Binary files a/scilab/modules/helptools/images/_MathML_integrate.xml_2.png and /dev/null differ
diff --git a/scilab/modules/helptools/images/_MathML_integrate.xml_fr_FR_1.png b/scilab/modules/helptools/images/_MathML_integrate.xml_fr_FR_1.png
deleted file mode 100644 (file)
index e6f6174..0000000
Binary files a/scilab/modules/helptools/images/_MathML_integrate.xml_fr_FR_1.png and /dev/null differ
diff --git a/scilab/modules/helptools/images/_MathML_integrate.xml_pt_BR_1.png b/scilab/modules/helptools/images/_MathML_integrate.xml_pt_BR_1.png
deleted file mode 100644 (file)
index e6f6174..0000000
Binary files a/scilab/modules/helptools/images/_MathML_integrate.xml_pt_BR_1.png and /dev/null differ
diff --git a/scilab/modules/helptools/images/_MathML_integrate.xml_ru_RU_1.png b/scilab/modules/helptools/images/_MathML_integrate.xml_ru_RU_1.png
deleted file mode 100644 (file)
index e6f6174..0000000
Binary files a/scilab/modules/helptools/images/_MathML_integrate.xml_ru_RU_1.png and /dev/null differ
index e3a1cd9..04c1766 100644 (file)
Binary files a/scilab/modules/helptools/images/intg_en_US_1.png and b/scilab/modules/helptools/images/intg_en_US_1.png differ
diff --git a/scilab/modules/helptools/images/intg_en_US_2.png b/scilab/modules/helptools/images/intg_en_US_2.png
deleted file mode 100644 (file)
index 86f10ae..0000000
Binary files a/scilab/modules/helptools/images/intg_en_US_2.png and /dev/null differ
index a8afe84..04c1766 100644 (file)
Binary files a/scilab/modules/helptools/images/intg_fr_FR_1.png and b/scilab/modules/helptools/images/intg_fr_FR_1.png differ
diff --git a/scilab/modules/helptools/images/intg_fr_FR_2.png b/scilab/modules/helptools/images/intg_fr_FR_2.png
deleted file mode 100644 (file)
index da839c7..0000000
Binary files a/scilab/modules/helptools/images/intg_fr_FR_2.png and /dev/null differ
index e3a1cd9..04c1766 100644 (file)
Binary files a/scilab/modules/helptools/images/intg_ja_JP_1.png and b/scilab/modules/helptools/images/intg_ja_JP_1.png differ
diff --git a/scilab/modules/helptools/images/intg_ja_JP_2.png b/scilab/modules/helptools/images/intg_ja_JP_2.png
deleted file mode 100644 (file)
index 86f10ae..0000000
Binary files a/scilab/modules/helptools/images/intg_ja_JP_2.png and /dev/null differ
index e3a1cd9..e76bf6e 100644 (file)
Binary files a/scilab/modules/helptools/images/intg_pt_BR_1.png and b/scilab/modules/helptools/images/intg_pt_BR_1.png differ
diff --git a/scilab/modules/helptools/images/intg_pt_BR_2.png b/scilab/modules/helptools/images/intg_pt_BR_2.png
deleted file mode 100644 (file)
index 86f10ae..0000000
Binary files a/scilab/modules/helptools/images/intg_pt_BR_2.png and /dev/null differ
diff --git a/scilab/modules/helptools/images/intg_ru_RU_1.png b/scilab/modules/helptools/images/intg_ru_RU_1.png
new file mode 100644 (file)
index 0000000..e76bf6e
Binary files /dev/null and b/scilab/modules/helptools/images/intg_ru_RU_1.png differ