We need to plot the real and imaginary parts of a complex function $k(\omega)$, and cannot find a good way to do this without using "ad hoc tricks."


**Definitions**


* $k$ is a complex-valued function where both the real and the
imaginary parts are functions of $\omega$ so that $k(\omega) =
 \beta(\omega) - i\alpha(\omega)$, where $i$ is the imaginary unit.
* $\omega$ is a real-valued positive number.
* $\alpha(\omega) = -Im(k)$ is a positive real-valued function of the real variable
$\omega$.
* $\beta(\omega) = Re(k)$ is a positive real-valued function of the real variable
$\omega$.
* $a$ is a real constant number, $0<a<1$
* $A$ and $B$ are real constants.


**The relation between $k$ and $\omega$**


$[k(\omega)]^2 +A[k(\omega)]^{a+1} - B\omega^2 = 0$. $\qquad\quad$ (1)


So, what we really would appreciate help on is to find some water-proof method to plot $\beta = Re(k)$ and $\alpha = -Im(k)$ as functions of $\omega$ given the constants $a,A,B$ and the equation (1) above. Eq. (1) is a special kind of dispersion relation.


Any kind of help is greatly appreciated, we have spent too much time trying to figure this out already!



Howto plot a specific complex function
You can transform (1) into the equation of the flow of a 2-dimensional real vector field with time $\omega$ (just differentiate it with respect to $\omega$). Then you plug the resulting system into any solver of differential equation. If $\omega$ is to take complex values then matters can get harder, but as I understand your problem the method I suggest should work flawlessly.


EDIT: to take care of the problem of multivaluedness you mention, look for a vector field whose components are the modulus $\rho$ and the argument $\theta$ of $k$ so that you obtain a relation of the form


$\dot{\rho}+i\rho\dot{\theta}=\frac{2B\omega \exp(-2i\theta)}{2\rho+A(a+1)\rho^a\exp(i(a-1)\theta))}$


where you don't see the problem anymore. Then compute the real- and imaginary-part of the right-hand side of the equation. Finding an initial condition at $\omega=0$ is no problem.


