I have some data and want to fit it with a Planck’s law for Black Body radiation function. The problem is that Mathematica does not even give out the correct coefficients.
When I input:
dati = Import["https://pastebin.com/raw/MGEzkeC3", "Table"]; (*Show[ListPlot[dati, Frame -> True]]*) Planks[l_, T_, A_] := (1/A)*(((2*h*c^2)/l^5)*(1/(Exp[((h*c)/(l*kb*T))] - 1))); fittesana2 = FindFit[dati, Planks[l, T, A], {T, A } , l]; Show[Plot[fittesana2[l], {l, 400, 900}, PlotStyle -> Red, PlotRange -> All], ListPlot[dati], Frame -> True] Pfit = NonlinearModelFit[dati, Planks[l, T, A], {{A, 1*10^8}, {T, 1700}}, l]; Show[Plot[Pfit[l], {l, 400, 900}, PlotStyle -> Red, PlotRange -> All], ListPlot[dati], Frame -> True] Normal[Pfit] Pfit["ANOVATable"] Pfit["ParameterTable"] Pfit["FitCurvatureTable"]
It gives me out: