Need some much needed help!
Show older comments


-------------------------------------------------------------------------------------------------------------------------------------
My code so far. I'm trying to make it look like the plot above. I very much appreciate the assistance. Let me know of any mistakes!
%% Problem 1) Blackbody Radiation
% constants
%
c = 2.99e8; % speed of light [m/s]
h = 6.63e-34; % Planck's constant [J s]
k = 1.38e-23; % Boltzmann's constant [J/K]
A = 2.898e-3; % Wein's Law constant [K m]
T = 300; % Earth's Temperature [K]
T1= 1000; % Temperature [K] at 1000K
T2= 6000; % Sun's temperature [K]
lam = logspace(-8,5,100); % wavelength [m]
%
% Plank's Law
%
% below are three Planck's function for T,T1,T2.
L=((2*h*c*c)./(lam.^(5))).*(exp(h*c./(lam.*k*T)-1)).^(-1); % Blackbody curve for the Earth
Y=((2*h*c*c)./(lam.^(5))).*(exp(h*c./(lam.*k*T1)-1)).^(-1); % Blackbody curve for T1
W=((2*h*c*c)./(lam.^(5))).*(exp(h*c./(lam.*k*T2)-1)).^(-1); % Blackbody curve for the Sun
figure
semilogy(L,'red')
hold on
loglog(Y,'blue')
hold on
loglog(W,'yellow')
xlabel("x") % I don't know how to change the increments of the x-axis to reflect the above plot.
ylabel("Spectral Radiance")
title("Blackbody Curves Plot")
Accepted Answer
More Answers (0)
Categories
Find more on General Physics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!