Clear Filters
Clear Filters

I am trying to calculate the power of a radiator and the final temperature. the equation is Planck's law I do not know what is wrong with it. could you please help me

3 views (last 30 days)
h=6.626176e-34; %J/s
c=2.99792458e8; %m/s
k=1.380649e-23; %J/K
A=20*1e-4; %m^2
er=0.95; %radation emissivity according to measurement Fig.1 e & f
T=300; %Kelvin,because of the cover and vacuum condition of cooling.
tc=1; % tc=transmittance of the cover
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%calculations:
%% radiator
%direction
syms theta
f = (1/2)*sin(2*theta);
intf = int(f,0,pi/2);
%wavelength, Planck's law, Blackbody Values For Vector Lam
Lam=(0:inf).*1e-6; % meters
dLam = Lam(2) - Lam(1); % Delta Lambda
I1 =(2*h*c^2)./((Lam.^5).*(exp((h.*c)./(k.*T.*Lam))-1));
% plotI1 = I1*1e-12;
% plotLam = Lam/1e-6;
% plot(plotLam,plotI1,'linewidth',4)
Ibb=trapz(Lam,I1);
%the power of radiator
Pr = 2*A*pi*intf*Ibb*er; % W. m-2
  5 Comments
Zahra Kamali Khanghah
Zahra Kamali Khanghah on 1 Mar 2022
thanks. As the final answer should be somthing around 330, could you tell me what is the reseason I cannot get it like a usual number?
Torsten
Torsten on 1 Mar 2022
Before calculating Pr, use the line
intf = double(intf)
But you should be able to get intf as 0.5 without symbolic calculations...

Sign in to comment.

Answers (1)

Neelanshu
Neelanshu on 6 Feb 2024
Hi Zahra,
I understand from your query that you are interested in finding the reason why you're not getting a numeric value for the power of the radiator.
You can follow these steps to ensure you get a numeric value for the power :
  • As Torsten pointed out you need to change the "Lam" variable range to a vector of finite range and convert "intf" variable to double datatype.
intf = double(intf)
  • Additionally you have to choose a very small starting value for "Lam" variable instead of 0. In MATLAB, division by zero leads to a NaN value for I1, which propagates when it undergoes numerical integration.
% Define wavelength range, starting from a small positive number to avoid division by zero
Lam = linspace(1e-10, 1e-6, 10000); % Meters
By making these adjustments, you should be able to obtain a numeric value for the power.
Hope this helps.

Categories

Find more on Symbolic Math Toolbox 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!