6

How to construct a catenary of a specified length through two specified points

I'm not sure how to add this to the community Wiki. Any suggestions appreciated.

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.

marty cohen
  • 107,799

4 Answers4

8

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])

marty cohen
  • 107,799
3

Many thanks for this interesting post !

Concerning the solution of $$A\, r - \sinh(A) = 0$$ which I worked many years ago, we found that is was "more" efficient from a numerical point of view to solve $$\log(r)=\log \left(\frac{\sinh (A)}{A}\right)$$ Using series expansion around $A=0$, series reversion and Padé approximants, we ended with $$A_0=t\, \frac{1+\frac{108929 }{1719960}t^2+\frac{145933 }{131342400}t^4 } {1+\frac{80263 }{1719960}t^2+\frac{1817401 }{4334299200}t^4 }\qquad \text{where} \qquad t=\sqrt{6 \log(r)}$$ Later, the model was optimized (trivial regression work) to $$A_1=t\, \frac{1+\frac{185 }{6073}t^2+\frac{1}{11780}t^4 } {1+\frac{101 }{7510}t^2+\frac{1}{173669} t^4}$$

In the table below, I report a few values $$\left( \begin{array}{ccc} r & A_0 & A_1 & A \\ 1.5 & 1.62213 & 1.62296 & 1.62213 \\ 2.0 & 2.17731 & 2.17862 & 2.17732 \\ 2.5 & 2.55263 & 2.55414 & 2.55265 \\ 3.0 & 2.83838 & 2.83996 & 2.83845 \\ 3.5 & 3.06949 & 3.07110 & 3.06962 \\ 4.0 & 3.26358 & 3.26520 & 3.26380 \\ 4.5 & 3.43085 & 3.43249 & 3.43117 \\ 5.0 & 3.57780 & 3.57945 & 3.57823 \\ 5.5 & 3.70878 & 3.71048 & 3.70935 \\ 6.0 & 3.82690 & 3.82865 & 3.82762 \\ 6.5 & 3.93444 & 3.93626 & 3.93532 \\ 7.0 & 4.03312 & 4.03502 & 4.03417 \\ 7.5 & 4.12427 & 4.12626 & 4.12550 \\ 8.0 & 4.20894 & 4.21104 & 4.21036 \\ 8.5 & 4.28799 & 4.29021 & 4.28959 \\ 9.0 & 4.36209 & 4.36444 & 4.36390 \\ 9.5 & 4.43184 & 4.43433 & 4.43385 \\ 10.0 & 4.49770 & 4.50033 & 4.49991 \\ 10.5 & 4.56007 & 4.56286 & 4.56250 \\ 11.0 & 4.61931 & 4.62226 & 4.62196 \\ 11.5 & 4.67571 & 4.67883 & 4.67857 \\ 12.0 & 4.72952 & 4.73281 & 4.73261 \\ 12.5 & 4.78097 & 4.78444 & 4.78428 \\ 13.0 & 4.83026 & 4.83390 & 4.83379 \\ 13.5 & 4.87755 & 4.88138 & 4.88131 \\ 14.0 & 4.92300 & 4.92702 & 4.92698 \\ 14.5 & 4.96674 & 4.97095 & 4.97096 \\ 15.0 & 5.00890 & 5.01331 & 5.01334 \\ 15.5 & 5.04958 & 5.05419 & 5.05426 \\ 16.0 & 5.08889 & 5.09369 & 5.09380 \\ 16.5 & 5.12690 & 5.13191 & 5.13205 \\ 17.0 & 5.16371 & 5.16893 & 5.16909 \\ 17.5 & 5.19939 & 5.20481 & 5.20500 \\ 18.0 & 5.23400 & 5.23962 & 5.23984 \\ 18.5 & 5.26760 & 5.27343 & 5.27367 \\ 19.0 & 5.30025 & 5.30629 & 5.30655 \\ 19.5 & 5.33200 & 5.33825 & 5.33854 \\ 20.0 & 5.36290 & 5.36936 & 5.36967 \end{array} \right)$$

Edit

As soon as $r>3$ (funny coincidence !) a very good approximation is $$A=-W_{-1}\left(-\frac{1}{2 r}\right)$$ Using Ioannis Chatzigeorgiou results $(2016)$ $$L(r)=\frac{1}{3}(1+2 \log (2 r))+ \sqrt{2\log \left(\frac{2 r}{e}\right)} < -W_{-1}\left(-\frac{1}{2 r}\right)< \log (2 r)+ \sqrt{2\log \left(\frac{2r}{e}\right)}=R(r) $$ Now, minimizing $$S(\alpha)=\int_{\frac e 2}^{20} \Big[W_{-1}\left(-\frac{1}{2 r}\right)+\alpha L(r)+(1-\alpha) R(r) \Big]^2\,dr$$ shows a minimum at $\alpha=0.733$. So, a rather good approximation could be $$\color{red}{A=\frac{1}{4}(1+3\log (2 r))+ \sqrt{2\log \left(\frac{2 r}{e}\right)}}$$ which in fact seems to be usable $\forall r \geq \frac e 2$.

I guess that a couple of Newton iterations could be sufficient.

Trying for $r=\pi$ would give $$\left( \begin{array}{cc} n & A_n \\ 0 & 2.92292 \\ 1 & 2.90865 \\ 2 & 2.90849 \end{array} \right)$$

Close to $r=2$ $$r A-\sinh(A) \sim \frac 1 {50}+\frac 18 (r-2)+\frac 1{25} (r-2)^2+O\left((r-2)^3\right)$$

  • Very nice! I hadn't thought of taking the logs and also have not used Pade approximations, though I have certainly been aware of them. – marty cohen Feb 24 '20 at 15:53
2

In the same spirit as @marty cohen, hoping that others MSE users could find it useful, I would like to continue with some numerical aspects to show that we almost have the analytical solution of the equation $$r A=\sinh(A)$$ As shown above, looking for the zero of function $$f(A)=\log \left(\frac{\sinh (A)}{A}\right)-\log(r)$$ a simple initial estimate was proposed $$A_{(0)}=\frac{1}{4}(1+3\log (2 r))+ \sqrt{2\log \left(\frac{2 r}{e}\right)}$$ that was claimed to be valid $\forall r \geq \frac e 2$.

Taking into account the fact that the successive derivatives of the function are simple $$f'(A)=\coth (A)-\frac{1}{A}\qquad f''(A)=\frac{1}{A^2}-\text{csch}^2(A)\qquad f'''(A)=2 \coth (A) \text{csch}^2(A)-\frac{2}{A^3}$$ and very unexpensive to compute, we can perform one single iteration of Newton, Halley or Householder methods to have better and better estimates. $$\left( \begin{array}{cccccc} & \text{initial}& \text{Newton}& \text{Halley}& \text{Householder} & \text{solution} \\ r & A_{(0)} & A_{(1)}& A_{(2)}& A_{(3)}& A \\ 1.5 & 1.518058955 & 1.624805609 & 1.622019863 & 1.622135275 & 1.622131218 \\ 2.0 & 2.168691033 & 2.177329432 & 2.177318956 & 2.177318985 & 2.177318985 \\ 2.5 & 2.561105529 & 2.552662107 & 2.552654742 & 2.552654724 & 2.552654724 \\ 3.0 & 2.852199091 & 2.838462204 & 2.838446437 & 2.838446380 & 2.838446380 \\ 3.5 & 3.084867197 & 3.069640710 & 3.069624211 & 3.069624149 & 3.069624149 \\ 4.0 & 3.278894970 & 3.263810402 & 3.263796152 & 3.263796102 & 3.263796102 \\ 4.5 & 3.445319207 & 3.431185373 & 3.431174115 & 3.431174079 & 3.431174079 \\ 5.0 & 3.590992780 & 3.578243212 & 3.578234832 & 3.578234809 & 3.578234808 \\ 5.5 & 3.720483219 & 3.709358711 & 3.709352803 & 3.709352789 & 3.709352789 \\ 6.0 & 3.836994613 & 3.827628679 & 3.827624764 & 3.827624756 & 3.827624756 \\ 6.5 & 3.942863994 & 3.935326973 & 3.935324584 & 3.935324581 & 3.935324581 \\ 7.0 & 4.039849447 & 4.034172963 & 4.034171678 & 4.034171677 & 4.034171677 \\ 7.5 & 4.129307221 & 4.125498516 & 4.125497965 & 4.125497965 & 4.125497965 \\ 8.0 & 4.212305702 & 4.210356412 & 4.210356274 & 4.210356274 & 4.210356274 \\ 8.5 & 4.289701560 & 4.289593256 & 4.289593256 & 4.289593256 & 4.289593256 \\ 9.0 & 4.362192230 & 4.363900024 & 4.363899925 & 4.363899925 & 4.363899925 \\ 9.5 & 4.430353057 & 4.433847992 & 4.433847594 & 4.433847595 & 4.433847595 \\ 10.0 & 4.494664202 & 4.499914865 & 4.499913996 & 4.499913997 & 4.499913997 \\ 10.5 & 4.555530517 & 4.562504137 & 4.562502650 & 4.562502652 & 4.562502652 \\ 11.0 & 4.613296487 & 4.621959693 & 4.621957462 & 4.621957466 & 4.621957466 \\ 11.5 & 4.668257648 & 4.678576987 & 4.678573904 & 4.678573909 & 4.678573909 \\ 12.0 & 4.720669420 & 4.732611716 & 4.732607687 & 4.732607695 & 4.732607695 \\ 12.5 & 4.770754042 & 4.784286639 & 4.784281585 & 4.784281596 & 4.784281596 \\ 13.0 & 4.818706064 & 4.833796992 & 4.833790845 & 4.833790860 & 4.833790860 \\ 13.5 & 4.864696758 & 4.881314837 & 4.881307538 & 4.881307558 & 4.881307558 \\ 14.0 & 4.908877675 & 4.926992584 & 4.926984084 & 4.926984108 & 4.926984108 \\ 14.5 & 4.951383557 & 4.970965869 & 4.970956123 & 4.970956153 & 4.970956153 \\ 15.0 & 4.992334726 & 5.013355921 & 5.013344894 & 5.013344930 & 5.013344930 \\ 15.5 & 5.031839063 & 5.054271535 & 5.054259195 & 5.054259238 & 5.054259238 \\ 16.0 & 5.069993667 & 5.093810708 & 5.093797028 & 5.093797078 & 5.093797078 \\ 16.5 & 5.106886237 & 5.132062021 & 5.132046980 & 5.132047037 & 5.132047037 \\ 17.0 & 5.142596243 & 5.169105807 & 5.169089384 & 5.169089450 & 5.169089449 \\ 17.5 & 5.177195925 & 5.205015138 & 5.204997319 & 5.204997393 & 5.204997393 \\ 18.0 & 5.210751141 & 5.239856679 & 5.239837451 & 5.239837534 & 5.239837534 \\ 18.5 & 5.243322090 & 5.273691408 & 5.273670761 & 5.273670853 & 5.273670853 \\ 19.0 & 5.274963949 & 5.306575249 & 5.306553174 & 5.306553276 & 5.306553275 \\ 19.5 & 5.305727406 & 5.338559609 & 5.338536100 & 5.338536213 & 5.338536212 \\ 20.0 & 5.335659140 & 5.369691856 & 5.369666909 & 5.369667032 & 5.369667031 \end{array} \right)$$

Concerning the case of small velues of $r$, we can make the approximation $$r=\frac{1+\frac{76}{613}A^2}{1-\frac{57}{1298}A^2}$$ which gives $$A_{(0)}=\sqrt{\frac{795674 (r-1)}{19 (1839 r+5192)}}$$ and do the same work with the original function.

1

WLOG, assume $x_2>x_1$.

Let $L$ be the length of the catenary between $(x_1,y_1)$ and $(x_2,y_2)$

Define:

$$S=x_2-x_1$$

$$h=y_2-y_1$$

$$A(t)=\frac{S}{2t}$$

$$B(t)=\frac{S}{2}+A(t)\sinh^{-1}\left(\frac{he^{t}}{A(t)(1-e^{2t})}\right)$$

Such that $t$ is the solution to $$L=2A(t)\sinh\left(t\right)\sqrt{1+\left(\frac{he^{t}}{A(t)\left(1-e^{2t}\right)}\right)^{2}}=A(t)\sinh\left(\frac{S-B(t)}{A(t)}\right)+A(t)\sinh\left(\frac{B(t)}{A(t)}\right)$$

Then the equation for the catenary is

$$ \boxed{ y=A(t)\left(\cosh\left(\frac{x-B(t)-x_{1}}{A(t)}\right)-\cosh\left(\frac{B(t)}{A(t)}\right)\right)+y_{1} }$$

Let k be the solution to $0=x\cosh\left(\frac{x_{1}-x_{2}}{x}\right)-|y_{2}-y_{1}|-x$

If $L>k\sinh\left(\frac{x_{2}-x_{1}}{k}\right)$ then the lowest point of the catenary will occur between $x_1$ and $x_2$

If $L=k\sinh\left(\frac{x_{2}-x_{1}}{k}\right)$ then the lowest point of the catenary will occur at whichever is lower of the two endpoints

If $L<k\sinh\left(\frac{x_{2}-x_{1}}{k}\right)$ then the lowest point of the catenary will occur outside of the interval from $x_1$ to $x_2$

Simon M
  • 657