summaryrefslogtreecommitdiff
path: root/modules/interpolation/help/ja_JP/interp2d.xml
blob: b3885cda8f1fcc9cc1594fd57cfedeb384a1fc34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
<?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="interp2d" xml:lang="ja">
    <refnamediv>
        <refname>interp2d</refname>
        <refpurpose>双3次スプライン (2d) 評価関数</refpurpose>
    </refnamediv>
    <refsynopsisdiv>
        <title>呼び出し手順</title>
        <synopsis>[zp[,dzpdx,dzpdy[,d2zpdxx,d2zpdxy,d2zpdyy]]]=interp2d(xp,yp,x,y,C [,out_mode])</synopsis>
    </refsynopsisdiv>
    <refsection>
        <title>引数</title>
        <variablelist>
            <varlistentry>
                <term>xp</term>
                <listitem>
                    <para>
                        doubleの mx行my列行列, スプラインを評価する点の<varname>x</varname>座標.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>yp</term>
                <listitem>
                    <para>
                        doubleの mx行my列行列, スプラインを評価する点の<varname>y</varname>座標.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>x</term>
                <listitem>
                    <para>
                        doubleの1行nx列行列, 補間点の<varname>x</varname>座標値.
                        i=1,2,...,nx-1について x(i)&lt;x(i+1)が必要.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>y</term>
                <listitem>
                    <para>
                        doubleの1行nx列行列, 補間点の<varname>y</varname>座標値.
                        i=1,2,...,nx-1について y(i)&lt;y(i+1)が必要.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>C</term>
                <listitem>
                    <para>
                        双3次スプラインの係数. interp2d関数の入力引数は
                        <link linkend="splin2d">splin2d</link>関数の出力引数です.                    
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>out_mode</term>
                <listitem>
                    <para>1行1列の文字列行列, 
                        [x(1),x(nx)]x[y(1),y(ny)]の外にある値の評価
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>zp</term>
                <listitem>
                    <para>
                        mx行my列のdouble行列, スプラインの<varname>z</varname>座標の評価値,
                        すなわち,i=1,2,...,mx および j = 1,2,...,my について,
                        zp(i,j)=s(xp(i,j),yp(i,j))
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>dzpdx</term>
                <listitem>
                    <para>
                        mx行my列のdouble行列, スプラインの<varname>x</varname>に関する1階微分.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>dzpdy</term>
                <listitem>
                    <para>
                        mx行my列のdouble行列, スプラインの<varname>y</varname>に関する1階微分.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>d2zpdxx</term>
                <listitem>
                    <para>
                        mx行my列のdouble行列, スプラインの<varname>x</varname>に関する2階微分.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>d2zpdxy</term>
                <listitem>
                    <para>
                        mx行my列のdouble行列, スプラインの<varname>x</varname>と<varname>y</varname>に関する2階微分.
                    </para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>d2zpdyy</term>
                <listitem>
                    <para>
                        mx行my列のdouble行列, スプラインの<varname>y</varname>に関する2階微分.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>説明</title>
        <para>
            双3次スプラインまたはサブスプライン関数を定義する
            3つのベクトル <literal>(x,y,C)</literal> 
            (<link linkend="splin2d">splin2d</link>参照)を指定すると,
            この関数は, 次のように<emphasis>(xp(i),yp(i))</emphasis>における
            <emphasis>s</emphasis> (要すれば <emphasis>ds/dx,
                ds/dy, d2s/dxx, d2s/dxy, d2s/dyy
            </emphasis>
            も)を評価します:
        </para>
        <informalequation>
            <mediaobject>
                <imageobject>
                    <imagedata fileref="../mml/interp2_equation_1.mml"/>
                </imageobject>
            </mediaobject>
        </informalequation>
        <para>
            <literal>out_mode</literal> パラメータは,
            捕外,すなわち<emphasis>(xp(i),yp(i))</emphasis>が
            [x(1),x(nx)]x[y(1),y(ny)]にない場合,
            の計算手法を定義します:
        </para>
        <variablelist>
            <varlistentry>
                <term>"by_zero"</term>
                <listitem>
                    <para>ゼロによる捕外が行われます</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>"by_nan"</term>
                <listitem>
                    <para>Nanによる捕外</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>"C0"</term>
                <listitem>
                    <para>捕外は以下のように定義されます :</para>
                    <programlisting role=""><![CDATA[ 
s(x,y) = s(proj(x,y)) where proj(x,y) is nearest point 
                      of [x(1),x(nx)]x[y(1),y(ny)] from (x,y)
 ]]></programlisting>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>"natural"</term>
                <listitem>
                    <para>捕外は(x,y)から最も近い双三次パッチにより行われます.</para>
                </listitem>
            </varlistentry>
            <varlistentry>
                <term>"periodic"</term>
                <listitem>
                    <para>
                        <literal>s</literal> は周期的に拡張されます.
                    </para>
                </listitem>
            </varlistentry>
        </variablelist>
    </refsection>
    <refsection>
        <title>例</title>
        <programlisting role="example"><![CDATA[
n = 7;  // a n x n interpolation grid
x = linspace(0,2*%pi,n); y = x;
z = cos(x')*cos(y);
C = splin2d(x, y, z, "periodic");
// now evaluate on a bigger domain than [0,2pi]x [0,2pi]
m = 80; // discretization parameter of the evaluation grid
xx = linspace(-0.5*%pi,2.5*%pi,m); yy = xx;
[XX,YY] = ndgrid(xx,yy);
zz1 = interp2d(XX,YY, x, y, C, "C0");
plot3d(xx, yy, zz1, flag=[2 6 4])
xtitle("extrapolation with the C0 outmode")
 ]]></programlisting>
        <scilab:image>
            n = 7;  // a n x n interpolation grid
            x = linspace(0,2*%pi,n); y = x;
            z = cos(x')*cos(y);
            C = splin2d(x, y, z, "periodic");
            // now evaluate on a bigger domain than [0,2pi]x [0,2pi]
            m = 80; // discretization parameter of the evaluation grid
            xx = linspace(-0.5*%pi,2.5*%pi,m); yy = xx;
            [XX,YY] = ndgrid(xx,yy);
            zz1 = interp2d(XX,YY, x, y, C, "C0");
            plot3d(xx, yy, zz1, flag=[2 6 4])
            xtitle("extrapolation with the C0 outmode")
        </scilab:image>
        <programlisting role="example"><![CDATA[
n = 7;  // a n x n interpolation grid
x = linspace(0,2*%pi,n); y = x;
z = cos(x')*cos(y);
C = splin2d(x, y, z, "periodic");
// now evaluate on a bigger domain than [0,2pi]x [0,
m = 80; // discretization parameter of the evaluation grid
xx = linspace(-0.5*%pi,2.5*%pi,m); yy = xx;
[XX,YY] = ndgrid(xx,yy);
zz2 = interp2d(XX,YY, x, y, C, "by_zero");
plot3d(xx, yy, zz2, flag=[2 6 4])
xtitle("extrapolation with the by_zero outmode")
 ]]></programlisting>
        <scilab:image>
            n = 7;  // a n x n interpolation grid
            x = linspace(0,2*%pi,n); y = x;
            z = cos(x')*cos(y);
            C = splin2d(x, y, z, "periodic");
            // now evaluate on a bigger domain than [0,2pi]x [0,2pi]
            m = 80; // discretization parameter of the evaluation grid
            xx = linspace(-0.5*%pi,2.5*%pi,m); yy = xx;
            [XX,YY] = ndgrid(xx,yy);
            zz2 = interp2d(XX,YY, x, y, C, "by_zero");
            plot3d(xx, yy, zz2, flag=[2 6 4])
            xtitle("extrapolation with the by_zero outmode")
        </scilab:image>
        <programlisting role="example"><![CDATA[
n = 7;  // a n x n interpolation grid
x = linspace(0,2*%pi,n); y = x;
z = cos(x')*cos(y);
C = splin2d(x, y, z, "periodic");
// now evaluate on a bigger domain than [0,2pi]x [0,2pi]
m = 80; // discretization parameter of the evaluation grid
xx = linspace(-0.5*%pi,2.5*%pi,m); yy = xx;
[XX,YY] = ndgrid(xx,yy);
zz3 = interp2d(XX,YY, x, y, C, "periodic");
plot3d(xx, yy, zz3, flag=[2 6 4])
xtitle("extrapolation with the periodic outmode")
 ]]></programlisting>
        <scilab:image>
            n = 7;  // a n x n interpolation grid
            x = linspace(0,2*%pi,n); y = x;
            z = cos(x')*cos(y);
            C = splin2d(x, y, z, "periodic");
            // now evaluate on a bigger domain than [0,2pi]x [0,2pi]
            m = 80; // discretization parameter of the evaluation grid
            xx = linspace(-0.5*%pi,2.5*%pi,m); yy = xx;
            [XX,YY] = ndgrid(xx,yy);
            zz3 = interp2d(XX,YY, x, y, C, "periodic");
            plot3d(xx, yy, zz3, flag=[2 6 4])
            xtitle("extrapolation with the periodic outmode")
        </scilab:image>
        <programlisting role="example"><![CDATA[
n = 7;  // a n x n interpolation grid
x = linspace(0,2*%pi,n); y = x;
z = cos(x')*cos(y);
C = splin2d(x, y, z, "periodic");
// now evaluate on a bigger domain than [0,2pi]x [0,2pi]
m = 80; // discretization parameter of the evaluation grid
xx = linspace(-0.5*%pi,2.5*%pi,m); yy = xx;
[XX,YY] = ndgrid(xx,yy);
zz4 = interp2d(XX,YY, x, y, C, "natural");
plot3d(xx, yy, zz4, flag=[2 6 4])
xtitle("extrapolation with the natural outmode")
 ]]></programlisting>
        <scilab:image>
            n = 7;  // a n x n interpolation grid
            x = linspace(0,2*%pi,n); y = x;
            z = cos(x')*cos(y);
            C = splin2d(x, y, z, "periodic");
            // now evaluate on a bigger domain than [0,2pi]x [0,2pi]
            m = 80; // discretization parameter of the evaluation grid
            xx = linspace(-0.5*%pi,2.5*%pi,m); yy = xx;
            [XX,YY] = ndgrid(xx,yy);
            zz4 = interp2d(XX,YY, x, y, C, "natural");
            plot3d(xx, yy, zz4, flag=[2 6 4])
            xtitle("extrapolation with the natural outmode")
        </scilab:image>
    </refsection>
    <refsection role="see also">
        <title>参照</title>
        <simplelist type="inline">
            <member>
                <link linkend="splin2d">splin2d</link>
            </member>
        </simplelist>
    </refsection>
    <refsection>
        <title>履歴</title>
        <revhistory>
            <revision>
                <revnumber>5.4.0</revnumber>
                <revremark>以前では, 入力引数の虚部は暗黙のうちに無視されていました.</revremark>
            </revision>
        </revhistory>
    </refsection>
</refentry>