How can two calibration equations determine two unknowns?
linalg.solve finds x in Ax=b for a square full-rank coefficient matrix, directly solving the linear system.
numpy.linalg.solve in practice
Two gains with sum six and difference two are four and two. Duplicate constraints make the matrix singular and cannot determine unique gains.
import numpy as np
np.linalg.solve([[1,1],[1,-1]],[6,2])Result [4.0, 2.0]
中文
两个校准方程怎样直接求出两个未知量?
linalg.solve 对满秩方阵 A 求满足 Ax=b 的解,利用系数矩阵直接解线性方程组。
numpy.linalg.solve 算例
总和为 6、差为 2 的两个增益解为 4 和 2。若两条约束其实重复,系数矩阵奇异,唯一校准值无从确定。
import numpy as np
np.linalg.solve([[1,1],[1,-1]],[6,2])结果 [4.0, 2.0]