CoCalc Public Filessage-tutorial-9 / Nivel-1 / Radiacao.ipynb
Author: João Marcello Pereira
Views : 127
Compute Environment: Ubuntu 18.04 (Deprecated)
In [1]:
%display latex

In [68]:
reset('all')

In [69]:
var("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)

$\frac{3.12076695684937 \times 10^{-11}}{A^{5}}$
$\frac{117552.384000000}{A^{4}}$
In [136]:
F = integrate(E, A)/En
F

$-6.636970792632691 \times 10^{-17}$
In [137]:
modelo_Gompertz(x) = a*exp(-b*exp(-c*x))
modelo_Gompertz

$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

$\left\{c : 0.5405029914116612, b : 6.576375491807861, a : 0.9643475394289801\right\}$
In [139]:
modelo_Gompertz_ajustado(x) = modelo_Gompertz.subs(ajuste);


$0.9643475394289801 \, e^{\left(-6.576375491807861 \, e^{\left(-0.5405029914116612 \, x\right)}\right)}$
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")

modelo_Gompertz_ajustado(6)

$0.7459595377976681$