This page walks through solving the cutoff section version of the
classic truncated triangular room problem,
stated in general terms. The problem is to find the dimensions and size of the
largest rectangular box that can be constructed in a truncated triangular room of given dimensions,
but where that room has a third "wall" along the hypotenuse of the floor of the room.
Such a triangular room still has a right triangle for its floor.
Its three walls are trapezoids. The roof is still a triangle. An image of such a room,
placed at the origin of a rectangular coordinate system is:
We will solve this problem using the method of Legrange multipliers.
We start with the volume of the box:
`V(x,y,z) = x**y**z` | (1) |
`bb(vec (DC)) xx bb(vec (DE)) = (: bd-bc, ae-ac, - ab :)`
` abd - abc - abd = bbL`
` -abc = bbL `
so
`( bd-bc ) x + ( ae-ac ) y + ( - ab )z = -abc`
or
`( bc-bd ) x + ( ac-ae ) y + ( ab )z = abc`
`g(x,y,z) = ( bc-bd ) x + ( ac-ae ) y + ( ab )z - abc` | (2) |
so
`-abd = bbM`
or
`bd x + ad y = adb `
`h(x,y,z) = bd x + ad y - adb ` | (3) |
At this point we have the three functions V, g, and h, where we are looking to maximize V subject to the constraints of g and h. The Legrange method looks at having `lambda` and `mu` where
`gradV(x_0,y_0,z_0) = lambda * gradg(x_0,y_0,z_0) + mu*gradh(x_0,y_0,z_0)` | (4) |
`gradg(x,y,z) = (bc-bd) vec(i) + (ac-ae) vec(j) + ab vec(k)`
`gradh(x,y,z) = bd vec(i) + ad vec(j) + 0 vec(k)`
Then, based upon (4) we will have to have each of the following three equations be true:
`yz = lambda(bc-bd) + mu(bd)` | (5) |
`xz = lambda(ac-ae) + mu(ad)` | (6) |
`xy = lambda(ab)` | (7) |
`( bc-bd ) x + ( ac-ae ) y + ( ab )z = abc` | (8) |
`bd x + ad y = adb ` | (9) |
Multiply (5) by `a` and multiply (7) by `(c-d)` to get
`ayz - (c-d)xy = abd mu` | (10) |
`bxz - (c-e)xy = abd mu` | (11) |
`0 = bxz + (e-d)xy -ayz` | (12) |
`y = (-bd x)/(ad) + (abd)/(ad)`
`y = (-b)/a x + b` | (13) |
`(bc - bd) x + -bcx + bex + abc - abe + abz = abc`
`bcx - bdx - bcx + bex + abz = abe`
`b(e - d) x + abz = abe`
`abz = b(d - e) x + abe`
`z = (d-e)/a x + e` | (14) |
`x = (2ae -ad +- a sqrt(d^2 - de + e^2) )/(3(e - d))` | (15) |
Substituting this value of `x` in (14) gives:
`z = (d + e +- sqrt(d^2 - de + e^2) )/3` | (16) |
Substituting (15) into (13) gives:
`y = (be - 2bd +- b sqrt(d^2 - de + e^2) )/(3(e - d))` | (17) |
Thus we have equations (15), (16), and (17) that allow us to determine the values of `x`, `y`, and `z` from the values of a, b, c, d, and e in the original problem. In a real problem it would be easier to find the value of `x` from (15) and then use that value along with (13) and (14) to find the values of `y` and `z`. Once we have all three values, the value of the volume is just `x*y*z`.
As a small example, consider the room formed by A=(7,0,0), B=(0,4,0), C=(0,0,8), D=(7,0,3), and E=(0,4,5). Using the nomenclature from the diagram at the start of this page, this give a=7, b=4, c=8, d=3, and e=5. From this and using (15) we get `x=(49+-7sqrt(19))/6` or `x~~13.25204877` or `x~~3.081284566`. Of these, clearly the first is not feasible so the second is the only answer. Then using (13) and (14), we get `y~~2.23926312` and `z~~4.11963156` so the volume is approximately `28.42474401`.
Looking at the following table of volumes, based upon values for `x` and `y`, and recognizing that these are values at specific points in the domain, and that values are rounded to 5 decimal places, we have even more confidence in our results:
x: y | 3.0811 | 3.0812 | 3.0813 | 3.0814 | 3.0815 |
2.2390 | 28.42192 | 28.42234 | 28.42277 | 28.4232 | 28.42363 |
2.2391 | 28.42267 | 28.4231 | 28.42353 | 28.42396 | 28.42439 |
2.2392 | 28.42342 | 28.42385 | 28.42428 | 0 | 0 |
2.2393 | 28.42417 | 28.4246 | 0 | 0 | 0 |
2.2394 | 0 | 0 | 0 | 0 | 0 |
Unfortunately, there is a major problem with our solution. This is illustrated by another specific example, namely, A=(19,0,0), B=(0,18,0), C=(0,0,20), D=(19,0,1), and E=(0,18,2). Using the nomenclature from the diagram at the start of this page, this give a=19, b=18, c=20, d=1, and e=2. From this and using (15) we get `x=(57+-3sqrt(3))/3` or `x~~29.96965511` or `x~~8.030344885`. Of these, clearly the first is not feasible so the second is the only answer. Then using (13) and (14), we get `y~~10.39230485` and `z~~1.577350269` so the volume is approximately `131.6358614`. However, looking at the following table of volumes, based on values for `x` and `y` we can see a major problem.
x: y | 8.0290 | 8.0295 | 8.0300 | 8.0305 | 8.0310 |
10.3880 | 132.03051 | 131.99703 | 131.96354 | 131.93005 | 131.89655 |
10.3885 | 131.99516 | 131.96168 | 131.92818 | 131.89469 | 131.86118 |
10.3890 | 131.95981 | 131.92632 | 131.89282 | 131.85932 | 131.82581 |
10.3895 | 131.92445 | 131.89096 | 131.85746 | 131.82395 | 131.79044 |
10.3900 | 131.88909 | 131.85559 | 131.82209 | 131.78858 | 131.75506 |
10.3905 | 131.85373 | 131.82022 | 131.78671 | 131.7532 | 131.71968 |
10.3910 | 131.81836 | 131.78485 | 131.75133 | 131.71781 | 131.68429 |
10.3915 | 131.78298 | 131.74947 | 131.71595 | 131.68243 | 131.6489 |
10.3920 | 131.7476 | 131.71409 | 131.68057 | 131.64704 | 0 |
10.3925 | 131.71222 | 131.6787 | 131.64518 | 0 | 0 |
10.3930 | 131.67684 | 131.64331 | 0 | 0 | 0 |
10.3935 | 131.64145 | 0 | 0 | 0 | 0 |
10.3940 | 0 | 0 | 0 | 0 | 0 |
x: y |
6.50 | 6.55 | 6.60 | 6.65 | 6.70 | 6.75 | 6.80 |
6.5 | 295.7500 | 295.8963 | 296.0100 | 296.0913 | 296.1400 | 296.1563 | 296.1400 |
6.55 | 295.8963 | 296.0273 | 296.1255 | 296.1910 | 296.2238 | 296.2238 | 296.1910 |
6.60 | 296.0100 | 296.1255 | 296.2080 | 296.2575 | 296.2740 | 296.2575 | 296.2080 |
6.65 | 296.0913 | 296.1910 | 296.2575 | 296.2908 | 296.2908 | 296.2575 | 296.1910 |
6.70 | 296.1400 | 296.2238 | 296.2740 | 296.2908 | 296.2740 | 296.2238 | 296.1400 |
6.75 | 296.1563 | 296.2238 | 296.2575 | 296.2575 | 296.2238 | 296.1563 | 296.0550 |
6.80 | 296.1400 | 296.1910 | 296.2080 | 296.1910 | 296.1400 | 296.0550 | 295.9360 |
All of which goes to show that one cannot just apply rules and formuli.
©Roger M. Palay
Saline, MI 48176
July, 2012