Examples cleanup
[maxima.git] / doc / info / ja / diag.texi
blobe4a39b588e6de7e2017febb95756719b909d806a
1 @menu
2 * Functions and Variables for diag::
3 @end menu
5 @node Functions and Variables for diag,  , diag, diag
6 @section Functions and Variables for diag
9 @deffn {関数} diag (@var{lm})
10 @var{lm}の行列を対角に持つ平方行列を構成します。
11 @var{lm}は行列かスカラーのリストです。
13 例:
14 @example
15 (%i1) load("diag")$
17 (%i2) a1:matrix([1,2,3],[0,4,5],[0,0,6])$
19 (%i3) a2:matrix([1,1],[1,0])$
21 (%i4) diag([a1,x,a2]);
22                    [ 1  2  3  0  0  0 ]
23                    [                  ]
24                    [ 0  4  5  0  0  0 ]
25                    [                  ]
26                    [ 0  0  6  0  0  0 ]
27 (%o4)              [                  ]
28                    [ 0  0  0  x  0  0 ]
29                    [                  ]
30                    [ 0  0  0  0  1  1 ]
31                    [                  ]
32                    [ 0  0  0  0  1  0 ]
33 @end example
35 この関数を使うためには、最初に@code{load("diag")}を書いてください。
37 @opencatbox
38 @category{Matrices} @category{Share packages} @category{Package diag}
39 @closecatbox
41 @end deffn
44 @deffn {関数} JF (@var{lambda},@var{n})
45 固有値@var{lambda}を持つ次数@var{n}のJordan細胞を返します。
47 例:
48 @example
49 (%i1) load("diag")$
51 (%i2) JF(2,5);
52                     [ 2  1  0  0  0 ]
53                     [               ]
54                     [ 0  2  1  0  0 ]
55                     [               ]
56 (%o2)               [ 0  0  2  1  0 ]
57                     [               ]
58                     [ 0  0  0  2  1 ]
59                     [               ]
60                     [ 0  0  0  0  2 ]
61 (%i3) JF(3,2);
62                          [ 3  1 ]
63 (%o3)                    [      ]
64                          [ 0  3 ]
65 @end example
67 この関数を使うためには、最初に@code{load("diag")}を書いてください。
69 @opencatbox
70 @category{Package diag}
71 @closecatbox
73 @end deffn
76 @deffn {関数} jordan (@var{mat})
77 行列@var{mat}のJordan形を返しますが、それはMaximaリストでコード化されます。
78 対応する行列を得るには、
79 @code{jordan}の出力を引数として使って関数@code{dispJordan}をコールしてください。
81 例:
82 @example
83 (%i1) load("diag")$
85 (%i3) a:matrix([2,0,0,0,0,0,0,0],
86                [1,2,0,0,0,0,0,0],
87                [-4,1,2,0,0,0,0,0],
88                [2,0,0,2,0,0,0,0],
89                [-7,2,0,0,2,0,0,0],
90                [9,0,-2,0,1,2,0,0],
91                [-34,7,1,-2,-1,1,2,0],
92                [145,-17,-16,3,9,-2,0,3])$
94 (%i34) jordan(a);
95 (%o4)             [[2, 3, 3, 1], [3, 1]]
96 (%i5) dispJordan(%);
97                 [ 2  1  0  0  0  0  0  0 ]
98                 [                        ]
99                 [ 0  2  1  0  0  0  0  0 ]
100                 [                        ]
101                 [ 0  0  2  0  0  0  0  0 ]
102                 [                        ]
103                 [ 0  0  0  2  1  0  0  0 ]
104 (%o5)           [                        ]
105                 [ 0  0  0  0  2  1  0  0 ]
106                 [                        ]
107                 [ 0  0  0  0  0  2  0  0 ]
108                 [                        ]
109                 [ 0  0  0  0  0  0  2  0 ]
110                 [                        ]
111                 [ 0  0  0  0  0  0  0  3 ]
112 @end example
114 この関数を使うためには、最初に@code{load("diag")}を書いてください。
115 @code{dispJordan}と@code{minimalPoly}も参照してください。
117 @opencatbox
118 @category{Package diag}
119 @closecatbox
121 @end deffn
124 @deffn {関数} dispJordan (@var{l})
125 関数@code{jordan}によって与えられる出力である
126 Maximaリスト@var{l}で与えられたコードに関連付けられた
127 Jordan行列を返します。
129 例:
130 @example
131 (%i1) load("diag")$
133 (%i2) b1:matrix([0,0,1,1,1],
134                 [0,0,0,1,1],
135                 [0,0,0,0,1],
136                 [0,0,0,0,0],
137                 [0,0,0,0,0])$
139 (%i3) jordan(b1);
140 (%o3)                  [[0, 3, 2]]
141 (%i4) dispJordan(%);
142                     [ 0  1  0  0  0 ]
143                     [               ]
144                     [ 0  0  1  0  0 ]
145                     [               ]
146 (%o4)               [ 0  0  0  0  0 ]
147                     [               ]
148                     [ 0  0  0  0  1 ]
149                     [               ]
150                     [ 0  0  0  0  0 ]
151 @end example
153 この関数を使うためには、最初に@code{load("diag")}を書いてください。
154 @code{jordan}と@code{minimalPoly}も参照してください。
156 @opencatbox
157 @category{Package diag}
158 @closecatbox
160 @end deffn
163 @deffn {関数} minimalPoly (@var{l})
164 関数@code{jordan}によって与えられる出力である
165 Maximaリスト@var{l}で与えられたコードに関連付けられた
166 最小多項式を返します。
168 例:
169 @example
170 (%i1) load("diag")$
172 (%i2) a:matrix([2,1,2,0],
173                [-2,2,1,2],
174                [-2,-1,-1,1],
175                [3,1,2,-1])$
177 (%i3) jordan(a);
178 (%o3)               [[- 1, 1], [1, 3]]
179 (%i4) minimalPoly(%);
180                             3
181 (%o4)                (x - 1)  (x + 1)
182 @end example
184 この関数を使うためには、最初に@code{load("diag")}を書いてください。
185 @code{jordan}と@code{dispJordan}も参照してください。
187 @opencatbox
188 @category{Package diag}
189 @closecatbox
191 @end deffn
193 @deffn {関数} ModeMatrix (@var{A},@var{l})
194 Returns the matrix 
195 @math{(M^^-1).A.M=J}―
196 ただし@var{J}は@var{A}のJordan形とする―
197 のような
198 行列@var{M}を返します。
199 Maximaリスト@var{l}は
200 関数@code{jordan}が返すようなJordan形のコード化された形式です。
202 例:
203 @example
204 (%i1) load("diag")$
206 (%i2) a:matrix([2,1,2,0],
207           [-2,2,1,2],
208           [-2,-1,-1,1],
209           [3,1,2,-1])$
211 (%i3) jordan(a);
212 (%o3)               [[- 1, 1], [1, 3]]
213 (%i4) M: ModeMatrix(a,%);
214                   [  1    - 1   1   1 ]
215                   [                   ]
216                   [   1               ]
217                   [ - -   - 1   0   0 ]
218                   [   9               ]
219                   [                   ]
220 (%o4)             [   13              ]
221                   [ - --   1   - 1  0 ]
222                   [   9               ]
223                   [                   ]
224                   [  17               ]
225                   [  --   - 1   1   1 ]
226                   [  9                ]
227 (%i5) is(  (M^^-1).a.M = dispJordan(%o3)  );
228 (%o5)                      true
229 @end example
230 @code{dispJordan(%o3)}は
231 行列@code{a}のJordan形であることに注意してください。
233 この関数を使うためには、最初に@code{load("diag")}を書いてください。
234 @code{jordan}と@code{dispJordan}も参照してください。
236 @opencatbox
237 @category{Package diag}
238 @closecatbox
240 @end deffn
243 @deffn {関数} mat_function (@var{f},@var{mat})
244 @math{f(mat)}を返します。
245 ここで、@var{f}は解析関数で@var{mat}は行列です。
246 この計算はCauchyの積分公式に基づきます。
247 積分公式は、
248 もし@code{f(x)}が解析的、かつ、
250 @example
251 mat = diag([JF(m1,n1),...,JF(mk,nk)]),
252 @end example
254 なら、
256 @example
257 f(mat) = ModeMatrix*diag([f(JF(m1,n1)), ..., f(JF(mk,nk))])
258                                               *ModeMatrix^^(-1)
259 @end example
261 をはっきり述べます。
263 この計算に関して約6か8の別の方法があることに注意してください。
265 いくつかの例が続きます。
267 例 1:
268 @example
269 (%i1) load("diag")$
271 (%i2) b2:matrix([0,1,0], [0,0,1], [-1,-3,-3])$
273 (%i3) mat_function(exp,t*b2);
274                2   - t
275               t  %e          - t     - t
276 (%o3) matrix([-------- + t %e    + %e   ,
277                  2
278         - t     - t                           - t
279  2    %e      %e        - t           - t   %e
280 t  (- ----- - ----- + %e   ) + t (2 %e    - -----)
281         t       2                             t
282                t
283                          - t          - t     - t
284        - t       - t   %e        2  %e      %e
285  + 2 %e   , t (%e    - -----) + t  (----- - -----)
286                          t            2       t
287                2   - t            - t     - t
288      - t      t  %e        2    %e      %e        - t
289  + %e   ], [- --------, - t  (- ----- - ----- + %e   ),
290                  2                t       2
291                                          t
292         - t     - t      2   - t
293    2  %e      %e        t  %e          - t
294 - t  (----- - -----)], [-------- - t %e   ,
295         2       t          2
296         - t     - t                           - t
297  2    %e      %e        - t           - t   %e
298 t  (- ----- - ----- + %e   ) - t (2 %e    - -----),
299         t       2                             t
300                t
301       - t     - t                 - t
302  2  %e      %e            - t   %e
303 t  (----- - -----) - t (%e    - -----)])
304       2       t                   t
305 (%i4) ratsimp(%);
306                [   2              - t ]
307                [ (t  + 2 t + 2) %e    ]
308                [ -------------------- ]
309                [          2           ]
310                [                      ]
311                [         2   - t      ]
312 (%o4)  Col 1 = [        t  %e         ]
313                [      - --------      ]
314                [           2          ]
315                [                      ]
316                [     2          - t   ]
317                [   (t  - 2 t) %e      ]
318                [   ----------------   ]
319                [          2           ]
320          [      2        - t    ]
321          [    (t  + t) %e       ]
322          [                      ]
323  Col 2 = [     2            - t ]
324          [ - (t  - t - 1) %e    ]
325          [                      ]
326          [     2          - t   ]
327          [   (t  - 3 t) %e      ]
328          [        2   - t       ]
329          [       t  %e          ]
330          [       --------       ]
331          [          2           ]
332          [                      ]
333          [      2          - t  ]
334  Col 3 = [    (t  - 2 t) %e     ]
335          [  - ----------------  ]
336          [           2          ]
337          [                      ]
338          [   2              - t ]
339          [ (t  - 4 t + 2) %e    ]
340          [ -------------------- ]
341          [          2           ]
343 @end example
346 例 2:
347 @example
348 (%i5) b1:matrix([0,0,1,1,1],
349                 [0,0,0,1,1],
350                 [0,0,0,0,1],
351                 [0,0,0,0,0],
352                 [0,0,0,0,0])$
354 (%i6) mat_function(exp,t*b1);
355                   [              2     ]
356                   [             t      ]
357                   [ 1  0  t  t  -- + t ]
358                   [             2      ]
359                   [                    ]
360 (%o6)             [ 0  1  0  t    t    ]
361                   [                    ]
362                   [ 0  0  1  0    t    ]
363                   [                    ]
364                   [ 0  0  0  1    0    ]
365                   [                    ]
366                   [ 0  0  0  0    1    ]
367 (%i7) minimalPoly(jordan(b1));
368                              3
369 (%o7)                       x
370 (%i8) ident(5)+t*b1+1/2*(t^2)*b1^^2;
371                   [              2     ]
372                   [             t      ]
373                   [ 1  0  t  t  -- + t ]
374                   [             2      ]
375                   [                    ]
376 (%o8)             [ 0  1  0  t    t    ]
377                   [                    ]
378                   [ 0  0  1  0    t    ]
379                   [                    ]
380                   [ 0  0  0  1    0    ]
381                   [                    ]
382                   [ 0  0  0  0    1    ]
383 (%i9) mat_function(exp,%i*t*b1);
384              [                           2 ]
385              [                          t  ]
386              [ 1  0  %i t  %i t  %i t - -- ]
387              [                          2  ]
388              [                             ]
389 (%o9)        [ 0  1   0    %i t    %i t    ]
390              [                             ]
391              [ 0  0   1     0      %i t    ]
392              [                             ]
393              [ 0  0   0     1        0     ]
394              [                             ]
395              [ 0  0   0     0        1     ]
396 (%i10) mat_function(cos,t*b1)+%i*mat_function(sin,t*b1);
397               [                           2 ]
398               [                          t  ]
399               [ 1  0  %i t  %i t  %i t - -- ]
400               [                          2  ]
401               [                             ]
402 (%o10)        [ 0  1   0    %i t    %i t    ]
403               [                             ]
404               [ 0  0   1     0      %i t    ]
405               [                             ]
406               [ 0  0   0     1        0     ]
407               [                             ]
408               [ 0  0   0     0        1     ]
409 @end example
411 例 3:
412 @example
413 (%i11) a1:matrix([2,1,0,0,0,0],
414                  [-1,4,0,0,0,0],
415                  [-1,1,2,1,0,0],
416                  [-1,1,-1,4,0,0],
417                  [-1,1,-1,1,3,0],
418                  [-1,1,-1,1,1,2])$
420 (%i12) fpow(x):=block([k],declare(k,integer),x^k)$
422 (%i13) mat_function(fpow,a1);
423                 [  k      k - 1 ]         [      k - 1    ]
424                 [ 3  - k 3      ]         [   k 3         ]
425                 [               ]         [               ]
426                 [       k - 1   ]         [  k      k - 1 ]
427                 [  - k 3        ]         [ 3  + k 3      ]
428                 [               ]         [               ]
429                 [       k - 1   ]         [      k - 1    ]
430                 [  - k 3        ]         [   k 3         ]
431 (%o13)  Col 1 = [               ] Col 2 = [               ]
432                 [       k - 1   ]         [      k - 1    ]
433                 [  - k 3        ]         [   k 3         ]
434                 [               ]         [               ]
435                 [       k - 1   ]         [      k - 1    ]
436                 [  - k 3        ]         [   k 3         ]
437                 [               ]         [               ]
438                 [       k - 1   ]         [      k - 1    ]
439                 [  - k 3        ]         [   k 3         ]
440          [       0       ]         [       0       ]
441          [               ]         [               ]
442          [       0       ]         [       0       ]
443          [               ]         [               ]
444          [  k      k - 1 ]         [      k - 1    ]
445          [ 3  - k 3      ]         [   k 3         ]
446          [               ]         [               ]
447  Col 3 = [       k - 1   ] Col 4 = [  k      k - 1 ]
448          [  - k 3        ]         [ 3  + k 3      ]
449          [               ]         [               ]
450          [       k - 1   ]         [      k - 1    ]
451          [  - k 3        ]         [   k 3         ]
452          [               ]         [               ]
453          [       k - 1   ]         [      k - 1    ]
454          [  - k 3        ]         [   k 3         ]
455          [    0    ]
456          [         ]         [ 0  ]
457          [    0    ]         [    ]
458          [         ]         [ 0  ]
459          [    0    ]         [    ]
460          [         ]         [ 0  ]
461  Col 5 = [    0    ] Col 6 = [    ]
462          [         ]         [ 0  ]
463          [    k    ]         [    ]
464          [   3     ]         [ 0  ]
465          [         ]         [    ]
466          [  k    k ]         [  k ]
467          [ 3  - 2  ]         [ 2  ]
468 @end example
470 この関数を使うためには、最初に@code{load("diag")}を書いてください。
472 @opencatbox
473 @category{Package diag}
474 @closecatbox
476 @end deffn