Question: Python 2.7 : Help computing the derivative of the planck function over a range of wavelegths using a central difference scheme : Plank function is
Python 2.7 : Help computing the derivative of the planck function over a range of wavelegths using a central difference scheme : Plank function is given as : h = 6.626068e-34 k=1.3806503e-23 c=299792458.0 w = np.logspace(-10,10,1000) #this is the steps of wavelengths to insert in the function below temp = 5800 planckfunction = 2*h*c**2/(w**5 * (np.exp(h*c/(w*k*temp))-1)) I need help figuring out the code! The Central Difference Scheme is : def centralDifference(f, x, h): return(f(x+h)-f(x-h))/(2*h)
where f is the function, evaluated at x (5800), using step size h
I have to compute the derivative of the function over a range of wavelengths using a step size of 0.1 and plot on a set of axes. Then, I am to plot it again BUT where the derivative is positive and negative I have to have different colors (ex : red for positive derivative, blue for negative derivative)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
