为什么这条线:
prog.AddQuadraticErrorCost(np.identity(len(q)), q0, q)
作品。
但是这个:
prog.AddCost(np.linalg.norm(q_variables - q_nominal)**2)
运行时错误:表达式 pow(sqrt((pow(q(0), 2) + pow(q(2), 2) + pow(q(4), 2) + pow(q(6), 2) + pow( q(7), 2) + pow(q(8), 2) + pow((-1 + q(5)), 2) + pow((-0.59999999999999998 + q(1)), 2) + pow( (1.75 + q(3)), 2))), 2) 不是多项式。ParseCost 不支持非多项式表达式。
才不是?
这些表达式在数学上不是相同的吗?