~ubuntu-branches/ubuntu/raring/scilab/raring-proposed

« back to all changes in this revision

Viewing changes to modules/differential_equations/help/en_US/int2d.xml

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-08-30 14:42:38 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20120830144238-c1y2og7dbm7m9nig
Tags: 5.4.0-beta-3-1~exp1
* New upstream release
* Update the scirenderer dep
* Get ride of libjhdf5-java dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
 *
13
13
 -->
14
14
<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" version="5.0-subset Scilab" xml:id="int2d" xml:lang="en">
15
 
  <refnamediv>
16
 
    <refname>int2d</refname>
17
 
    <refpurpose>definite 2D integral by quadrature and cubature
18
 
      method
19
 
    </refpurpose>
20
 
  </refnamediv>
21
 
  <refsynopsisdiv>
22
 
    <title>Calling Sequence</title>
23
 
    <synopsis>[I,err]=int2d(X,Y,f [,params])</synopsis>
24
 
  </refsynopsisdiv>
25
 
  <refsection>
26
 
    <title>Arguments</title>
27
 
    <variablelist>
28
 
      <varlistentry>
29
 
        <term>X</term>
30
 
        <listitem>
31
 
          <para>
32
 
            a 3 by <literal>N</literal> array containing the abscissae of the vertices of the
33
 
            N triangles
34
 
          </para>
35
 
        </listitem>
36
 
      </varlistentry>
37
 
      <varlistentry>
38
 
        <term>Y</term>
39
 
        <listitem>
40
 
          <para>
41
 
            a 3 by <literal>N</literal> array containing the ordinates of the vertices of the
42
 
            N triangles
43
 
          </para>
44
 
        </listitem>
45
 
      </varlistentry>
46
 
      <varlistentry>
47
 
        <term>f</term>
48
 
        <listitem>
49
 
          <para>external (function or list or string) defining the integrand
50
 
            <literal>f(u,v)</literal>
51
 
          </para>
52
 
        </listitem>
53
 
      </varlistentry>
54
 
      <varlistentry>
55
 
        <term>params</term>
56
 
        <listitem>
57
 
          <para>
58
 
            a real vector <literal>[tol, iclose, maxtri, mevals, iflag]</literal>.
59
 
            The default value is <literal>[1.d-10, 1, 50, 4000, 1]</literal>.
60
 
          </para>
61
 
          <variablelist>
62
 
            <varlistentry>
63
 
              <term>tol</term>
64
 
              <listitem>
65
 
                <para>the desired bound on the error. If
66
 
                  <literal>iflag=0</literal>, <literal>tol</literal> is
67
 
                  interpreted as a bound on the relative error; if
68
 
                  <literal>iflag=1</literal>, the bound is on the absolute
69
 
                  error.
70
 
                </para>
71
 
              </listitem>
72
 
            </varlistentry>
73
 
            <varlistentry>
74
 
              <term>iclose</term>
75
 
              <listitem>
76
 
                <para>an integer parameter that determines the selection of
77
 
                  LQM0 or LQM1 methods. If <literal>iclose=1</literal> then LQM1
78
 
                  is used. Any other value of <literal>iclose</literal> causes
79
 
                  LQM0 to be used. LQM0 uses function values only at interior
80
 
                  points of the triangle. LQM1 is usually more accurate than
81
 
                  LQM0 but involves evaluating the integrand at more points
82
 
                  including some on the boundary of the triangle. It will
83
 
                  usually be better to use LQM1 unless the integrand has
84
 
                  singularities on the boundary of the triangle.
85
 
                </para>
86
 
              </listitem>
87
 
            </varlistentry>
88
 
            <varlistentry>
89
 
              <term>maxtri</term>
90
 
              <listitem>
91
 
                <para>the maximum number of triangles in the final
92
 
                  triangulation of the region
93
 
                </para>
94
 
              </listitem>
95
 
            </varlistentry>
96
 
            <varlistentry>
97
 
              <term>mevals</term>
98
 
              <listitem>
99
 
                <para>the maximum number of function evaluations to be
100
 
                  allowed. This number will be effective in limiting the
101
 
                  computation only if it is less than
102
 
                  94*<literal>maxtri</literal> when LQM1 is specified or
103
 
                  56*<literal>maxtri</literal> when LQM0 is specified.
104
 
                </para>
105
 
              </listitem>
106
 
            </varlistentry>
107
 
            <varlistentry>
108
 
              <term>iflag</term>
109
 
              <listitem>
110
 
                <para>
111
 
                  if <literal>iflag=0</literal>, <literal>tol</literal> is
112
 
                  interpreted as a bound on the relative error; if <literal>iflag=1</literal>, 
113
 
                  the bound is on the absolute error.
114
 
                </para>
115
 
              </listitem>
116
 
            </varlistentry>
117
 
          </variablelist>
118
 
        </listitem>
119
 
      </varlistentry>
120
 
      <varlistentry>
121
 
        <term>I</term>
122
 
        <listitem>
123
 
          <para>the integral value</para>
124
 
        </listitem>
125
 
      </varlistentry>
126
 
      <varlistentry>
127
 
        <term>err</term>
128
 
        <listitem>
129
 
          <para>the estimated error</para>
130
 
        </listitem>
131
 
      </varlistentry>
132
 
    </variablelist>
133
 
  </refsection>
134
 
  <refsection>
135
 
    <title>Description</title>
136
 
    <para>
137
 
      <literal>int2d</literal> computes the two-dimensional integral of a
138
 
      function <literal>f</literal> over a region consisting of
139
 
      <literal>n</literal> triangles. A total error estimate is obtained and
140
 
      compared with a tolerance - <literal>tol</literal> - that is provided as
141
 
      input to the subroutine. The error tolerance is treated as either relative
142
 
      or absolute depending on the input value of <literal>iflag</literal>. A
143
 
      'Local Quadrature Module' is applied to each input triangle and estimates
144
 
      of the total integral and the total error are computed. The local
145
 
      quadrature module is either subroutine LQM0 or subroutine LQM1 and the
146
 
      choice between them is determined by the value of the input variable
147
 
      <literal>iclose</literal>.
148
 
    </para>
149
 
    <para>If the total error estimate exceeds the tolerance, the triangle with
150
 
      the largest absolute error is divided into two triangles by a median to
151
 
      its longest side. The local quadrature module is then applied to each of
152
 
      the subtriangles to obtain new estimates of the integral and the error.
153
 
      This process is repeated until either (1) the error tolerance is
154
 
      satisfied, (2) the number of triangles generated exceeds the input
155
 
      parameter <literal>maxtri</literal>, (3) the number of integrand
156
 
      evaluations exceeds the input parameter <literal>mevals</literal>, or (4)
157
 
      the function senses that roundoff error is beginning to contaminate the
158
 
      result.
159
 
    </para>
160
 
  </refsection>
161
 
  <refsection>
162
 
    <title>Examples</title>
163
 
    <programlisting role="example"><![CDATA[ 
 
15
    <refnamediv>
 
16
        <refname>int2d</refname>
 
17
        <refpurpose>definite 2D integral by quadrature and cubature
 
18
            method
 
19
        </refpurpose>
 
20
    </refnamediv>
 
21
    <refsynopsisdiv>
 
22
        <title>Calling Sequence</title>
 
23
        <synopsis>[I,err]=int2d(X,Y,f [,params])</synopsis>
 
24
    </refsynopsisdiv>
 
25
    <refsection>
 
26
        <title>Arguments</title>
 
27
        <variablelist>
 
28
            <varlistentry>
 
29
                <term>X</term>
 
30
                <listitem>
 
31
                    <para>
 
32
                        a 3 by <literal>N</literal> array containing the abscissae of the vertices of the
 
33
                        N triangles
 
34
                    </para>
 
35
                </listitem>
 
36
            </varlistentry>
 
37
            <varlistentry>
 
38
                <term>Y</term>
 
39
                <listitem>
 
40
                    <para>
 
41
                        a 3 by <literal>N</literal> array containing the ordinates of the vertices of the
 
42
                        N triangles
 
43
                    </para>
 
44
                </listitem>
 
45
            </varlistentry>
 
46
            <varlistentry>
 
47
                <term>f</term>
 
48
                <listitem>
 
49
                    <para>external (function or list or string) defining the integrand
 
50
                        <literal>f(u,v)</literal>
 
51
                    </para>
 
52
                </listitem>
 
53
            </varlistentry>
 
54
            <varlistentry>
 
55
                <term>params</term>
 
56
                <listitem>
 
57
                    <para>
 
58
                        a real vector <literal>[tol, iclose, maxtri, mevals, iflag]</literal>.
 
59
                        The default value is <literal>[1.d-10, 1, 50, 4000, 1]</literal>.
 
60
                    </para>
 
61
                    <variablelist>
 
62
                        <varlistentry>
 
63
                            <term>tol</term>
 
64
                            <listitem>
 
65
                                <para>the desired bound on the error. If
 
66
                                    <literal>iflag=0</literal>, <literal>tol</literal> is
 
67
                                    interpreted as a bound on the relative error; if
 
68
                                    <literal>iflag=1</literal>, the bound is on the absolute
 
69
                                    error.
 
70
                                </para>
 
71
                            </listitem>
 
72
                        </varlistentry>
 
73
                        <varlistentry>
 
74
                            <term>iclose</term>
 
75
                            <listitem>
 
76
                                <para>an integer parameter that determines the selection of
 
77
                                    LQM0 or LQM1 methods. If <literal>iclose=1</literal> then LQM1
 
78
                                    is used. Any other value of <literal>iclose</literal> causes
 
79
                                    LQM0 to be used. LQM0 uses function values only at interior
 
80
                                    points of the triangle. LQM1 is usually more accurate than
 
81
                                    LQM0 but involves evaluating the integrand at more points
 
82
                                    including some on the boundary of the triangle. It will
 
83
                                    usually be better to use LQM1 unless the integrand has
 
84
                                    singularities on the boundary of the triangle.
 
85
                                </para>
 
86
                            </listitem>
 
87
                        </varlistentry>
 
88
                        <varlistentry>
 
89
                            <term>maxtri</term>
 
90
                            <listitem>
 
91
                                <para>the maximum number of triangles in the final
 
92
                                    triangulation of the region
 
93
                                </para>
 
94
                            </listitem>
 
95
                        </varlistentry>
 
96
                        <varlistentry>
 
97
                            <term>mevals</term>
 
98
                            <listitem>
 
99
                                <para>the maximum number of function evaluations to be
 
100
                                    allowed. This number will be effective in limiting the
 
101
                                    computation only if it is less than
 
102
                                    94*<literal>maxtri</literal> when LQM1 is specified or
 
103
                                    56*<literal>maxtri</literal> when LQM0 is specified.
 
104
                                </para>
 
105
                            </listitem>
 
106
                        </varlistentry>
 
107
                        <varlistentry>
 
108
                            <term>iflag</term>
 
109
                            <listitem>
 
110
                                <para>
 
111
                                    if <literal>iflag=0</literal>, <literal>tol</literal> is
 
112
                                    interpreted as a bound on the relative error; if <literal>iflag=1</literal>, 
 
113
                                    the bound is on the absolute error.
 
114
                                </para>
 
115
                            </listitem>
 
116
                        </varlistentry>
 
117
                    </variablelist>
 
118
                </listitem>
 
119
            </varlistentry>
 
120
            <varlistentry>
 
121
                <term>I</term>
 
122
                <listitem>
 
123
                    <para>the integral value</para>
 
124
                </listitem>
 
125
            </varlistentry>
 
126
            <varlistentry>
 
127
                <term>err</term>
 
128
                <listitem>
 
129
                    <para>the estimated error</para>
 
130
                </listitem>
 
131
            </varlistentry>
 
132
        </variablelist>
 
133
    </refsection>
 
134
    <refsection>
 
135
        <title>Description</title>
 
136
        <para>
 
137
            <literal>int2d</literal> computes the two-dimensional integral of a
 
138
            function <literal>f</literal> over a region consisting of
 
139
            <literal>n</literal> triangles. A total error estimate is obtained and
 
140
            compared with a tolerance - <literal>tol</literal> - that is provided as
 
141
            input to the subroutine. The error tolerance is treated as either relative
 
142
            or absolute depending on the input value of <literal>iflag</literal>. A
 
143
            'Local Quadrature Module' is applied to each input triangle and estimates
 
144
            of the total integral and the total error are computed. The local
 
145
            quadrature module is either subroutine LQM0 or subroutine LQM1 and the
 
146
            choice between them is determined by the value of the input variable
 
147
            <literal>iclose</literal>.
 
148
        </para>
 
149
        <para>If the total error estimate exceeds the tolerance, the triangle with
 
150
            the largest absolute error is divided into two triangles by a median to
 
151
            its longest side. The local quadrature module is then applied to each of
 
152
            the subtriangles to obtain new estimates of the integral and the error.
 
153
            This process is repeated until either (1) the error tolerance is
 
154
            satisfied, (2) the number of triangles generated exceeds the input
 
155
            parameter <literal>maxtri</literal>, (3) the number of integrand
 
156
            evaluations exceeds the input parameter <literal>mevals</literal>, or (4)
 
157
            the function senses that roundoff error is beginning to contaminate the
 
158
            result.
 
159
        </para>
 
160
    </refsection>
 
161
    <refsection>
 
162
        <title>Examples</title>
 
163
        <programlisting role="example"><![CDATA[ 
164
164
X=[0,0;1,1;1,0];
165
165
Y=[0,0;0,1;1,1];
166
166
deff('z=f(x,y)','z=cos(x+y)')
167
167
[I,e]=int2d(X,Y,f)
168
168
// computes the integrand over the square [0 1]x[0 1]
169
169
 ]]></programlisting>
170
 
  </refsection>
171
 
  <refsection role="see also">
172
 
    <title>See Also</title>
173
 
    <simplelist type="inline">
174
 
      <member>
175
 
        <link linkend="intc">intc</link>
176
 
      </member>
177
 
      <member>
178
 
        <link linkend="intl">intl</link>
179
 
      </member>
180
 
      <member>
181
 
        <link linkend="int3d">int3d</link>
182
 
      </member>
183
 
      <member>
184
 
        <link linkend="intg">intg</link>
185
 
      </member>
186
 
      <member>
187
 
        <link linkend="mesh">mesh</link>
188
 
      </member>
189
 
    </simplelist>
190
 
  </refsection>
 
170
    </refsection>
 
171
    <refsection role="see also">
 
172
        <title>See Also</title>
 
173
        <simplelist type="inline">
 
174
            <member>
 
175
                <link linkend="intc">intc</link>
 
176
            </member>
 
177
            <member>
 
178
                <link linkend="intl">intl</link>
 
179
            </member>
 
180
            <member>
 
181
                <link linkend="int3d">int3d</link>
 
182
            </member>
 
183
            <member>
 
184
                <link linkend="intg">intg</link>
 
185
            </member>
 
186
            <member>
 
187
                <link linkend="mesh">mesh</link>
 
188
            </member>
 
189
        </simplelist>
 
190
    </refsection>
191
191
</refentry>