From an analytical point of view, you should really consider solving your equation analytically. This can be done by
ClearAll["Global`*"]
first = 1 + 17000000/k^2 + 5000000/k^2 + 868670/k^2;
second = 14000/w^2 + (5000000 w^2)/(k^2*(w^2 - 1));
third = Rationalize[600/(w - 0.01)^2 + (400000 (w - 0.01)^2)/(k^2*0.125 ((w - 0.01)^2 - 0.25))];
roots = w /. Solve[first - second - third == 0, w];
If you look at roots
you see that it contains Root
objects with unspecified k
. This is perfectly fine, since we can evaluate them by plugging in values for k
inside your Table
. Since you are interested in a separation of real and imaginary part, we can do this directly in the table by using ReIm
. Flattening out the result, gives you exactly what you want to export as one line: the k
in the front and then all roots.
data = Table[Flatten@{k, ReIm /@ roots}, {k, 0.01, 1, .01}];
Export["tmp/roots.dat", data, "Table"]
That should be it.