Now that the bugs seem to have been sorted out, I think the following should work. The point is to find the effective temperature, such that the flux at 1 AU matches the expected value. For this FindRoot[]
is ideal, given our functions are numeric. Specifically, let's define the functions (and some new constants):
refF = 1340;
c = 299792458;
h = 6.62607015*10^-34;
k = 1.380649*10^-23;
Rsun = 696340000;
AU = 149597870700;
where Rsun
and AU
are the radius of the Sun and 1 astronomical Unit (AU). Also,
B[\[Lambda]_,T_] := (2*h*c^2)/\[Lambda]^5*1/(Exp[(h*c)/(\[Lambda]*k*T)] - 1);
F[T_?NumericQ] := \[Pi]*NIntegrate[B[\[Lambda], T], {\[Lambda], 0.1*10^-9, 2300.0*10^-9}];
Then it is enough to say:
FindRoot[(Rsun/AU)^2 F[T] == refF, {T, 5800}]
(* {T -> 5808.6} *)
Which is reasonably close to the temperature of the Sun $(T_{\odot}\simeq 5778 K)$.