I am trying to plot the temeprature curves for emissivity against the wavelength using Planck's Law. The plot I am getting is pretty close, except there is no decrease in emissivity as the wavelength gets very large. I can't tell if it is the way the for loops are running or the equations I typed in. I have attachedmy current code and the graph I am trying to duplicate for clarification. Any help is greatly appreciated. Thanks!
C1 = 3.742*10^8; % First constant W-micron^4/m^2
C2 = 1.4388*10^4; %Second constant microns-K
T = 100:100:6000; %Temperature in Kelvins
lambda = 0.1:0.1:25; %wavelength in microns
lengthT = length(T);
length_L = length(lambda);
E = zeros(lengthT,length_L);
for i = 1:lengthT
for j = 1:length_L
term1(i,j) = C2./(lambda(j)*T(i));
end
E= C1./((lambda(j)^5)*exp(term1-1));
end
loglog(lambda, E)
ylim([1*10^-1,1*10^9])
xlim([0, 2.5*10^1])

1 Kommentar

Walter Roberson
Walter Roberson am 10 Dez. 2023
In order to produce that kind of graph, your expression would need some term that first increased in time and then decreased in time. I am not finding any term in your code that has that property ?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Torsten
Torsten am 9 Dez. 2023

0 Stimmen

Maybe
for i = 1:lengthT
for j = 1:length_L
term1(i,j) = C2./(lambda(j)*T(i));
E(i,j)= C1./((lambda(j)^5)*exp(term1(i,j)-1));
end
%E= C1./((lambda(j)^5)*exp(term1-1));
end
instead of
for i = 1:lengthT
for j = 1:length_L
term1(i,j) = C2./(lambda(j)*T(i));
end
E= C1./((lambda(j)^5)*exp(term1-1));
end
?

4 Kommentare

Matthew Palermo
Matthew Palermo am 10 Dez. 2023
I tried that earlier and got the same result
Matthew Palermo
Matthew Palermo am 10 Dez. 2023
The issue for some reason was splitting up the operation between E and term 1. Consolidating everything into a single step solved the issue
Image Analyst
Image Analyst am 10 Dez. 2023
@Matthew Palermo for completeness, could you post your complete, corrected code? It might help other people. 🙂
Torsten
Torsten am 10 Dez. 2023
Bearbeitet: Torsten am 10 Dez. 2023
I tried that earlier and got the same result
Strange. I get a similar result as in your graphic.
C1 = 3.742*10^8; % First constant W-micron^4/m^2
C2 = 1.4388*10^4; %Second constant microns-K
T = 100:100:6000; %Temperature in Kelvins
lambda = 0.1:0.1:25; %wavelength in microns
lengthT = length(T);
length_L = length(lambda);
E = zeros(lengthT,length_L);
for i = 1:lengthT
for j = 1:length_L
term1(i,j) = C2./(lambda(j)*T(i));
E(i,j)= C1./((lambda(j)^5)*exp(term1(i,j)-1));
end
%E= C1./((lambda(j)^5)*exp(term1-1));
end
loglog(lambda, E)
ylim([1*10^-1,1*10^9])
xlim([0, 2.5*10^1])

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Programming finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2023b

Gefragt:

am 9 Dez. 2023

Kommentiert:

am 10 Dez. 2023

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by