2017年7月27日木曜日

学習環境

ラング線形代数学(上)(S.ラング (著)、芹沢 正三 (翻訳)、ちくま学芸文庫)の6章(行列式)、3(行列式の存在)、練習問題10.を取り組んでみる。


  1. 3 x 3行列式の場合。

    φ( t )=| f( t ) g( t ) h( t ) f'( t ) g'( t ) h'( t ) f''( t ) g''( t ) h''( t ) | =f( t )( g'( t )h''( t )g''( t )h'( t ) ) g( t )( f'( t )h''( t )f''( t )h'( t ) )+ h( t )( f'( t )g''( t )f''( t )g'( t ) ) φ'( t )=f'( t )( g'( t )h''( t )g''( t )h'( t ) )+ f( t )( g''( t )h''( t )g'''( t )h'( t )+g'( t )h'''( t )g''( t )h''( t ) ) g'( t )( f'( t )h''( t )f''( t )h'( t ) ) g( t )( f''( t )h''( t )f'''( t )h'( t )+f'( t )h'''( t )f''( t )h''( t ) )+ h'( t )( f'( t )g''( t )f''( t )g'( t ) )+ h( t )( f''( t )g''( t )f'''( t )g'( t )+f'( t )g'''( t )f''( t )g''( t ) ) =f( t )( g'''( t )h'( t )+g'( t )h'''( t ) ) g( t )( f'''( t )h'( t )+f'( t )h'''( t ) )+ h( t )( f'''( t )g'( t )+f'( t )g'''( t ) ) =| f( t ) g( t ) h( t ) f'( t ) g'( t ) h'( t ) f'''( t ) g'''( t ) h'''( t ) |

    一般化。

    φ( t )=| f 1 f n f 1 ' f n ' f 1 ( n1 ) f n ( n1 ) | = i=1 n ( 1 ) i+j f i | f 1 ' f n ' f 1 ( n1 ) f n ( n1 ) | φ'( t ) = i=1 n ( 1 ) i+j ( f ' i | f 1 ' f n ' f 1 ( n1 ) f n ( n1 ) |+ f i | f 1 ' f n ' f 1 n f n n | ) =| f 1 ' f n ' f 1 ' f n ' f 1 ( n1 ) f n ( n1 ) |+| f 1 f n f 1 ' f n ' f 1 n f n n | =| 0 0 f 1 ' f n ' f 1 ( n1 ) f n ( n1 ) |+| f 1 f n f 1 ' f n ' f 1 n f n n | =| f 1 f n f 1 ' f n ' f 1 n f n n |

コード(Emacs)

Python 3

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from sympy import pprint, symbols, Matrix, sin, cos, Function, Derivative

print('10.')
f = Function('f')
g = Function('g')
h = Function('h')
t = symbols('t')
m1 = Matrix([[f(t), g(t), h(t)],
             list(map(lambda f0: Derivative(f0(t), t, 1), [f, g, h])),
             list(map(lambda f0: Derivative(f0(t), t, 2), [f, g, h]))])

m2 = Matrix([[f(t), g(t), h(t)],
             list(map(lambda f0: Derivative(f0(t), t, 1), [f, g, h])),
             list(map(lambda f0: Derivative(f0(t), t, 3), [f, g, h]))])

pprint(m1)
pprint(m2)

d1 = m1.det()
pprint(d1)
d2 = m2.det()
pprint(d2)

d11 = Derivative(d1, t, 1)
pprint(d11)

a = d11.doit()
b = d2.doit()
pprint(a)
pprint(b)
print(a == b)

入出力結果(Terminal, IPython)

$ ./sample10.py
10.
⎡  f(t)       g(t)       h(t)   ⎤
⎢                               ⎥
⎢d          d          d        ⎥
⎢──(f(t))   ──(g(t))   ──(h(t)) ⎥
⎢dt         dt         dt       ⎥
⎢                               ⎥
⎢  2          2          2      ⎥
⎢ d          d          d       ⎥
⎢───(f(t))  ───(g(t))  ───(h(t))⎥
⎢  2          2          2      ⎥
⎣dt         dt         dt       ⎦
⎡  f(t)       g(t)       h(t)   ⎤
⎢                               ⎥
⎢d          d          d        ⎥
⎢──(f(t))   ──(g(t))   ──(h(t)) ⎥
⎢dt         dt         dt       ⎥
⎢                               ⎥
⎢  3          3          3      ⎥
⎢ d          d          d       ⎥
⎢───(f(t))  ───(g(t))  ───(h(t))⎥
⎢  3          3          3      ⎥
⎣dt         dt         dt       ⎦
                2                         2                         2         
     d         d               d         d               d         d          
f(t)⋅──(g(t))⋅───(h(t)) - f(t)⋅──(h(t))⋅───(g(t)) - g(t)⋅──(f(t))⋅───(h(t)) + 
     dt         2              dt         2              dt         2         
              dt                        dt                        dt          

                2                         2                         2      
     d         d               d         d               d         d       
g(t)⋅──(h(t))⋅───(f(t)) + h(t)⋅──(f(t))⋅───(g(t)) - h(t)⋅──(g(t))⋅───(f(t))
     dt         2              dt         2              dt         2      
              dt                        dt                        dt       
                3                         3                         3         
     d         d               d         d               d         d          
f(t)⋅──(g(t))⋅───(h(t)) - f(t)⋅──(h(t))⋅───(g(t)) - g(t)⋅──(f(t))⋅───(h(t)) + 
     dt         3              dt         3              dt         3         
              dt                        dt                        dt          

                3                         3                         3      
     d         d               d         d               d         d       
g(t)⋅──(h(t))⋅───(f(t)) + h(t)⋅──(f(t))⋅───(g(t)) - h(t)⋅──(g(t))⋅───(f(t))
     dt         3              dt         3              dt         3      
              dt                        dt                        dt       
  ⎛                2                         2                         2      
d ⎜     d         d               d         d               d         d       
──⎜f(t)⋅──(g(t))⋅───(h(t)) - f(t)⋅──(h(t))⋅───(g(t)) - g(t)⋅──(f(t))⋅───(h(t))
dt⎜     dt         2              dt         2              dt         2      
  ⎝              dt                        dt                        dt       

                   2                         2                         2      
        d         d               d         d               d         d       
 + g(t)⋅──(h(t))⋅───(f(t)) + h(t)⋅──(f(t))⋅───(g(t)) - h(t)⋅──(g(t))⋅───(f(t))
        dt         2              dt         2              dt         2      
                 dt                        dt                        dt       

⎞
⎟
⎟
⎟
⎠
                3                         3                         3         
     d         d               d         d               d         d          
f(t)⋅──(g(t))⋅───(h(t)) - f(t)⋅──(h(t))⋅───(g(t)) - g(t)⋅──(f(t))⋅───(h(t)) + 
     dt         3              dt         3              dt         3         
              dt                        dt                        dt          

                3                         3                         3      
     d         d               d         d               d         d       
g(t)⋅──(h(t))⋅───(f(t)) + h(t)⋅──(f(t))⋅───(g(t)) - h(t)⋅──(g(t))⋅───(f(t))
     dt         3              dt         3              dt         3      
              dt                        dt                        dt       
                3                         3                         3         
     d         d               d         d               d         d          
f(t)⋅──(g(t))⋅───(h(t)) - f(t)⋅──(h(t))⋅───(g(t)) - g(t)⋅──(f(t))⋅───(h(t)) + 
     dt         3              dt         3              dt         3         
              dt                        dt                        dt          

                3                         3                         3      
     d         d               d         d               d         d       
g(t)⋅──(h(t))⋅───(f(t)) + h(t)⋅──(f(t))⋅───(g(t)) - h(t)⋅──(g(t))⋅───(f(t))
     dt         3              dt         3              dt         3      
              dt                        dt                        dt       
True
$

0 コメント:

コメントを投稿

Comments on Google+: