Open opens21 opened 7 months ago
Hi, I don't know if you already solved this, but you just need to add .as_expr() after Poly(), like this:
`x, y, z = variables('x, y, z') c1, c2 = parameters('c1, c2') model_dict = {z: Poly( {(1, 2): c1, (4, 5): c2}, x ,y).as_expr()}
model = Model(model_dict) model = Model({z: c2*x*4y5 + c1xy2})
x = np.linspace(0, 100, 100) y = np.linspace(0, 100, 100) xdata, ydata = np.meshgrid(x, y) zdata = 42 * xdata*4 ydata5 + 3.14 xdata ydata2
fit = Fit(model, x=xdata, y=ydata, z=zdata) fit_result = fit.execute() ` Or at least this solved it for me
Can you provide the full Python code to run the example on the webpage?
I get the error:
but I am pretty sure that Poly is not the issue since it works in a different code. This is my full code: