How to find the inverse of a function numerically

1.1k Views Asked by At

This is an extension of my previous question posted in here Inverse of a function of a 3rd order

Now, I have another one which seems to be more complicated. I don't know how to solve them numerically. The function is as follow

$$z(\zeta)=a\left(\frac{1}{\zeta}+m_1\zeta+m_2\zeta^2 \right)+b\left(\zeta+\frac{m_1}{\zeta}+\frac{m_2}{\zeta^2} \right)$$

in which $z$ is a complex number and cannot be zero. $m_k$, $a$ and $b$ are constant.

How to solve this function for $\zeta(z)$? I am a Matlab user so I would appreciate if someone can refer to any built-in Matlab function that can be used.

Example

The following $z(\zeta)$ is obtained using the following input: $$a=-2.08$$ $$b = 4.08$$ $$m_1 = 0.5$$ $$m_2 = -0.03$$ $$\zeta = cos\theta+i\sin\theta$$ for $\theta = [0,2\pi]$

for The results is:

z = [ 2.9400 + 0.0000i 3.2277 + 2.1618i 2.2730 + 1.2986i 0.4557 - 2.2605i -1.4094 - 6.6606i -2.3950 - 9.7020i -1.9857 -10.1025i -0.4083 - 7.8642i 1.5321 - 3.9596i 2.9400 - 0.0000i ]

Thanks!

1

There are 1 best solutions below

0
On BEST ANSWER

Scale your equation $$z=a\left(\frac{1}{\zeta}+m_1\zeta+m_2\zeta^2 \right)+b\left(\zeta+\frac{m_1}{\zeta}+\frac{m_2}{\zeta^2} \right)$$ by $\zeta^2$ and obtain the equivalent form $$z \zeta^2=a\left(\zeta+m_1\zeta^3+m_2\zeta^4 \right)+b\left(\zeta^3+m_1\zeta+m_2 \right),$$ which can be reordered into $$ 0 = am_2 \zeta^4+(am_1+b)\zeta^3-z\zeta^2+(bm_1+a)\zeta+bm_2.$$ The right-hand side is a polynomial in $\zeta$ of order at most $4$. MATLAB has a built-in function called roots which will compute all the roots of a polynomial by finding the eigenvalues of the companion matrix.