学習環境
- Surface Go、タイプ カバー、ペン(端末)
- Windows 10 Pro (OS)
- Nebo(Windows アプリ)
- iPad Pro + Apple Pencil
- MyScript Nebo(iPad アプリ(iOS))
- 参考書籍
線型代数入門(松坂 和夫(著)、岩波書店)の第7章(固有値と固有ベクトル)、6(漸化式で定められる数列)、問題1.を取り組んでみる。
コード(Emacs)
Python 3
#!/usr/bin/env python3
from sympy import pprint, symbols, sin, cos, sqrt, I
print('1.')
θ = symbols('θ')
n = symbols('n', integer=True)
a = sqrt(2) * (cos(θ) + I * sin(θ))
b = sqrt(2) * (cos(θ) - I * sin(θ))
an = 1 / sqrt(7) * (- I * a ** n + I * b ** n)
for t in [an, an.expand(), an.factor(), an.simplify()]:
pprint(t)
print()
入出力結果(Terminal, Jupyter(IPython))
$ ./sample1.py
1.
⎛ n n⎞
√7⋅⎝ⅈ⋅(√2⋅(-ⅈ⋅sin(θ) + cos(θ))) - ⅈ⋅(√2⋅(ⅈ⋅sin(θ) + cos(θ))) ⎠
───────────────────────────────────────────────────────────────
7
n n
√7⋅ⅈ⋅(-√2⋅ⅈ⋅sin(θ) + √2⋅cos(θ)) √7⋅ⅈ⋅(√2⋅ⅈ⋅sin(θ) + √2⋅cos(θ))
──────────────────────────────── - ───────────────────────────────
7 7
⎛ n n⎞
√7⋅ⅈ⋅⎝(-√2⋅ⅈ⋅sin(θ) + √2⋅cos(θ)) - (√2⋅ⅈ⋅sin(θ) + √2⋅cos(θ)) ⎠
───────────────────────────────────────────────────────────────
7
⎛ n n⎞
⎜⎛ -ⅈ⋅θ⎞ ⎛ ⅈ⋅θ⎞ ⎟
√7⋅ⅈ⋅⎝⎝√2⋅ℯ ⎠ - ⎝√2⋅ℯ ⎠ ⎠
───────────────────────────────
7
$
0 コメント:
コメントを投稿