MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

# Solution 88506

Submitted on 14 May 2012 by Richard Zapor

Correct

63Size
`This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.`

### Test Suite

Test
Code Input and Output
1
Pass

```%%
% Input: BB Temp, Lo Wavelength, Hi Wavelength, Integration steps
% 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;
tc=cputime;
dt=1000*(tc-ts) % Processing Time in ms
tol=.00001;
assert(isequal(Pass,1))
```
```rad_entry =
4.9612e+18
dt =
20.0000
```
2
Pass

```%%
% Input: BB Temp, Lo Wavelength, Hi Wavelength, Integration steps
% 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;
tc=cputime;
dt=1000*(tc-ts) % Processing Time in ms
tol=.00001;
assert(isequal(Pass,1))
```
```rad_entry =
4.1827e+19
dt =
0
```
3
Pass

```%%
% Input: BB Temp, Lo Wavelength, Hi Wavelength, Integration steps
% 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;
tc=cputime;
dt=1000*(tc-ts) % Processing Time in ms
tol=.00001;
assert(isequal(Pass,1))
```
```rad_entry =
1.3712e+21
dt =
10.0000
```
4
Pass

```%%
% Input: BB Temp, Lo Wavelength, Hi Wavelength, Integration steps
% Nominal steps of 1000 yields accuracy and timeliness
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;
tc=cputime;
dt=1000*(tc-ts) % Processing Time in ms
tol=.00001;
```lo =