0
$\begingroup$

The following produces a list of solutions for $n = 2$ to $n = 30$. Given this list, how do I extract combinations of the $n$ values and solutions to create a ListLinePlot?

expr[n_] := V1/4 + (f V1)/4 + 1/(4 (-1 + n) Gamma[1/2 (-1 + n)]^2) n^(1/2 (-3 - n)) (f V1)^(1/
    2 (-1 + n)) ((-1 + n) n^(3/2) V1^(3/2) Gamma[
     1/2 (-1 + n)]^2 (2 Sqrt[
       f] (-1 + n) (n/(f V1))^(n/2) - (1 + 
        n) (n/V1)^(n/2) Hypergeometric2F1[1/2 (-1 + n), -1 + n, n,
        1 - f]) - 
  2 (-1 + n)^2 Sqrt[n] (n/V1)^(n/2) V1^(3/2) Gamma[
    1/2 (-1 + n)] Gamma[(1 + n)/2] Hypergeometric2F1[n, (1 + n)/2,
     1 + n, 1 - f] + (-5 + n) V1 Gamma[
    1/2 (-5 + 
       n)] (n Gamma[(3 + n)/
        2] (2 (-1 + n) (n/(f V1))^((1 + n)/2) V1 - 
        f (-3 + n) (n/V1)^((1 + n)/2) V1 Hypergeometric2F1[-1 + 
           n, (3 + n)/2, n, 1 - f]) - 
     2 f (-1 + n) (n/V1)^((1 + n)/2) V1 Gamma[(5 + n)/
        2] Hypergeometric2F1[n, (5 + n)/2, 1 + n, 1 - f])); With[{V1 = 1}, r = Table[{n, f /. FindMinimum[expr[n], {f, 1}]}, {n, Complement[Range[2, 30, .1], {3., 5.}]}]];
$\endgroup$
1
$\begingroup$

I am not quite sure which form you want. So I tried 2 cases. You could always do (I reduced the number of entries here).

V1 = 1;
r = Table[{n, z0 = FindMinimum[expr[n], {f, 1}]; f /. z0[[2]]}, {n, 
   Complement[Range[2, 3, .1], {3., 5.}]}]

This gives

Mathematica graphics

Or

V1 = 1;
r = Table[{n, z0 = FindMinimum[expr[n], {f, 1}]; z0[[1]], 
   f /. z0[[2]]}, {n, Complement[Range[2, 3, .1], {3., 5.}]}]

Which gives

Mathematica graphics

Pick the list you want. z0 in the Table is just a temporary variable, introduced to make it easy to manipulate the result, right inside the Table on the fly.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.