Speed me up! Limitation of FindMinimum?

*To*: mathgroup at smc.vnet.net*Subject*: [mg31072] Speed me up! Limitation of FindMinimum?*From*: Moranresearch at aol.com*Date*: Sat, 6 Oct 2001 03:33:18 -0400 (EDT)*Sender*: owner-wri-mathgroup at wolfram.com

Can anyone speed this up? It must iterate from c0 -.1 to c0 +.1 in 0.001 increments and K-.1 to K+.1 in 0.01 increments in the ORDER shown below. I could use FindMinimum but I would have to have a way of speciying exactly what values of the variables to try. de = {0.221, 0.452, 0.660, 0.890, 1.092, 1.320, 1.523, 1.748}; ce = {6.128, 6.129, 6.129, 6.132, 6.131, 6.130, 6.131, 6.131}; c0 = ce[[1]]; \!\(\(num = Length[ce];\)\[IndentingNewLine] data = Outer[List, Range[c0 - 0.1, c0 + 0.1, 0.001], \[IndentingNewLine]Range[\(-2\), 2, 0.01]]; errors = Apply[Function[{c0, K}, \[IndentingNewLine]Tr[ Abs[Sqrt[c0\^2 - K*de\^2] - ce]]\[IndentingNewLine]], data, {2}]; pos = First[Position[errors, Min[errors]]]; {bestc0, bestK} = Extract[data, pos]\) {6.129, -0.01}