Using math for interior decorating with lamps

2.7k Views Asked by At

When I was in college, I owned three lamps and had a dark apartment. I kept trying to position them in different areas of the room, but it was still dark. Then I decided to model the problem with math: given three light sources of equal strength in a rectangular solid of a room, where can you place them to maximize the average value of the amount of light reaching a point in the solid?

Then I realized that the asymptotes at the light bulbs themselves would make the average diverge.

Recently, I thought of a reformulation:

Given three light sources in a rectangular solid of a room (assume height of ten feet, width of 15 and length if 25),all at height 6 ft., where should they be placed to maximize the average value (Edit: Minimum value) of the intensity of the light on the plane at height 3.5 ft.? (Since the couches are that height).

Alternatively, if someone can give a more accurate reformulation of this problem (perhaps involving reflections of the wall) and solve it, that would be much cooler.

1

There are 1 best solutions below

13
On BEST ANSWER

It's not super hard to write down a model for your problem. Performing the numerical optimization is a bit of a challenge, however!

The basic idea

Here's the simplest approach to the originally stated problem not including reflection. Given lamp locations $(x_1,y_1)$, $(x_2,y_2)$, and $(x_3,y_3)$, together with a point $(x,y,z)$ in the room, we denote the intensity of the light at the point by

$$i_{x_1,y_1,x_2,y_2,x_3,y_3}(x,y,z) = \sum_{k=1}^3 \frac{1}{(x-x_k)^2+(y-y_k)^2+(z-6)^2}.$$

This simply states the well known fact that intensity of light a distance $d$ from a light source is proportional to $1/d^2$. I assume also that intensity is additive.

Then, given $(x_1,y_1)$, $(x_2,y_2)$, and $(x_3,y_3)$, we would define $m(x_1,y_1,x_2,y_2,x_3,y_3)$ to be the minimum value of $i_{x_1,y_1,x_2,y_2,x_3,y_3}(x,y,z)$ subject to the restrictions that $0\leq x \leq 25$, $0\leq y \leq 15$, and $0\leq z\leq 10$. (In the reformulated problem, we have $z=3.5$. This seems to reduce the complexity by one dimension, but a natural guess for the original problem was that the minimum would occur on the floor.)

Finally, maximize $m(x_1,y_1,x_2,y_2,x_3,y_3)$ subject to $0\leq x_k \leq 25$ and $0\leq y_k \leq 15$.

Reducing the search space

Unfortunately, the numerics are quite challenging. We first minimize $i$ as a function of 2 variables to obtain a numerically defined function which we then maximize as a function of 6 parameters. It would be particularly good if we could reduce the number of parameters. This can be done assuming the solution has some sort of symmetry. Given the symmetry of the room, it seems quite likely that the ideal configuration has displays one of the two following symmetries:

enter image description here

Assuming the former, we have $x_2=12.5$, $x_3=25-x_1$, and $y_3=y_1$ in $i_{x_1,y_1,x_2,y_2,x_3,y_3}$, with $x_1$, $y_1$ and $y_2$ free. Assuming the latter, we have $x_3=x_1$, $y_2=7.5$, and $y_3=15-y_1$. In either case, the computation of $m$ now involves the minimization of a numerically computed function of 3 variables. Running a Nelder-Mead constrained optimizer in Mathematica takes minute or so, as opposed to my original approach which took much longer.

I should point out that I have no proof that the correct configuration has this shape - it's just intuition, originating from the fact that my initial approach yielded a shape very much like configuration one.

At any rate, implementing this plan in Mathematica, I came up with a room arrangement that looks something like so:

enter image description here

The lamp locations are approximately: $(5,4.37)$, $(12.5,11.69)$, and $(20,4.37)$. Using the intensity function above, this yields a minimum in the middle of the front wall of about $0.0315224$.

Reflection

It's not much harder to implement Willie Wong's suggested approach to deal with reflection. The $i$ equation becomes

$$i_{x_1,y_1,x_2,y_2,x_3,y_3}(x,y,z) = \sum_{j,\ell=-\infty}^{\infty} \sum_{k=1}^3 \frac{a^{|j|+|\ell|}}{(x-(x_{j,k}-25j))^2+(y-(y_{\ell,k}-15\ell))^2+(z-6)^2},$$

where

$$x_{j,k} = \frac{1}{2} \left(1+(-1)^j\right) x_k+\frac{1}{2} \left(1-(-1)^j\right) \left(25-x_k\right)$$ and $$y_{\ell,k} = \frac{1}{2} \left(1+(-1)^{\ell }\right) y_k+\frac{1}{2} \left(1-(-1)^{\ell }\right) \left(15-y_k\right).$$

Note that $x_{k,j}$ is simply either $x_k$ or its reflection $25-x_k$, depending on whether $j$ is even or odd.

The constant $a$ is between zero and one and is called albedo or the reflection coefficient. I took $a=1/2$, though I have no real data on what would be appropriate. Of course, we also must truncate the sum. In my code, I allowed $j$ and $\ell$ to run from $-3$ to $3$. I have not considered reflection off of the floor or ceiling. Perhaps the floor is carpeted and the ceiling has some non-reflective stucco or some such.

Taking all this into account, I came up with the following room:

enter image description here

Asteroids

If we use the somewhat simpler expression for $i$:

$$i_{x_1,y_1,x_2,y_2,x_3,y_3}(x,y,z) = \sum_{j,\ell=-\infty}^{\infty} \sum_{k=1}^3 \frac{a^{|j|+|\ell|}}{(x-(x_k-25j))^2+(y-(y_k-15\ell))^2+(z-6)^2},$$

we obtain an asteroids style, wrap-around room:

enter image description here

The lamp locations now are approximately: $(1.269,1.756)$, $(12.5,10.76)$, and $(23.73,1.756)$. Using the intensity function above, this yields a minimum of about $0.0613712$ at the point $(12.5, 2.291)$.