Graphics Programs Reference
In-Depth Information
differential equations; and AModelofTrafficFlow , differential equations, lin-
ear algebra, and familiarity withthe function e z for z a complex number. Even
if you don't have the background for a particular example, you should be able
to learn something about MATLAB from the M-book.
Illuminating a Room
Suppose we need to decide where to put light fixtures on the ceiling of a
room, measuring 10 meters by 4 meters by 3 meters high, in order to best
illuminate it. For aesthetic reasons, we are asked to use a small number of
incandescent bulbs. We want the bulbs to total a maximum of 300 watts. For
a given number of bulbs, how should they be placed to maximize the
intensity of the light in the darkest part of the room? We also would like to
see how much improvement there is in going from one 300-watt bulb to two
150-watt bulbs to three 100-watt bulbs, and so on. To keep things simple, we
assume that there is no furniture in the room and that the light reflected
from the walls is insignificant compared with the direct light from the
bulbs.
One 300-Watt Bulb
If there is only one bulb, then we want to put the bulb in the center of the
ceiling. Let's picture how well the floor is illuminated. We introduce
coordinates x running from 0 to 10 in the long direction of the room and y
running from 0 to 4 in the short direction. The intensity at a given point,
measured in watts per square meter, is the power of the bulb, 300, divided by
4 π times the square of the distance from the bulb. Since the bulb is 3 meters
above the point (5, 2) on the floor, we can express the intensity at a point
( x, y ) on the floor as follows:
syms x y; illum = 300/(4*pi*((x - 5)ˆ2 + (y - 2)ˆ2 + 3ˆ2))
illum =
75/pi/((x-5)ˆ2+(y-2)ˆ2+9)
We can use ezcontourf to plot this expression over the entire floor. We
use colormap to arrange for a color gradation that helps us to see the
Search WWH ::




Custom Search