Lab: One Dimensional Vectors Question 1 (15 Minutes) : Solar Radiation Spectrum Modeling
Lab: One Dimensional Vectors Question 1 (15 Minutes) : Solar Radiation Spectrum Modeling
Lab: One Dimensional Vectors Question 1 (15 Minutes) : Solar Radiation Spectrum Modeling
The radiation emitted by the sun is called the solar radiation. Solar radiation is a
source of energy and it can be converted into electrical energy if the radiation lands
on a device such as a solar cell. In this question, we will learn how to model the
solar radiation using Planck’s Law.
Figure 1 below shows the solar radiation at various wavelengths, such plot is a
histogram or a spectrum (when the x-axis is frequency). The spectrum below
shows the solar radiation at various heights above the earth’s sea level. As you can
see, solar radiation is greatest (yellow region) at the top of the atmosphere and is at
a minimum (red region) at the sea level, this is due to the attenuation that photons
experience as they travel through the earth’s atmosphere. The valleys for the (red)
spectrum at the sea level are due to absorption by water and carbon dioxide
molecules. The smooth curve is the spectrum of a black body at 5250 degree
Celsius based on Planck’s law. Planck’s law is described in the next paragraph. We
see that the sun can be modeled as a black body.
Planck’s law describes the electromagnetic radiation emitted from a black body at
temperature specified in Kelvin. A black body is an object that absorbs incident
radiation across all wavelengths (thus it is called a black body) and emits thermal
radiation across a continuous frequency spectrum based on the object’s
temperature. Planck’s law is:
2 π c2 h 1
R ( λ , T )=
λ5 ( e
(hc)
(λkT )
−1 )
Where λ is the wavelength in meters, c = 3 ×108 meter /second is speed of light,
1) Using Planck’s law, write a MATLAB script to plot the spectral radiance of a
black body at T=5700 degrees Celsius from 0 to 2000 nanometers (nm). Label the
x-axis, y-axis, and the title of your plot correctly with units. (xlabel(), ylabel(),
title()) Hint: “aVec = [0:2:100]” is a one-dimensional vector from 0 to 100 at
intervals of 2. 0 is the starting point, 100 is the end point, and 2 is the step size.
When the TA runs your program, a plot should pop-up on the window. The plot
should be labeled.
2) Now we will learn how to use MATLAB’s built-in function to find the
wavelength that gives maximum radiance. We will use the function ‘max’.
At MATLAB’s prompt, type ‘help max. Read through the output to learn how to
use this function. Note: in the future, you can type ‘help <function-name>’ to learn
about built-in functions. Try, ‘help plot’, ‘help title’, ‘help exp’…
If ‘X’ is an one dimensional vector, ‘max(X)’ will return the largest element in ‘X’.
For example, if ‘X=[1 2 5 3.2 0]’, ‘max(X)’ will return 5.
Now, max(X) can also return the index (location) of the maximum value in ‘X’.
If you type ‘[y i] = max(X)’ at the command prompt, ‘y’ will contain the maximum
value in vector ‘X’, and ‘i’ will contain the index in ‘X’ that contains the maximum
value.
Hint: in part 1), you have defined an array for the x-values (wavelength), and another array for
the y-values (radiance) of the graph. Use the ‘max’ function on the y-values, identify the
corresponding location of the y-maxima, and use that location to extract the corresponding x-
value.
Now, use the above approach to determine the wavelength that gives maximum
solar radiance. Report the wavelength value in meters.
When the TA runs your program, a line displaying the answer should appear in
MATLAB’s command prompt. See below for example.
Example: (this is just an example, the wavelength value here may not be correct)
3) Repeat problem 2) using the four temperatures (T1 to T4) given below.
Hint1: plot the spectrums first to help you estimate the range of wavelengths where the solutions
might lie. Think about changing the step size and the range of the wavelength vector.
Hint2: ‘wavelength = [0:1e-9:1000e-9];’ is a vector from 0 to 1000 nanometers with a step size
of 1 nm. ‘length(wavelength)’ returns 1001.
T2 = 3 Giga ( 109 ) Kelvin – the core of a massive star on its last day
Again, when the TA runs your program, a line displaying the answer should appear
in MATLAB’s command prompt, similar to the example in 2)
Lab: One Dimensional Vectors
At the UC Davis Robert Mondavi Institute Winery, there are four water tanks
capable of capturing and storing 176,000 gallons of rainwater. The stored water is
treated on-site, and is used for vineyard irrigation and cooling of fermentation
tanks. Figure 2 below is a picture of the four storage tanks.
In this question, you will perform some analysis of the rainwater capture and
storage system if it is implemented in another city. The Excel database for this lab
contains precipitation data for many cities. Your teaching assistant will tell you
which city to use. Answer all tasks in this question using the data for this city.
Task 1: Enter the precipitation data into a single vector. This vector should have a
length of 12.
Task 3: Given the precipitation data, calculate the amount of total rain fall in a year
for the city you are assigned. The land area of each city is also given in the Excel
Lab: One Dimensional Vectors
database. Give answer with units in both liters and gallons. (1 liter = 0.001 cubic
meters; 1 gallon = 3.78 liters)
Hint: You are calculating a volume quantity here. Precipitation data is the height.
Task 4: You would like to install a similar system. The tanks will be connected to a
rain water collector on the roof with a collection area of 10 feet by 30 feet.
Calculate the amount of rain water that can be collected by this system in a year.
Give answer with units in both liters and gallons.
In Table 1 below, daily water usage in a home equipped with efficient water
fixtures with minimal leakage is listed. (Handbook of Water Use and Conservation,
2001)
Task 5: Enter the daily usage data in Table 1 into a 1D vector. Convert the data
from gallons into liters.
Task 6: Calculate the yearly water usage for each activity. (liters)
Task 7: Calculate the amount of water one person uses in a year. (liters)
Task 8: Assuming the water usage profile in Table 1, what is the area of the
rainwater collector in order to meet the demands for a family of 5 people? Assume
same usage for all five people.
Lab: One Dimensional Vectors
One concept used in meteorology, and HVAC (Heating, Ventilation, and Air
Conditioning) analysis and design is degree-day (DD). There are two types of DD,
heating and cooling DD. For heating, DD is defined as the average daily
temperature in degrees Fahrenheit below 65 degrees for one day.
DDheating =( 65 ℉−Temperature average )∗(1 day )
Example: If on July first, the average temperature that day was 90F, then
DD cooling = 90 – 65 = 25 degree-day. If for the entire month of July, average
daily temperature was also 90F, then the total DD cooling for this month is
equal to (90-65)*31 days = 775 degree-days.
Cooling and heating degree day numbers for various cities are given in the Excel
database for this lab. Your teaching assistant will tell you which four cities to use
for calculations below, and whether to use cooling or heating degree-day for all
four cities.
Task 1: Enter the degree-day data into 4 vectors, each with 12 elements. Let each
vector represent a city.
Task 2: For each city, calculate the average temperature for each month.
Note: Remember the degree-day data given to you is for one month, while the
formulas shown are for one day.