MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Capture values that Min(imize)

  • To: mathgroup at smc.vnet.net
  • Subject: [mg117631] Capture values that Min(imize)
  • From: "1.156" <rob at piovere.com>
  • Date: Tue, 29 Mar 2011 06:50:15 -0500 (EST)

Hi, I finally found a way to get a list of c values from cList which 
minimize the err at each freq, f as below:

L=14.95;cList={2.2, 3.2, 6.9, 7.9};

err[f_,c_]:=(f-1/(2Pi Sqrt[L c*10^-6]))/f

Table[{f,Select[cList,(Abs[err[f,#]]==Min[Abs[err[f,#]]&/@cList])&]},{f,15,30}]

This works but looks horrible. Surely there's a slicker way to Minimize 
on a list and retain the value that achieved the minimum. I did try to 
stuff Reap/Sow in various places but everything I did threw error 
messages. Thanks for any pointers, Rob



  • Prev by Date: specifying further options to NMinimize method when using NonlinearModelFit
  • Next by Date: About C[i]
  • Previous by thread: Re: specifying further options to NMinimize method when using NonlinearModelFit
  • Next by thread: Re: Capture values that Min(imize)