Hi So I have the following list:
data = {{3.73324*10^10 + 147881. s + 1. s^2, 1}, {3.73324*10^10 + 357017. s + 1. s^2, 1}}
(this is a short example, in this case the list has only two elements, but this is part of a big scheme of things)
I want to order the elements of this list based on a parameter Q
Q1 = Sqrt[CoefficientList[data[[1]][[1]], s][[1]]]/CoefficientList[data[[1]][[1]], s][[2]]
Q2 = Sqrt[CoefficientList[data[[2]][[1]], s][[1]]]/CoefficientList[data[[2]][[1]], s][[2]]
I want to order it by increasing values of Q so, in this case the elements should be swapped. What is the best way to do this in systematic way using sort? I have tried this but failed miserably, probably due to syntax:
Sort[FactorsDen, Sqrt[CoefficientList[#1[[2]][[1]], s][[1]]]/CoefficientList[#1[[2]][[1]], s][[2]]< Sqrt[CoefficientList[#2[[2]][[1]], s][[1]]]/CoefficientList[#2[[2]][[1]], s][[2]] &]
Any guess on how can I do this in an easy way? Thank you!