学習環境
- Surface 3 (4G LTE)、Surface 3 タイプ カバー、Surface ペン(端末)
- Windows 10 Pro (OS)
- 数式入力ソフト(TeX, MathML): MathType
- MathML対応ブラウザ: Firefox、Safari
- MathML非対応ブラウザ(Internet Explorer, Microsoft Edge, Google Chrome...)用JavaScript Library: MathJax
- 参考書籍
線型代数入門(松坂 和夫(著)、岩波書店)の第2章(ベクトル空間)、8(基底と次元(II))、問7.を取り組んでみる。
コード(Emacs)
Python 3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from sympy import pprint, symbols, solve, Matrix
print('5.')
a = Matrix(symbols('a1 a2 a3'))
b = Matrix(symbols('b1 b2 b3'))
c = Matrix(symbols('c1 c2 c3'))
e1 = Matrix([1, 0, 0])
e2 = Matrix([0, 1, 0])
e3 = Matrix([0, 0, 1])
s = solve([b + c - e1, a + c - e2, a + b - e3], dict=True)
for s0 in s:
pprint(s0)
入出力結果(Terminal, IPython)
$ ./sample7.py
5.
{a₁: -1/2, a₂: 1/2, a₃: 1/2, b₁: 1/2, b₂: -1/2, b₃: 1/2, c₁: 1/2, c₂: 1/2, c₃:
-1/2}
$
0 コメント:
コメントを投稿