方程组的几何解释

线性代数

方程组的几何解释

线性组合

把向量相加得到 v+w, 随后乘以各自的常量c和d,得到cv和dw,将他们相加得到线性组合 cv+df

形如:
cv + dw = c \left\{ \begin{matrix} 1 \\ 1 \\ \end{matrix} \right\} + d \left\{ \begin{matrix} 2 \\ 3 \\ \end{matrix} \right\} = \left\{ \begin{matrix} c+2d \\ c+3d \\ \end{matrix} \right\} \\

点乘

\left\{ \begin{matrix} 2 \\ 3 \\ \end{matrix} \right\}*\left\{ \begin{matrix} 2 \\ 3 \\ \end{matrix} \right\} = 2*2+3*3=14

向量的长度

\sqrt{\left\{ \begin{matrix} 2 \\ 3 \\ \end{matrix} \right\}*\left\{ \begin{matrix} 2 \\ 3 \\ \end{matrix} \right\}} = \sqrt{14}

内积

\left\{ \begin{matrix} 2 & -1 \\ -1 & 2 \\ \end{matrix} \right\} \left\{ \begin{matrix} x \\ y \\ \end{matrix} \right\} = \left\{\begin{matrix} 2x - y \\ -x + y \\ \end{matrix}\right\}

方程
2x +y = 3 \\ x - 2y = -1

矩阵模式

写成矩阵模式就是:
\left\{ \begin{matrix} 2 & 1 \\ 1 & -2 \\ \end{matrix} \right\} \left\{ \begin{matrix} x \\ y \\ \end{matrix} \right\} = \left\{ \begin{matrix} 3 \\ -1 \\ \end{matrix} \right\}\\ A X =B

逆矩阵

aX=b \\ then \\ x = a^{-1}b

逆矩阵的特性
A^{-1}A=\left\{ \begin{matrix} 1 & 0 \\ 0 & 1 \\ \end{matrix} \right\}

Row picture 行图像

把属于方程的图像画出来,交点就是解

import numpy as np
import matplotlib.pyplot as plt

x = np.linspace(-5, 5, 50)
y = 3-2*x
y2 = (x+1)/2

plt.figure(num=3, figsize=(8, 5),)
plt.xlim((-5, 5))
plt.ylim((-5, 5))

ax = plt.gca()
ax.spines['bottom'].set_position(('data', 0))
ax.spines['left'].set_position(('data',0))

plt.plot(x, y)
plt.plot(x, y2)

plt.show()
1573030360210.png

Column Picture 列图像

import numpy as np
import matplotlib.pyplot as plt

soa = np.array([[0, 0, 2, 1], [0, 0, 1, -2], [2, 1, 1, -2]])
X, Y, U, V = zip(*soa)

plt.figure(num=3, figsize=(8, 5),)
plt.xlim((-5, 5))
plt.ylim((-5, 5))

ax = plt.gca()
ax.spines['bottom'].set_position(('data', 0))
ax.spines['left'].set_position(('data',0))

ax.quiver(X, Y, U, V, angles='xy', scale_units='xy', scale=1)
plt.annotate(r'3, -1', xy=(3, -1), xycoords='data', xytext=(+30, -30),
             textcoords='offset points', fontsize=16,
             arrowprops=dict(arrowstyle='->', connectionstyle="arc3,rad=.2"))
plt.show()
1573031004392.png
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。