MathGroup Archive 2011

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

Search the Archive

Re: Picking certain values from an array of solutions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg117990] Re: Picking certain values from an array of solutions
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Thu, 7 Apr 2011 08:06:40 -0400 (EDT)

final = {{}, {{F1 -> 0.935295, F2 -> 0.147373}}, {{F1 -> 0.547316, 
     F2 -> 0.147209}}, {{F1 -> 0.418004, 
     F2 -> 0.14704}}, {{F1 -> 0.353359, 
     F2 -> 0.146866}}, {{F1 -> 0.314582, F2 -> 0.146685}}};

Module[{t = Flatten[final]}, Select[t, #[[2]] == Min[t[[All, 2]]] &]]

{F2 -> 0.146685}


Bob Hanlon

---- Anna Kaladze <anna.kaladze at gmail.com> wrote: 

=============
Hi All,

I have solved a system of 2 equations for different values of a specific
paramater, entering each of those equations, and I get the answer in the
following form:


final = {{},{{F1=AE0.935295,F2=AE0.147373}},{{F1=AE0.547316,F2=AE0.147209}},{{F1=AE
0.418004,F2=AE0.14704}},{{F1=AE0.353359,F2=AE0.146866}},{{F1=AE0.314582,F2 =AE
0.146685}}}

where F1 and F2 are the variables I was solving for.

Now I need to get the minimum value F1/F2 takes in "final". That is, I need
the lowest number occuring in "final" to be returned and its associated
variable, be it F1 or F2. Obviously, for the above tuple the answer
is F2=0.146685, but I do not know what code to use to get the minimum for
any tuple like that.

Thanks a lot.

Anna.




  • Prev by Date: package construction
  • Next by Date: Re: Bug with map in conjuntion with plotstyle?
  • Previous by thread: Re: Picking certain values from an array of solutions
  • Next by thread: Re: Picking certain values from an array of solutions