I wrote this in about 1994
and thought others might find it useful.
It was hand-converted
from LaTeX to MathJax,
so there is some awkwardness.
Many books state, and some show
(e.g., [1]),
that the equation of a catenary,
the curve formed by a uniform string
hanging between two points, is
$f(x) = a \cosh(x/a)$.
(According to [2], this problem was considered by 1646
and independently solved in 1691 by John Bernoulli,
Huygens, and Leibnitz.)
However, this solution assumes
that the curve is in standard position
with its lowest point above $x=0$.
In this paper, I will show how to find the parameters for the
actual equation of the catenary of a given length
passing through two given points.
To allow for the catenary to be centered at any point,
we write its equation as
$\begin{equation}
f(x) = a \cosh \left( \frac{x-b}{a} \right) + c, \tag{fdef}\label{fdef}
\end{equation}
$
where $b$ is the center of the curve and
$c$ is the vertical offset from the origin.
The parameters from which the catenary is to be specified
are the length of the curve $L$,
and the two points through which it must pass,
$(x_1, y_1)$ and $(x_2, y_2)$.
For a curve $y=f(x)$
to satisfy these conditions, it must
satisfy
$\begin{eqnarray}
f(x_1) & = & y_1, \tag{val1}\label{val1} \\
f(x_2) & = & y_2, \tag{val2}\label{val2}
\end{eqnarray}
$
and
$\begin{equation}
\int_{x_1}^{x_2} \sqrt {1+(f'(x))^2} dx = L. \tag{int}\label{int}
\end{equation}
$
All necessary information
about hyperbolic functions
is contained in
Appendix B.
Let $dy = y_2-y_1$ and $dx = x_2-x_1$.
We assume that
$ L^2 \gt dx^2 + dy^2$;
this means that the string is long enough to hang between the points.
Substituting (\ref{fdef}) into (\ref{int})
we get
$\begin{equation}
L = a \left[ \sinh \left( \frac {x_2-b} a \right)
- \sinh \left( \frac{x_1-b} {a}
\right) \right]. \tag{L}\label{L}
\end{equation}
$
Subtracting (\ref{val1}) from (\ref{val2}),
$\begin{equation}
dy = a \left[ \cosh \left( \frac {x_2-b} a \right)
- \cosh \left( \frac {x_1-b} a \right) \right]. \tag{dy}\label{dy}
\end{equation}
$
Let
$\overline{x} = (x_1+x_2)/2$,
$A = dx/2a$,
and
$B = (\overline{x} -b)/a$.
(\ref{L}) and (\ref{dy}) become
$\begin{eqnarray}
L & =& 2 a \cosh \left( \frac{x_2+x_1-2b} {2a} \right)
\sinh \left( \frac{x_2-x_1} {2a} \right) \\
&=& 2 a \cosh(B) \sinh(A) \label{L2}\tag{L2} \\
{\rm and} ~~ dy &=& 2 a \sinh(B) \sinh(A). \label{dy2}\tag{dy2}
\end{eqnarray}
$
Therefore
$\begin{equation}
L^2 - dy^2 = 4a^2\sinh^2(A). \label{L2-dy2}\tag{L2-dy2}
\end{equation}
$
Let
$ r = \sqrt { L^2 - dy^2 } / {dx}$.
(\ref{L2-dy2}) becomes
\begin{equation}
r = \sinh ( A ) / A. \label{rA}\tag{rA}
\end{equation}
Since $L^2 > dx^2 + dy^2$, $r > 1$
so that \ref{rA} can be solved for $A$.
(A method for doing this is given in appendix A.)
Once this is done, we get $a = dx/2A$.
Dividing (\ref{dy2}) by (\ref{L2}),
$dy/L = \tanh(B)$,
or $\tanh^{-1}(dy/L) = B = (\overline{x}-b)/a$,
so that
$\begin{equation}
b = \overline{x} - a\tanh^{-1}(dy/L). \label{b}\tag{b}
\end{equation}
$
Note that if $dy = 0$,
then $b = \overline{x}$ as it should
--- if the two points have the same y value, then the center
of the catenary is exactly between them.
The only parameter left to determine is c,
for which there are a number of possible formulae. The basic
ones are, for $i$ = 1 and 2
(from (\ref{val1}) and (\ref{val2})),
$\begin{equation}
c = y_i - a \cosh((x_i-b)/a). \label{c12}\tag{c12}
\end{equation}
$
To get a formula that is symmetric in the points,
we average (\ref{c12})
and get the following series of equations, where
$\overline{y} = (y_1 + y_2)/2$:
$\begin{eqnarray*}
c & = & \overline{y}
- \frac{a}{2} \left[ \cosh \left( \frac{x_1 - b}{a} \right)
+ \cosh \left( \frac{x_2-b}{a} \right) \right] \\
&=& \overline{y}
- \frac{a}{2} \left[ 2 \cosh \left( \frac{x_1+x_2-2b}{2a} \right)
\cosh \left( \frac{x_2-x_1}{2a} \right) \right] \\
&=& \overline{y} - a \cosh(B) \cosh(A) \\
&=& \overline{y} - a \cosh ( \tanh^{-1} (dy/L) ) \cosh(A) \\
&=& \overline{y} - \frac{a\,L} {r\, dx} \cosh(A) \\
&=& \overline{y} - \frac{a\,L} {(\sinh(A)/A) (2 a A)} \cosh(A) \\
&=& \overline{y} - \frac{L}{2 \tanh(A)}.
\end{eqnarray*}
$
We thus have the following recipe:
To find the values of a, b, and c
that makes (\ref{fdef}) pass through points $(x_1, y_1)$ and $(x_2, y_2)$
with length L between the points, do this:
Let
$\begin{eqnarray*}
dx & = & x_2 - x_1, \\
\overline{x} & = & (x_1 + x_2)/2, \\
dy & = & y_2 - y_1, \\
{\rm and}~\overline{y} & = & (y_2 + y_1)/2.
\end{eqnarray*}
$
If $L^2 \le dx^2 + dy^2$,
there is no solution ---
the points are too far apart.
Otherwise, continue and let
$r = \sqrt { L^2 - dy^2 }/ dx$.
Solve $r = \sinh(A)/A$ for $A$ ($A > 0$ since $r > 1$).
Then
$\begin{eqnarray*}
a &=& { {dx} / {2 A} }, \\
b &=& \overline{x} - a \tanh^{-1}(dy/L), \\
c &=& y_i - a \cosh((x_i-b)/a) ~~ (i{\rm ~= 1 ~ or ~ 2}) \\
&{\rm or}\\
c&=& \overline{y} - \frac{L}{2 \tanh(A)}.
\end{eqnarray*}
$
Appendix A. Solving $r = \sinh(A)/A$ for $A$.
Write the equation $r = \sinh(A)/A$
as $A r - \sinh(A) = 0$
and apply Newton's iteration.
This is
$
A_{n+1} = A_n - \dfrac{ \sinh A_n - r A_n }{\cosh A_n - r} \nonumber
$
which is to be applied until
$\mid r - \sinh(A_n)/A_n \mid$
is small enough.
To get the initial value for the iteration, use
$\begin{eqnarray*}
A_0 & =& \sqrt { 6 (r - 1) }~ {\rm if}~ r < 3, \\
A_0 &=& \ln(2 r) + \ln \ln(2r)~ {\rm otherwise}.
\end{eqnarray*}
$
This will take at most 5 iterations to get
$\left| r - \sinh(A_n)/A_n \right| < 10^{-10}r$.
The boundary ($r<3$) was decided by numeric experimentation.
The first initial value, for small r,
is gotten from the expansion valid for small $A$
of $ r = \sinh(A)/A \approx 1 + A^2/6.$
The second initial value, for large r,
is gotten by noting that, for large $A$,
$\sinh(A) \approx e^A/2$, so that
$r = \sinh(A)/A$ is equivalent to
$2Ar \approx e^A$ or
$A \approx \ln(2r) + \ln(A).$
If we consider this an iteration for $A$,
starting with $A=1$, we first get
$ A \approx \ln(2r) $
and then get
$A \approx \ln(2r) + \ln\ln(2r).$
Further substitutions do not improve this much.
Appendix B. Hyperbolic function facts
The first three are definitions; all the others follow from them.
\begin{equation}
\cosh(z) = (e^z + e^{-z})/2 \label{coshdef}
\end{equation}
\begin{equation}
\sinh(z) = (e^z - e^{-z})/2 \label{sinhdef}
\end{equation}
\begin{equation}
\tanh(z) = \sinh(z)/\cosh(z) \label{tanhdef}
\end{equation}
\begin{equation}
\sinh^{-1}(z) = \ln(z + \sqrt{z^2+1}) \label{sinh-1def}
\end{equation}
\begin{equation}
\cosh^{-1}(z) = \ln(z + \sqrt{z^2-1}) \label{cosh-1def}
\end{equation}
\begin{equation}
\tanh^{-1}(z) = \frac{1}{2} \ln\left(\frac{1+z}{1-z}\right)
\label{tanh-1def}
\end{equation}
\begin{equation}
\cosh^{\prime}(z) = \sinh(z) \label{cosh'}
\end{equation}
\begin{equation}
\sinh^{\prime}(z) = \cosh(z) \label{sinh'}
\end{equation}
\begin{equation}
1 + \sinh^2(z) = \cosh^2(z) \label{1+sinh^2}
\end{equation}
\begin{equation}
\sinh(u) - \sinh(v) = 2 \cosh \left( \frac{u+v}{2} \right)
\sinh \left( \frac{u-v}{2} \right) \label{sinh-sinh}
\end{equation}
\begin{equation}
\cosh(u) - \cosh(v) = 2 \sinh \left( \frac{u+v}{2} \right)
\sinh \left( \frac{u-v}{2} \right) \label{cosh-cosh}
\end{equation}
\begin{equation}
\cosh(u) + \cosh(v) = 2 \cosh \left( \frac{u+v}{2} \right)
\cosh \left( \frac{u-v}{2} \right) \label{cosh+cosh}
\end{equation}
\begin{equation}
\cosh(\tanh^{-1}(z)) = 1/\sqrt{1-z^2} \label{coshtanh-1}
\end{equation}
\begin{equation}
\tanh(\sinh^{-1}(z)) = 1/\sqrt{1+1/z^2} \label{tanhsinh-1}
\end{equation}
References
[1] H.S.M. Coxeter, Introduction to Geometry,
John Wiley and Sons, Inc.,
New York, 1961, 317-319.
[2] John Stilwell,
Mathematics and Its History,
Springer-Verlag, New York, 1989, 171-173.
([email protected])