In MARK+3 (src/db.lisp), quiet warning from SBCL about "Derived type conflicting...
[maxima.git] / doc / info / ja / diag.texi
blobc986297ed4af8cf5c3d53ad19061239dfeddc9e2
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}
39 @category{Share packages}
40 @category{Package diag}
41 @closecatbox
43 @end deffn
46 @deffn {関数} JF (@var{lambda},@var{n})
47 固有値@var{lambda}を持つ次数@var{n}のJordan細胞を返します。
49 例:
50 @example
51 (%i1) load("diag")$
53 (%i2) JF(2,5);
54                     [ 2  1  0  0  0 ]
55                     [               ]
56                     [ 0  2  1  0  0 ]
57                     [               ]
58 (%o2)               [ 0  0  2  1  0 ]
59                     [               ]
60                     [ 0  0  0  2  1 ]
61                     [               ]
62                     [ 0  0  0  0  2 ]
63 (%i3) JF(3,2);
64                          [ 3  1 ]
65 (%o3)                    [      ]
66                          [ 0  3 ]
67 @end example
69 この関数を使うためには、最初に@code{load("diag")}を書いてください。
71 @opencatbox
72 @category{Package diag}
73 @closecatbox
75 @end deffn
78 @deffn {関数} jordan (@var{mat})
79 行列@var{mat}のJordan形を返しますが、それはMaximaリストでコード化されます。
80 対応する行列を得るには、
81 @code{jordan}の出力を引数として使って関数@code{dispJordan}をコールしてください。
83 例:
84 @example
85 (%i1) load("diag")$
87 (%i3) a:matrix([2,0,0,0,0,0,0,0],
88                [1,2,0,0,0,0,0,0],
89                [-4,1,2,0,0,0,0,0],
90                [2,0,0,2,0,0,0,0],
91                [-7,2,0,0,2,0,0,0],
92                [9,0,-2,0,1,2,0,0],
93                [-34,7,1,-2,-1,1,2,0],
94                [145,-17,-16,3,9,-2,0,3])$
96 (%i34) jordan(a);
97 (%o4)             [[2, 3, 3, 1], [3, 1]]
98 (%i5) dispJordan(%);
99                 [ 2  1  0  0  0  0  0  0 ]
100                 [                        ]
101                 [ 0  2  1  0  0  0  0  0 ]
102                 [                        ]
103                 [ 0  0  2  0  0  0  0  0 ]
104                 [                        ]
105                 [ 0  0  0  2  1  0  0  0 ]
106 (%o5)           [                        ]
107                 [ 0  0  0  0  2  1  0  0 ]
108                 [                        ]
109                 [ 0  0  0  0  0  2  0  0 ]
110                 [                        ]
111                 [ 0  0  0  0  0  0  2  0 ]
112                 [                        ]
113                 [ 0  0  0  0  0  0  0  3 ]
114 @end example
116 この関数を使うためには、最初に@code{load("diag")}を書いてください。
117 @code{dispJordan}と@code{minimalPoly}も参照してください。
119 @opencatbox
120 @category{Package diag}
121 @closecatbox
123 @end deffn
126 @deffn {関数} dispJordan (@var{l})
127 関数@code{jordan}によって与えられる出力である
128 Maximaリスト@var{l}で与えられたコードに関連付けられた
129 Jordan行列を返します。
131 例:
132 @example
133 (%i1) load("diag")$
135 (%i2) b1:matrix([0,0,1,1,1],
136                 [0,0,0,1,1],
137                 [0,0,0,0,1],
138                 [0,0,0,0,0],
139                 [0,0,0,0,0])$
141 (%i3) jordan(b1);
142 (%o3)                  [[0, 3, 2]]
143 (%i4) dispJordan(%);
144                     [ 0  1  0  0  0 ]
145                     [               ]
146                     [ 0  0  1  0  0 ]
147                     [               ]
148 (%o4)               [ 0  0  0  0  0 ]
149                     [               ]
150                     [ 0  0  0  0  1 ]
151                     [               ]
152                     [ 0  0  0  0  0 ]
153 @end example
155 この関数を使うためには、最初に@code{load("diag")}を書いてください。
156 @code{jordan}と@code{minimalPoly}も参照してください。
158 @opencatbox
159 @category{Package diag}
160 @closecatbox
162 @end deffn
165 @deffn {関数} minimalPoly (@var{l})
166 関数@code{jordan}によって与えられる出力である
167 Maximaリスト@var{l}で与えられたコードに関連付けられた
168 最小多項式を返します。
170 例:
171 @example
172 (%i1) load("diag")$
174 (%i2) a:matrix([2,1,2,0],
175                [-2,2,1,2],
176                [-2,-1,-1,1],
177                [3,1,2,-1])$
179 (%i3) jordan(a);
180 (%o3)               [[- 1, 1], [1, 3]]
181 (%i4) minimalPoly(%);
182                             3
183 (%o4)                (x - 1)  (x + 1)
184 @end example
186 この関数を使うためには、最初に@code{load("diag")}を書いてください。
187 @code{jordan}と@code{dispJordan}も参照してください。
189 @opencatbox
190 @category{Package diag}
191 @closecatbox
193 @end deffn
195 @deffn {関数} ModeMatrix (@var{A},@var{l})
196 Returns the matrix 
197 @math{(M^^-1).A.M=J}―
198 ただし@var{J}は@var{A}のJordan形とする―
199 のような
200 行列@var{M}を返します。
201 Maximaリスト@var{l}は
202 関数@code{jordan}が返すようなJordan形のコード化された形式です。
204 例:
205 @example
206 (%i1) load("diag")$
208 (%i2) a:matrix([2,1,2,0],
209           [-2,2,1,2],
210           [-2,-1,-1,1],
211           [3,1,2,-1])$
213 (%i3) jordan(a);
214 (%o3)               [[- 1, 1], [1, 3]]
215 (%i4) M: ModeMatrix(a,%);
216                   [  1    - 1   1   1 ]
217                   [                   ]
218                   [   1               ]
219                   [ - -   - 1   0   0 ]
220                   [   9               ]
221                   [                   ]
222 (%o4)             [   13              ]
223                   [ - --   1   - 1  0 ]
224                   [   9               ]
225                   [                   ]
226                   [  17               ]
227                   [  --   - 1   1   1 ]
228                   [  9                ]
229 (%i5) is(  (M^^-1).a.M = dispJordan(%o3)  );
230 (%o5)                      true
231 @end example
232 @code{dispJordan(%o3)}は
233 行列@code{a}のJordan形であることに注意してください。
235 この関数を使うためには、最初に@code{load("diag")}を書いてください。
236 @code{jordan}と@code{dispJordan}も参照してください。
238 @opencatbox
239 @category{Package diag}
240 @closecatbox
242 @end deffn
245 @deffn {関数} mat_function (@var{f},@var{mat})
246 @math{f(mat)}を返します。
247 ここで、@var{f}は解析関数で@var{mat}は行列です。
248 この計算はCauchyの積分公式に基づきます。
249 積分公式は、
250 もし@code{f(x)}が解析的、かつ、
252 @example
253 mat = diag([JF(m1,n1),...,JF(mk,nk)]),
254 @end example
256 なら、
258 @example
259 f(mat) = ModeMatrix*diag([f(JF(m1,n1)), ..., f(JF(mk,nk))])
260                                               *ModeMatrix^^(-1)
261 @end example
263 をはっきり述べます。
265 この計算に関して約6か8の別の方法があることに注意してください。
267 いくつかの例が続きます。
269 例 1:
270 @example
271 (%i1) load("diag")$
273 (%i2) b2:matrix([0,1,0], [0,0,1], [-1,-3,-3])$
275 (%i3) mat_function(exp,t*b2);
276                2   - t
277               t  %e          - t     - t
278 (%o3) matrix([-------- + t %e    + %e   ,
279                  2
280         - t     - t                           - t
281  2    %e      %e        - t           - t   %e
282 t  (- ----- - ----- + %e   ) + t (2 %e    - -----)
283         t       2                             t
284                t
285                          - t          - t     - t
286        - t       - t   %e        2  %e      %e
287  + 2 %e   , t (%e    - -----) + t  (----- - -----)
288                          t            2       t
289                2   - t            - t     - t
290      - t      t  %e        2    %e      %e        - t
291  + %e   ], [- --------, - t  (- ----- - ----- + %e   ),
292                  2                t       2
293                                          t
294         - t     - t      2   - t
295    2  %e      %e        t  %e          - t
296 - t  (----- - -----)], [-------- - t %e   ,
297         2       t          2
298         - t     - t                           - t
299  2    %e      %e        - t           - t   %e
300 t  (- ----- - ----- + %e   ) - t (2 %e    - -----),
301         t       2                             t
302                t
303       - t     - t                 - t
304  2  %e      %e            - t   %e
305 t  (----- - -----) - t (%e    - -----)])
306       2       t                   t
307 (%i4) ratsimp(%);
308                [   2              - t ]
309                [ (t  + 2 t + 2) %e    ]
310                [ -------------------- ]
311                [          2           ]
312                [                      ]
313                [         2   - t      ]
314 (%o4)  Col 1 = [        t  %e         ]
315                [      - --------      ]
316                [           2          ]
317                [                      ]
318                [     2          - t   ]
319                [   (t  - 2 t) %e      ]
320                [   ----------------   ]
321                [          2           ]
322          [      2        - t    ]
323          [    (t  + t) %e       ]
324          [                      ]
325  Col 2 = [     2            - t ]
326          [ - (t  - t - 1) %e    ]
327          [                      ]
328          [     2          - t   ]
329          [   (t  - 3 t) %e      ]
330          [        2   - t       ]
331          [       t  %e          ]
332          [       --------       ]
333          [          2           ]
334          [                      ]
335          [      2          - t  ]
336  Col 3 = [    (t  - 2 t) %e     ]
337          [  - ----------------  ]
338          [           2          ]
339          [                      ]
340          [   2              - t ]
341          [ (t  - 4 t + 2) %e    ]
342          [ -------------------- ]
343          [          2           ]
345 @end example
348 例 2:
349 @example
350 (%i5) b1:matrix([0,0,1,1,1],
351                 [0,0,0,1,1],
352                 [0,0,0,0,1],
353                 [0,0,0,0,0],
354                 [0,0,0,0,0])$
356 (%i6) mat_function(exp,t*b1);
357                   [              2     ]
358                   [             t      ]
359                   [ 1  0  t  t  -- + t ]
360                   [             2      ]
361                   [                    ]
362 (%o6)             [ 0  1  0  t    t    ]
363                   [                    ]
364                   [ 0  0  1  0    t    ]
365                   [                    ]
366                   [ 0  0  0  1    0    ]
367                   [                    ]
368                   [ 0  0  0  0    1    ]
369 (%i7) minimalPoly(jordan(b1));
370                              3
371 (%o7)                       x
372 (%i8) ident(5)+t*b1+1/2*(t^2)*b1^^2;
373                   [              2     ]
374                   [             t      ]
375                   [ 1  0  t  t  -- + t ]
376                   [             2      ]
377                   [                    ]
378 (%o8)             [ 0  1  0  t    t    ]
379                   [                    ]
380                   [ 0  0  1  0    t    ]
381                   [                    ]
382                   [ 0  0  0  1    0    ]
383                   [                    ]
384                   [ 0  0  0  0    1    ]
385 (%i9) mat_function(exp,%i*t*b1);
386              [                           2 ]
387              [                          t  ]
388              [ 1  0  %i t  %i t  %i t - -- ]
389              [                          2  ]
390              [                             ]
391 (%o9)        [ 0  1   0    %i t    %i t    ]
392              [                             ]
393              [ 0  0   1     0      %i t    ]
394              [                             ]
395              [ 0  0   0     1        0     ]
396              [                             ]
397              [ 0  0   0     0        1     ]
398 (%i10) mat_function(cos,t*b1)+%i*mat_function(sin,t*b1);
399               [                           2 ]
400               [                          t  ]
401               [ 1  0  %i t  %i t  %i t - -- ]
402               [                          2  ]
403               [                             ]
404 (%o10)        [ 0  1   0    %i t    %i t    ]
405               [                             ]
406               [ 0  0   1     0      %i t    ]
407               [                             ]
408               [ 0  0   0     1        0     ]
409               [                             ]
410               [ 0  0   0     0        1     ]
411 @end example
413 例 3:
414 @example
415 (%i11) a1:matrix([2,1,0,0,0,0],
416                  [-1,4,0,0,0,0],
417                  [-1,1,2,1,0,0],
418                  [-1,1,-1,4,0,0],
419                  [-1,1,-1,1,3,0],
420                  [-1,1,-1,1,1,2])$
422 (%i12) fpow(x):=block([k],declare(k,integer),x^k)$
424 (%i13) mat_function(fpow,a1);
425                 [  k      k - 1 ]         [      k - 1    ]
426                 [ 3  - k 3      ]         [   k 3         ]
427                 [               ]         [               ]
428                 [       k - 1   ]         [  k      k - 1 ]
429                 [  - k 3        ]         [ 3  + k 3      ]
430                 [               ]         [               ]
431                 [       k - 1   ]         [      k - 1    ]
432                 [  - k 3        ]         [   k 3         ]
433 (%o13)  Col 1 = [               ] Col 2 = [               ]
434                 [       k - 1   ]         [      k - 1    ]
435                 [  - k 3        ]         [   k 3         ]
436                 [               ]         [               ]
437                 [       k - 1   ]         [      k - 1    ]
438                 [  - k 3        ]         [   k 3         ]
439                 [               ]         [               ]
440                 [       k - 1   ]         [      k - 1    ]
441                 [  - k 3        ]         [   k 3         ]
442          [       0       ]         [       0       ]
443          [               ]         [               ]
444          [       0       ]         [       0       ]
445          [               ]         [               ]
446          [  k      k - 1 ]         [      k - 1    ]
447          [ 3  - k 3      ]         [   k 3         ]
448          [               ]         [               ]
449  Col 3 = [       k - 1   ] Col 4 = [  k      k - 1 ]
450          [  - k 3        ]         [ 3  + k 3      ]
451          [               ]         [               ]
452          [       k - 1   ]         [      k - 1    ]
453          [  - k 3        ]         [   k 3         ]
454          [               ]         [               ]
455          [       k - 1   ]         [      k - 1    ]
456          [  - k 3        ]         [   k 3         ]
457          [    0    ]
458          [         ]         [ 0  ]
459          [    0    ]         [    ]
460          [         ]         [ 0  ]
461          [    0    ]         [    ]
462          [         ]         [ 0  ]
463  Col 5 = [    0    ] Col 6 = [    ]
464          [         ]         [ 0  ]
465          [    k    ]         [    ]
466          [   3     ]         [ 0  ]
467          [         ]         [    ]
468          [  k    k ]         [  k ]
469          [ 3  - 2  ]         [ 2  ]
470 @end example
472 この関数を使うためには、最初に@code{load("diag")}を書いてください。
474 @opencatbox
475 @category{Package diag}
476 @closecatbox
478 @end deffn