Inverse of k = x/cosh(x)

177 Views Asked by At

Question inspired from Matt's video, The bubble that break maths
Bubble shape is a cosh function: $\quad y = a \cosh((x-b)/a) $

With symmetry, we can reduce formula to: $ (R/r) = \cosh(H/r) $
where r = bubble minimum radius, R = bubble maximum radius

To simplify further, let $x = H/r\,,\,k = H/R :$

$x\,/\,k = \cosh(x)\quad\quad→ k = x\,/\cosh(x) $

Bubble will burst when $k > max(x/\cosh(x)) = 0.66274\,34193\,...$
This limited domain of $x = [0\,, 1.1996\, 78640\,...]$

Solving x from k is trivial, if we use iterations, say, Newton's method.
But, if we only need 3 digits accuracy, can we have a direct formula ?

Here is my attempt, by fitting a quadratic, and back solve for x
Points at x = 0.0, 0.4, 1.2:

$k ≈ -0.46590\,x^2 + 1.1114\,x$
$x ≈ 1.1927 - \sqrt{1.4225 - 2.1464\,k}$

Using Matts video example: $x|_{k = {0.25\over0.534}} ≈ 0.5465$
Convert back to bubble minimum radius: $r = {H \over x} ≈ {0.25 \over 0.5465} ≈ 0.4575$ meter

Actual minimum radius is 0.4652 meter, error of 1.7%
We can fit more points, but solving for k will involve solving for cubic (or higher) roots.

Any idea ?

5

There are 5 best solutions below

3
On BEST ANSWER

Empirical model

Based on observation a simple model could be $$x=x_*-\sum_{n=1}^m a_n (k_*-k)^{\frac n 2}$$ where $$x_*=1.1996786402577338339 \qquad \text{and}\qquad k_0=0.66274341934918158097$$

Using $m=4$, we have $R^2 > 0.9999999$ and, as shown below, the parameters are highly significant $$\begin{array}{llll} \text{} & \text{ Estimate} & \text{Std Error} & \text{Confidence Interval} \\ a_1 & +1.7259717 & 0.000259 & \{+1.725464,+1.726480\} \\ a_2 & -0.7108628 & 0.001734 & \{-0.714265,-0.707461\} \\ a_3 & +0.4140864 & 0.003610 & \{+0.407005,+0.421168\} \\ a_4 & +0.0944479 & 0.002348 & \{+0.089842,+0.099054\} \\ \end{array}$$

Making the coefficients rational (just to look nicer) $$a_1=\frac{844}{489} \qquad a_2=-\frac{445}{626} \qquad a_3=\frac{535}{1292} \qquad a_4=\frac{131}{1387}$$ Now, some results $$\left( \begin{array}{ccc} k & x_{\text{est}} & x_{\text{sol}}\\ 0.00 & 0.000803 & 0.000000 \\ 0.05 & 0.050126 & 0.050063 \\ 0.10 & 0.100237 & 0.100505 \\ 0.15 & 0.151403 & 0.151730 \\ 0.20 & 0.203958 & 0.204184 \\ 0.25 & 0.258338 & 0.258392 \\ 0.30 & 0.315123 & 0.315008 \\ 0.35 & 0.375113 & 0.374883 \\ 0.40 & 0.439457 & 0.439204 \\ 0.45 & 0.509914 & 0.509740 \\ 0.50 & 0.589397 & 0.589388 \\ 0.55 & 0.683413 & 0.683588 \\ 0.60 & 0.805069 & 0.805292 \\ 0.65 & 1.013290 & 1.013080 \end{array} \right)$$

Required accuracy obtained.

4
On

The solution of $$ x \,\text{sech}(x)=k$$ cannot be explicit and then either numerical methods or approximations.

In your problem, what is interesting is the fact that the range of $x$ is quite limited. Assuming $k \geq 0$, $x$ varies between $0$ and $x_*$ corresponding to the maximum value of the lhs. $x_*$ is the solution of $$x \tanh(x)=1 \implies e^{-2x}=\frac{x-1}{x+1}$$ and then $x_*$ is explicit in terms of the generalized Lambert function. So, the maximum value of $k$ is $$k_{\text{max}}=\frac{\sqrt{x_*^2-1} }{x_*}\coth ^{-1}(x_*)$$

We can expand $ x \,\text{sech}(x)$ as an infite series $$ x \,\text{sech}(x)= \sum_{n=0}^\infty \frac{E_{2 n}}{(2 n)!} x^{2n+1}$$ we can use series reversion to any order. This will give $$x_{(p)}= \sum_{n=0}^p a_n \, k^{2n+1}+O\left(x^{2p+2}\right)$$ The first coefficients make the sequence $$\left\{1,\frac{1}{2},\frac{13}{24},\frac{541}{720},\frac{9509}{8064},\frac{7231801}{ 3628800},\frac{1695106117}{479001600},\frac{567547087381}{87178291200},\frac{3676 0132319047}{2988969984000},\cdots\right\}$$

To judge the quality, using the limited truncated series given above, give $x$ a value; from it compute $k$ and from $k$ recompute $x$. Here are the results $$\left( \begin{array}{cc} x_{\text{given}} &x_{\text{recomputed}}\\ 0.00 & 0.00000000 \\ 0.05 & 0.05000000 \\ 0.10 & 0.10000000 \\ 0.15 & 0.15000000 \\ 0.20 & 0.20000000 \\ 0.25 & 0.25000000 \\ 0.30 & 0.30000000 \\ 0.35 & 0.34999998 \\ 0.40 & 0.39999980 \\ 0.45 & 0.44999859 \\ 0.50 & 0.49999245 \\ 0.55 & 0.54996756 \\ 0.60 & 0.59988397 \\ 0.65 & 0.64964481 \\ 0.70 & 0.69904911 \\ 0.75 & 0.74773420 \\ 0.80 & 0.79512362 \\ 0.85 & 0.84040336 \\ 0.90 & 0.88254661 \\ 0.95 & 0.92039514 \\ 1.00 & 0.95278735 \\ 1.05 & 0.97870666 \\ 1.10 & 0.99741676 \\ 1.15 & 1.00855418 \\ 1.20 & 1.01216141 \end{array} \right)$$

For sure, above $x=0.75$, the agreement is not fantastic but, again, we could add as many terms as we want. More coefficients on request.

For your example where $k=\frac{125}{267}$, this would give $x=0.537391$ while the solution given by Newton method is $x=0.537414$ (relative error of $0.0043$%). Thsi does not seem too bad.

Edit

As shown above, the approximation is not very good for large alues of $x$. What we can do is to perform a single iteration of Halley method which would give as a better estimate $$x_1=x_0+\frac{4 (x_0-k \cosh (x_0)) (x_0 \sinh (x_0)-\cosh (x_0))}{k x_0 (\cosh (2 x_0)-3)-4 \sinh (x_0) (k \cosh (x_0)+x_0)+2 \left(x_0^2+2\right) \cosh (x_0)}$$ $x_0$ being given by the series.

For example, for $x_{\text{given}}=1$, this will give $x_1=0.999460$ which is much better.

Update

For large values of $x$, we can make a series expansion around $x=1$, inverse it and obtain $$x=1+t+\frac{e^4+6 e^2-3 } {4(1+e^2)}t^2+\frac{3 e^8+32e^6+74e^4-32e^2+19}{24 \left(1+e^2\right)^2}t^3 +O(t^4)$$ where $$t=\frac{1}{2} \left(1+e^2\right) \cosh (1) (k-\text{sech}(1))$$

2
On

If x not too big, $k = x\,/\,\cosh(x) ≈ \tanh(\sin(x))$

$x\,/\,\cosh(x)\; = x - {1\over2}x^3 + {5\over24}x^5 - {61\over720}x^7\;+\;...$

$\tanh(\sin(x)) = x - {1\over2}x^3 + {37\over120}x^5 - {29\over144}x^7\;+\;...$

This approximation is easily reverted.

For Matt's video example, $k = 0.25/0.534 ≈ 0.4682$
$x ≈ \sin^{-1}(\tanh^{-1}(k)) ≈ 0.5325$

True x ≈ 0.5374, estimated x has error of 0.9%

0
On

From iteration formula, $x = k \cosh(x)$, x may have this form:

$x = K \cosh(K)\qquad$ // for some K, a function of k

Matching reverted formula of $\;x/\cosh(x)$, we have:

$\large K = k + {1\over2}k^5 + {43\over40}k^9 + {1\over1890}k^{11} + {80887\over25200}k^{13} \;+\;...$

Nice !
No k^3 and k^7 terms. Also, k^11 term has tiny coefficient.
To simplify more, let's try Pade approximation.

$\large k\left({20-33\,k^4 \over 20-43\,k^4}\right) = k + {1\over2}k^5 + {43\over40}k^9 + {1849\over800}k^{13} \;+\;...$

Using above Pade approximation of K, for Matt's example:

$k\,=\,0.25\,/\,0.534 ≈ 0.468165$
$K ≈ k\left({20-33\,k^4 \over 20-43\,k^4}\right) ≈ 0.480705 $
$x\,=\,K\,\cosh(K)\,≈ 0.537323\qquad$ // error 0.017%

0
On

Too long for comments

Your idea of writing $x=K \cosh[K]$ is very interesting. Using more terms, we have $$K= k + {1\over2}k^5 + {43\over40}k^9\Bigg[1+ \sum_{n=1}^p a_n\,k^{2n}+O\left(k^{2p+2}\right)\Bigg]$$ the first $a_n$ making the sequence $$\left\{\frac{4}{8127},\frac{80887}{27090},\frac{1094}{446985},\frac{303072008131}{2 9286457200},\frac{4165543}{406756350},\frac{12966607541077}{331913181600},\cdots\right\}$$

You do not need to use the fact that the coefficient of $k^{11}$ is small since the exact $[5,4]$ Padé approximant is effectively $$P_{[5,4]}=k\,\frac{ 33 k^4-20}{43 k^4-20}$$

Where I see a problem is that, using $p=20$, for $k=0.6$, we have $x=0.804726$ which is less accurate than the previous empirical calculation. Using the $P_{[5,4]}$ Padé approximant,we should have $x=0.798749$, the exact solution being $x=0.805292$. So, still the same problem when $k$ tends to approch $k_*$.