-
Notifications
You must be signed in to change notification settings - Fork 0
/
BlackBody (2).m
54 lines (35 loc) · 1.49 KB
/
BlackBody (2).m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
%------------------------------------------------------------------------%
%---------Black Body Radiation-------------------------------------------%
%------------------------------------------------------------------------%
clc;
close all;
clear all;
%------------------------------------------------------------------------%
c=3*10^8; % speed of light in vaccum
h=6.625*10.^-34; % Planck constant
k=1.38*10.^-23; % Boltzmann constant
T=[ 500 600 700 ]; % Temperatures in Kelvin
Lam=(0.0:0.01:20).*1e-6;
figure(1)
for i=1:3
%------------Wiens Displacement Law--------------------------------------%
I1(:,i)= ((2*h*c*c)./(Lam.^5)).*(exp(-(h*c)./(Lam*k*T(i))));
%------------Planks Law--------------------------------------------------%
I2(:,i)=(2*h*c*c)./((Lam.^5).*(exp((h.*c)./(k.*T(i).*Lam))-1));
%------------------------------------------------------------------------%
plot(Lam,I1(:,i),'linewidth',2)
hold on
plot(Lam,I2(:,i),'r','linewidth',2)
text(.55e-5,.7e8,'500K','fontSize',14)
text(.5e-5,2e8,'600K','fontSize',14)
text(.8e-5,5e8,'T=700K','fontSize',14)
line([1.2e-5 1.4e-5], [6e8 6e8],'color','r','linewidth',2)
line([1.2e-5 1.4e-5], [5e8 5e8],'linewidth',2)
text(1.45e-5,6e8,'Plancks Law','fontSize',14)
text(1.45e-5,5e8,'Wiens Law','fontSize',14)
xlabel('\lambda','fontsize',14)
ylabel('Intensity','fontsize',14)
title('Blackbody Radiation','fontsize',14)
fh = figure(1);
set(fh, 'color', 'white');
end