To find the inverse of an implicit function

1.7k Views Asked by At

I have a function $t(f)$ here:

$t(f) = T(sin(2\pi f/B)/2\pi + f/B) $ for $[-B/2 \le f \le B/2]$. $B$ and $T$ are constants.

How to find the inverse of this function that is $f(t)$ using numerical methods.

Can you guide me.

Example parameters: $T = 100E-6,B = 2E6,t$ varies from -50E-6 to 50E-6.

1

There are 1 best solutions below

0
On

As I said in a comment, the problem is nicer setting $t=xT$ and $f=yB$. The equation becomes $$x=y+\frac{\sin (2 \pi y)}{2 \pi }$$ with $[0 \le y \le \frac{1}{2} ]$ since changing $y$ to $-y$ changes $x$ to $-x$.

There no analytical way to express $y$ as a function of $x$ and numerical methods, such as Newton should be used. If $$f(y)=y+\frac{\sin (2 \pi y)}{2 \pi }-x$$ the solution will be given by $$y_{n+1}=y_n-\frac{f(y_n)}{f'(y_n)}$$ with $$f'(y)=1+\cos (2 \pi y)$$ The problem is to find a "good" starting point. What I do propose here is to approximate $$\sin(z)=a z(\pi-z)$$ where $a=\frac{120}{\pi ^5}$ has been obtained minimizing with respect to $a$ $$\int_0^\pi\Big(\sin(z)-a z(\pi-z)\Big)^2 dz$$ So, the approximate solution will be obtained solving $$y+\frac{120}{\pi ^4} y (1 -2 y)-x=0$$ The valid solution is given by $$y=\frac{1}{480} \left(120+\pi ^4-\sqrt{\left(120+\pi ^4\right)^2-960 \pi ^4 x}\right)$$ from which can start Newton iterations using this last value as $y_0$.

For illustration purposes, let us consider the case where $x=0.4$; so $y_0=0.246049$ and the successive iterates are $0.241019$, $0.241094$ which is the solution for six significant figures. If instead $x=0.1$ was used, $y_0=0.0472713$ and the successive iterates are $0.0504148$, $0.0504196$ which is the solution for six significant figures.

So, the numerical inversion seems to be simple, fast and robust.

This could be improved if we use the appoximation $$\sin(x) \simeq \frac{16 (\pi -x) x}{5 \pi ^2-4 (\pi -x) x}$$ proposed by Mahabhaskariya of Bhaskara I, a seventh-century Indian mathematician. This would imply the resolution of a cubic equation in $y$ with only one real root; its analytic solution can be established using Cardano but its expression is too long and too complex to be reported here. For illustration, let us say that, for $x=0.4$, $y_0=0.241097$ and for $x=0.1$, $y_0=0.050312$ which are extremely close to the exact solutions.

To point out the accuracy of the method, the exact value $$\int_0^{\frac{1}{2}}y dx= \frac{1}{8}-\frac{1}{2\pi^2}\simeq 0.07434$$ while using the simplest approximation, the result is $$\frac{\pi^4(360-\pi^4)}{345600} \simeq 0.07401$$

In fact, the estimation looks to be so good that an higher order iterative method (Halley, Hoseholder,...) provides the solution immediately. For the same cases, increasing the order of the method give after a single iteration : $0.241019$, $0.241096$,$0.241094$,$0.241094$,$0.241094$ and $0.0504148$, $0.0504194$, $0.0504196$, $0.0504196$,$0.0504196$. So, one iteration of Householder method is sufficient and the process can be considered as analytical.