I have a the following code:
p = classp();
for i in range(1,10):
x = numpy.array([[2],[4],[5]])
print p.update(x)
class classp:
def __init__(self):
self.mymodel = array([2*x[1]], [3*x[0]], [x[2]]);
def update(self, x):
return self.mymodel #replace x(0)...x(1) with the given parameter
我的问题与上面的代码有关,我想使用sympy定义一个模型,如果可能,在更新函数中用x值替换sympy变量。这是否可行?我该如何做到这一点?
lambdify
在当前状态下的表现。它是一个混乱且不可预测的函数,甚至没有一个明确定义的应用范围。有时候它会返回符号对象,而本意是要用于数值评估。 - Krastanov