Open with one click!
In [1]:
%display latex
In [68]:
reset('all')
In [69]:
var("A, C1, C2, T, AT, a, b, c")
(A,C1,C2,T,AT,a,b,c)\left(A, C_{1}, C_{2}, T, \mathit{AT}, a, b, c\right)
In [70]:
import pandas as pd
In [132]:
dados = pd.read_csv('tabela-1.csv')
In [133]:
pontos = zip(dados.x,dados.y)
In [134]:
point(pontos,color = "red", size=10,legend_label="pontos coletados", gridlines="minor", figsize=(6, 5))
In [135]:
C1 = 3.74177e-16 C2 = 1.43878e-2 AT = 1.200e3 T = AT/A En = 5.669e-8*T^4 E = C1/(A^5*(exp(C2/AT)-1)) display(E, En)
3.12076695684937×1011A5\frac{3.12076695684937 \times 10^{-11}}{A^{5}}
117552.384000000A4\frac{117552.384000000}{A^{4}}
In [136]:
F = integrate(E, A)/En F
6.636970792632691×1017-6.636970792632691 \times 10^{-17}
In [137]:
modelo_Gompertz(x) = a*exp(-b*exp(-c*x)) modelo_Gompertz
x  ae(be(cx))x \ {\mapsto}\ a e^{\left(-b e^{\left(-c x\right)}\right)}
In [138]:
# A opção solution_dict=True,utilizada para criar o dicionários das constantes, é opcional, mas caso não ocorra erro, coloque-a como true ajuste = find_fit(pontos, modelo_Gompertz,[0.7,0.5,0.5],solution_dict=true); ajuste
{c:0.5405029914116612,b:6.576375491807861,a:0.9643475394289801}\left\{c : 0.5405029914116612, b : 6.576375491807861, a : 0.9643475394289801\right\}
In [139]:
modelo_Gompertz_ajustado(x) = modelo_Gompertz.subs(ajuste); modelo_Gompertz_ajustado(x)
0.9643475394289801e(6.576375491807861e(0.5405029914116612x))0.9643475394289801 \, e^{\left(-6.576375491807861 \, e^{\left(-0.5405029914116612 \, x\right)}\right)}
In [140]:
point(pontos,color = "red",size=20,legend_label="pontos coletados",gridlines="minor", figsize=(6, 5))+ plot(modelo_Gompertz_ajustado(x),(x,0,100), legend_label="curva ajustada")
In [24]:
modelo_Gompertz_ajustado(6)
0.74595953779766810.7459595377976681
In [77]: