curve fitting coefficients.
get the model coefficients, but I can not use them to plot the graph. How to solve?
see the code:
dados = [(0, -0.183440428023042),
(0.200000000000000, -0.131101157495126),
(0.400000000000000, 0.0268875670852843),
(0.800000000000000, 0.110532679260319),
(1.00000000000000, 0.253944632998395),
(1.20000000000000, 0.257190123748649),
(1.40000000000000, 0.531888837111346),
(1.60000000000000, 0.579048247883555),
(2.00000000000000, 0.935180993484717),
(2.20000000000000, 0.916600344376623),
(2.60000000000000, 1.13328608090532),
(2.80000000000000, 1.26893326843583),
(3.00000000000000, 1.10202945535186),
(3.40000000000000, 1.13391615491257)]
point(dados,color = "red",size=20,legend_label="pontos coletados")
modelo(x) = a*x+b;modelo
a,b = find_fit(dados, modelo);a;b
modelo(x) = a*x+b
point(dados,color = "red",size=20,legend_label="pontos coletados") + plot(modelo(x),(x,0,3))
Traceback (click to the left of this block for traceback)
...
ValueError: Variable 'x' not found
What are 'a' and 'b'? Did you define them as variables?