Find elevator height given rope length? This question is deceptively difficult. I feel like it's probably some classic example somewhere, but I'm not sure how to describe it in enough detail to get valid results in searching online. 
Problem Statement

There is an elevator, which is pulled up by a rope. The rope wraps around the pulley (shown in the picture) before accumulating on the elevator wire drum. The pulley diameter $r$ is known and the distance from the pulley to vertical $x$ is known.
The elevator rope makes some wrap around the pulley ($\theta$) before travelling to the center of the top of the elevator. Assume there is an identical setup on the other side with identical setup and parameters. 
Given the length of payed out rope $L$, equal to the blue + green lengths shown in the image, what is the height $y$ of the elevator?
My Approach
The section in blue is equal to the rope wrapped around the pulley and the section in green is equal to the total rope length minus that amount. Defining the green section to be $a$ and the blue section to be $b$:
$$
L = a + b \\
b = r \theta \\
L = a + r\theta \\
a = L - r\theta \\
$$
Also, by similar triangles, the angle between green and vertical is also equal to $\theta$. Now, updating the drawing with this information:

Treating the green section as a hypotenuse, there are effective legs $y'$ and $x'$, where:
$$
y' = y - r\sin{\theta} \\
x' = x + r\cos{\theta} \\
$$
Then, using Pythagorean Theorem and the definition of $a$ above:
$$
a = \sqrt{(x')^2 + (y')^2} \\
L - r\theta = \sqrt{(x + r\cos{\theta})^2 + (y - r\sin{\theta})^2}
$$
But this alone doesn't buy me much because I don't know $y$ or $\theta$. Two unknowns, one equation. 
I tried to find an expression for $\theta$ by exploiting the fact that the angle between $a$ and vertical is equal to the angle of wrap. I define a $b'$, which is equal to the path $a$ would have taken past the pulley had there been no wrap:
$$
b' = r \tan{\theta} \\
$$
Now there's an $L'$, which is equal to $a + b'$, which again is a length laid from the pivot tangent to the pulley instead of wrapping around the pulley. There's also an $r'$, which is the distance from the middle of the pulley to this new $L'$-horizontal vertex:
$$
r' = r \sec{\theta} \\
r' = \frac{r}{\cos{\theta}} \\
$$

And now, where previously the horizontal distance was $x + r$, now it's $x + r'$, and I can state:
$$
L'\sin{\theta} = (x + r') \\
(a + b')\sin{\theta} = (x + \frac{r}{\cos{\theta}}) \\
(a + r\tan{\theta})\sin{\theta} = (x + \frac{r}{\cos{\theta}}) \\
(L - r\theta +  r\tan{\theta})\sin{\theta} = (x + \frac{r}{\cos{\theta}}) \\
$$
$$
(L + r(\tan{\theta} - \theta))\sin{\theta} = (x + \frac{r}{\cos{\theta}}) \\
$$
This is the best I can get at an expression for $\theta$, but Matlab is unable to find an explicit solution for $\theta$. With no expression for $\theta$, I can't solve for $y$ in the earlier equation. 
Is there any closed form solution to this problem, or do the functions of $\theta$ mean I'm stuck using a numeric solver?
 A: It appears that it is not possible to obtain the answer in the closed form, which is frequently the case in the problems involving the rope wraping around a pulley. Below are my thoughts on the solution. First of all, we can relate $x, r, L, \theta$ in one relatively "simple" equation:
$\sin\theta = \frac{x+r\cos\theta}{L-r\theta}$, or $L\sin\theta = x+r(\cos\theta + \theta\sin\theta)$.
And this is the troubling point, since $\theta$ enters this equation both itself and as an argument of the trigonometric function. This is a transcendental equation, which does not support a solution in the closed form. One, however, can obtain approximate solution assuming $\theta$ to be small if $x,r\ll L$ and expanding $\sin\theta$ and $\cos\theta$ in Taylor series. But, generally, numerical way is the only option.
Next, one can relate $y$ and $\theta$ (similarly to how the author did in the post):
$y = (L-r\theta)\cos\theta + r\sin\theta = x\cot\theta+r\csc\theta$,
which can be found easily after computing $\theta$.
Hope this helps.
