I have an Mathematica code whoch goes like this:
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 = 600/(w - 0.01)^2 + (400000 (w - 0.01)^2)/(k^2*0.125 ((w - 0.01)^2 - 0.25));
(*First way*)
hello = Table[{k, NSolve[first - second - third == 0, w]}, {k, 0.01,1, 0.01}]
(*Second way*)
eqn = NSolve[first - second - third == 0, w];
hello = Table[{k, eqn}, {k, 0.01, 1, 0.01}]
(*Third way*)
rt := (r = Solve[ first - second - third == 0, w];
s = Evaluate[w /. r];
Return[s])
Table[{k, rt}, {k, 0.01, 1, 0.01}]
I have some question in this regard:
- From an analytical point of view you can see that for a single value of k, 8 different omegas are posibble. For k=0.01, first way, second way and third way are giving 8 omegas. But at some places, for e.g 0.7, first way gives you 4 roots, on the other hand second way and third way gives 8 roots. I have to tell you that 4 roots which are given by first way are still included in second and third way. Why/ What is this happening?
- I want to export this to a dat file, with first colum with k, next column with real value of first w, next with imaginary of first w, next with real of second omega, etc... How can I do that? Simple export is not helping me.
By the by, I am using Mathematica 9.
Thanks in advance