title: Calculate variable value inside integral
body: <p>I'm trying to calculate the blackbody spectral radiance using planck function:</p>
  <pre><code>import numpy as np
  import matplotlib.pyplot as plt
  from scipy import interpolate, integrate
  
  
  # Physical constants:
  h = 6.6260693e-34                
  c = 299792485.0                
  k = 1.380658e-23               
  T = 6500
  
  wl_min = 0.1
  wl_max = 8.0
  wl = np.linspace(wl_min, wl_max, 1000)
  
  f = ((((2.0*h*c**2)/(wl*1e-6)**5)*(1.0/(np.exp(((h*c)/(k*T*wl*1e-6)))-1)))*1e-6)
  
  plt.figure()
  plt.plot(wl, f)
  plt.show()
  </code></pre>
  <p><a href="https://i.stack.imgur.com/j2zTR.png" rel="nofollow noreferrer">plot</a></p>
  <p>Then I integrated the wavelength range (from 0.1 to 8.0) and I got a power of 3.22e7 [W]</p>
  <pre><code>Power = integrate.trapz(f,wl)
  </code></pre>
  <p>Now, my problem!</p>
  <p>I would like to do the opposite: knowing the power value, find the temperature value.
  I can do it in Matlab but I don't know how to do it in python:</p>
  <p><a href="https://i.stack.imgur.com/za54L.png" rel="nofollow noreferrer">matlab code</a></p>
  <p>Could you help me?</p>