我试图解决线性方程组:
min || Ax - B ||^2
for t in [0,1]
such that the coefficients x in this equation satisfy the linear equation:
C x = D
该系统试图拟合一组多项式以近似t的范围内的函数F(t)。
这是使用constraint of ordinary least squares求解线性方程的一种情况。
虽然有已知的封闭形式的解决方案, Karush-Kuhn-Tucker我正在寻找scipy
/ numpy
的路由,可以用来解决这个问题。
研究表明了scipy.optimize
模块,其中包括以下功能:
以上是this question和this question的建议。
但是这些条件不适用于某些其他线性方程的约束。我可以在scipy
和numpy
中使用什么来做到这一点?