I have a 3D pipe-fitting problem for which I was able to write the following equations:
$$ y = \tan (a)\sqrt{x^2 + z^2}\\ z = \tan (b)\sqrt{x^2 + y^2}\\ y = \sin (a)\sqrt{x^2 + y^2 + z^2}\\ z = \sin (b)\sqrt{x^2 + y^2 + z^2} $$
$x > 0$ and known; $y$ and $z \ge 0$; $0 < a$, $b < 90º$
what choices for $a$ and $b$ will minimize $y + z$?
if $a$ and $b$ are constrained to $45º$, $22.5º$ or $11.25º$, what choices minimize $y + z$?
I tried rearranging and combining these equations, and I got: $$ y = \frac{x \sin(a)}{\sqrt{cos^2(a) - sin^2(b)}}\\ z = \frac{x \sin(b)}{\sqrt{cos^2(b) - sin^2(a)}} $$
But these equations behave strangely: as $a$ and $b$ go to $0$, $y$ and $z$ go to $0$; and in my problem, that means the pipes never meet.
Here is the physical problem: I have a vertical pipe, and a pipe aligned on the $z$-axis, separated by a fixed horizontal distance $x$. The length of the pipes can be varied. I need to connect the ends with one pipe and $2$ fittings from $0º$ to $90º$.
There is an easy solution with one $45º$ fitting, and one $90º$ fitting, but I am trying to avoid it.
So, did I model the problem correctly? Were my reduced equations correct? I am also having trouble seeing which variables are independent. Any help would be appreciated.