I need an equation that expresses $x$ in function of $a$ and $b$.
$$\sinh(ax) = bx$$
I'm a newbie in mathematics, and i don't know where to get help. I need to get this problem solved in order to implement a catenary calculator.
I need an equation that expresses $x$ in function of $a$ and $b$.
$$\sinh(ax) = bx$$
I'm a newbie in mathematics, and i don't know where to get help. I need to get this problem solved in order to implement a catenary calculator.
This kind of equations, which mix polynomial and trigonometric or hyperbolic terms do not show analytical solutions (beside the trivial $x=0$) and only numerical methods should be used.
If you want me to elaborate on this topic, just post.
Please notice that we can write the equation in a more simple form changing variable $ax=y$ to get $$\sinh(y)=c y$$ As written, it is simple to notice that the function is symmetric and only one root has to be looked for (corresponding to the intersection of the two curves defined by the lhs and rhs).
Added later
As said above, solving for $x$, $\sinh(ax)=bx$ is the same as solving $\sinh(y)=c y$ using $y=ax$ and $c=\frac b a$ and this makes the problem easier to handle.
For a better understanding of what happens, I suggest you plot on the same graph both functions $\sinh(y)$ and $cy$ for different values of $c$ (say $c=\frac 12$, $c=2$ , $c=4$). You will notice that $y=0$ is always a solution but that, for $c>1$, two other solutions exist and they are symmetric (if $y$ is a solution of the equation, $-y$ is the other).
So, I shall now focus on the positive solution and discard all cases where $c \leq 1$ for which only the trivial solution $y=0$ exists.
In other words, we are now looking for the zero of the function $$f(y)=\sinh(y)-c y$$ where $y>0$ and $c>1$.
For solving nonlinear equations, the simplest root-finding method is probably Newton which, starting from a reasonable guess $x_0$, will update it according to the iterative scheme $$y_{n+1}=y_n-\frac {f(y_n)}{f'(y_n)}$$ So, for the problem $$f'(y)=\cosh (y)-c$$ $$y_{n+1}=\frac{\sinh (y_n)-y_n \cosh (y_n)}{c-\cosh (y_n)}$$
For a first illustration purpose, let us consider $c=10$ and assume that $y_0=5$. The scheme described above will then give the following iterates : $4.62306$, $4.50897$, $4.49997$, $4.49991$ which is the solution for six significant figures.
Now, the problem is to find the reasonable starting value $y_0$. When you look at the derivative $f'(y)$, it cancels for $y=\cosh ^{-1}(c)$ which corresponds to a minimum of the function [this is confirmed by the second derivative test $f''(y)=\sinh(y)$]; for this value of $y$, $f(y) <0$; so we need to choose $y_0 >\cosh ^{-1}(c)$ in order to ensure convergence.
An estimate could be obtained expanding $f(y)$ as a Taylor series built at $y=0$; this gives $$f(x)=(1-c) y+\frac{y^3}{6}+\frac{y^5}{120}+O\left(y^6\right)$$ and solving for $y$ reduces to a quadratic eqaution in $y^2$, the largest root of which being $$y=\sqrt{2} \sqrt{\sqrt{5} \sqrt{6 c-1}-5}$$ For $c=10$, this would give $y_0=4.93469$.
For $c=100$, the estimate would be $9.97262$ and using this value for starting Newton, the iterates would be $9.05714$, $8.24945$ , $7.64936$, $7.34955$, $7.28641$, $7.28400$ which is the solution for six significant figures. For larger values of $c$, this estimate will become poorer and poorer.
If you have to solve many times this equation using a computer program, what I would suggest is to create and store a table $(y,c=\frac{\sinh(y)}{y})$. From this table, select the $c$ closest to the value you need to use and take the corresponding $y$ as $y_0$; from here, start Newton scheme.
Added after Marty Cohen's answer
For large values of $c$, we can approximate $$\sinh(y)\approx \frac{e^y}{2}$$ and the solution of $$\frac{e^y}{2}= cy$$ is given by $$y=-W_{-1}\left(-\frac{1}{2c}\right)$$ where appears the second branch of Lambert function. The value of $W_{-1}(d)$ can be approximated using, for first order, $$W_{-1}(d)=L_1-L_2+\frac{L_2}{L_1}+\frac{L_2(L_2-2)}{2L_1^2}$$ where $L_1=\log(-d)$, $L_2=\log\big(-\log(-d)\big)$. This is very similar to what Marty Cohen proposed in his answer.
So,
Added still later
For large values of $c$, the approximation derived from Lambert function provide extremely good estimates.
For $1 \lt c \leq 10$, a good approximation of the solution was found from the Pade[3,4] approximant of $\sinh(y)-cy$ built at $y=0$. This leads to $$y \approx \sqrt{\frac{42(c-1) (3 c+7)}{3 c^2+36 c+31}}$$ For $c=1.1$, the approximation is $0.763402$ while the solution is $0.763401$; for $c=2$, the approximation is $2.17895$ while the solution is $2.17732$; for $c=10$, the approximation is $4.49891$ while the solution is $4.49991$.
Yep. As I found many years ago (1996 or so), this is what you need to solve to determine the equation of a catenary of a given length through two given points.
Here is what I came up with to solve this problem (copied with editing from the document I wrote):
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 - \frac{ \sinh A_n - r A_n }{\cosh A_n - r} $$ 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$ $$ 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.