Nothing works from this code
(*Xq is a function of kz and ky*)
kztemp = Range[0.1, Pi, 0.1]; len = Length[kztemp]; kytemp =
Table[0, {len}]; For[h1 = 1, h1 <= len,
h1++, {Xqtemp = Xq /. {kz -> kztemp[[h1]]},
temp = ky /.
Last[NMinimize[{Abs[Xqtemp], -Pi < ky < Pi}, ky,
MaxIterations -> 10000]],
kytemp[[h1]] = temp}
];
NMinimize::nnum: The function value Abs[Xq] is not a number at {ky} = {-2.82734}. >>
NMinimize::nnum: The function value Abs[Xq] is not a number at {ky} = {-2.82734}. >>
NMinimize::nnum: The function value Abs[Xq] is not a number at {ky} = {-2.82734}. >>
General::stop: Further output of NMinimize::nnum will be suppressed during this calculation. >>
what is Xq? It must be given in functional form to apply the rule kz-> kztemp[[h1]]
...