Question
Please answer the following question using MATLAB. it is critical that you use the given function and initial values so please be sure to use
Please answer the following question using MATLAB. it is critical that you use the given function and initial values so please be sure to use the provided template below the picture in your Solution. Thank you very much, I will upvote!!
function [I_numint] = HW6_prob4_MEID(n)
% Find the blackbody emissive power of a surface as a function of
% temperature T [in Kelvin] using the extended midpoint method.
%% step through each temperature and solve for Eb(T)
T = 300:100:5000;
I_numint = zeros(length(T),1); %initialize vectors to store numbers
I_actual = zeros(length(T),1);
for i = 1:length(T)
lam_cut = (2.898e-3)/T(i); %get lam_cut
I1 = $$$; %use extended midpoint to eval first integral
I2 = $$$; %use extended midpoint to eval second integral
I_numint(i,1) = I1 + I2; %total
I_actual(i,1) = (5.67e-8)*(T(i)^4); %calc Eb = sig*(T^4)
end
%% plot solution from numerical integration and sig*T^4
figure
end
%% extended midpoint integration
function I = extended_MP_int
I = $$$; %find I using extended MP rule equation
end
%% Planck Distribution
function Planck
h = 6.62607004e-34;
co = 2.99792458e8;
kb = 1.38064852e-23;
end
4. [14 points] In class, we talked about the Plank distribution Ex,b, which governs the spectral (per unit wavelength 2), radiative emission from an ideal surface at temperature T. Integrating the Planck distribution over all wavelengths yields the total emissive power of the surface En. It turns out that Ep = $*Ex,b(A)da = 074, where o = 5.67. 10-8 [W/mK*]. In this problem, we'll show that Ep = oT+ using numerical integration. 29thc? CF 9 7 11 [exp (het) - 1] niversit h = 962607004*10**0's 6 = [Exumda = | Ens QJda + Ssno man 1 = wavelength [m] Co = [m/s] k = 1.38064852 . 10-23 [J/K] T = temperature [K] Acut = 0.002898/T Because the integral is improper, we'll break it into two separate integrals as shown above where Acut is given above. Write a function that determines Es at temperatures T = 300:100:5000 K. Perform any numerical integration using the extended midpoint method. The function should accept one input argument: the number of segments n. The function should return the values of Ey from your numerical integration for each temperature in a single column vector. Also, generate a plot of E. (y-axis) vs T (x-axis). Include one line for your calculation with the extended midpoint method and one line for Ep = ot+ (they should be the same!). Make sure to include appropriate axis labels and a legend. The function should be named HW6_prob4_MEID.m. Replace MEID with your MEID with no hyphens. The entire solution should be contained in this function. We'll use the function call [Eb] = HW6_prob4_MEID(n) to grade this problem. Use the skeleton m-file posted on Canvas as a starting point. You may use basic built-in MatLab math functions (trigonometric functions, sqrt, abs, rand, etc.), vector building functions (ones, zeros, eye,' (transpose), etc.), and linear system solver functions (inv, lu, etc.). Make sure to thoroughly comment your code so we can award partial creditStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started