Cody

Solution 350219

Submitted on 13 Nov 2013
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
%% % Input: BB Temp, Lo Wavelength, Hi Wavelength, Integration steps % Output radiance in ph/m2/sec/ster % Nominal steps of 1000 yields accuracy and timeliness lo=3.0; hi=5.0; T=250.0; % Radiance = 4.96124998 e18 ph/m2/sec/ster ts=cputime; rad_entry=Calc_Radiance(lo,hi,T) tc=cputime; dt=1000*(tc-ts) % Processing Time in ms rad_correct = 4.96124998e18; % ph/m2/sec/ster tol=.00001; Pass=rad_entry>rad_correct*(1- tol) & rad_entry<rad_correct*(1+ tol) & dt<100; assert(isequal(Pass,1))

Error: Undefined function or variable 'x'.

2   Fail
%% % Input: BB Temp, Lo Wavelength, Hi Wavelength, Integration steps % Output radiance in ph/m2/sec/ster % Nominal steps of 1000 yields accuracy and timeliness lo=3.0; hi=5.0; T=300.0; % Radiance = 4.1826971 e19 ph/m2/sec/ster ts=cputime; rad_entry=Calc_Radiance(lo,hi,T) tc=cputime; dt=1000*(tc-ts) % Processing Time in ms rad_correct = 4.1826971e19; % ph/m2/sec/ster tol=.00001; Pass=rad_entry>rad_correct*(1- tol) & rad_entry<rad_correct*(1+ tol) & dt<100; assert(isequal(Pass,1))

Error: Undefined function or variable 'x'.

3   Fail
%% % Input: BB Temp, Lo Wavelength, Hi Wavelength, Integration steps % Output radiance in ph/m2/sec/ster % Nominal steps of 1000 yields accuracy and timeliness lo=8.0; hi=12.0; T=280.0; % Radiance = 1.37122128 e21 ph/m2/sec/ster ts=cputime; rad_entry=Calc_Radiance(lo,hi,T) tc=cputime; dt=1000*(tc-ts) % Processing Time in ms rad_correct = 1.37122128e21; % ph/m2/sec/ster tol=.00001; Pass=rad_entry>rad_correct*(1- tol) & rad_entry<rad_correct*(1+ tol) & dt<100; assert(isequal(Pass,1))

Error: Undefined function or variable 'x'.

4   Fail
%% % Input: BB Temp, Lo Wavelength, Hi Wavelength, Integration steps % Output radiance in ph/m2/sec/ster % Nominal steps of 1000 yields accuracy and timeliness % Add random to block answer writers lo=3.0+rand hi=5.0+rand T=250.0; % Radiance = To be calculated ph/m2/sec/ster c1p=1.88365e23; % sec^-1cm^-2micron^3 c2=1.43879e4; % micron K steps=1000; x=lo:(hi-lo)/steps:hi; % Planck Vectorized for Trapz y=1e8./(x.^4.*(exp(c2./(x.*T))-1)); % Leading 1e8 is for numerical processing accuracy z=trapz(x,y); rad_correct=z*1e4*c1p/pi()/1e8 % 1e4 normalizes from cm-2 to m-2 ts=cputime; rad_entry=Calc_Radiance(lo,hi,T) tc=cputime; dt=1000*(tc-ts) % Processing Time in ms tol=.00001; Pass=rad_entry>rad_correct*(1- tol) & rad_entry<rad_correct*(1+ tol) & dt<100; assert(isequal(Pass,1))

Error: Undefined function or variable 'x'.