4
$\begingroup$

The data in the following is structured like this $\{\cdot,\{\cdot,\cdot\}\}$, but I need it like this $\{\cdot,\cdot,\cdot\}$. How do I do this?

termTwo[k_,α_,θ_,A_] := Sum[((1+A^2)Cos[m θ](Sin[(m k)/2])^2)/m^(1+α), {m, 1, 200}]
termOne[k_,θ_,α_,A_]:= Sum[((1+A^2)Cos[m θ](Sin[(m k)/2])^2-A^2 Cos[m θ])/m^(1+α), {m, 1, 200}]
data = Table[{A, FindArgMin[{termOne[k,θ,α,A] *termTwo[k,θ,α,A] /. 
       α -> 1, -Pi <= k <= Pi, -Pi <= θ <= Pi}, {θ,1},{k, 1}]}, {A, 0,1,0.05}]

I tried using a combination of First@, but that didn't work.

$\endgroup$
1
  • 3
    $\begingroup$ Flatten /@ data $\endgroup$
    – MelaGo
    Apr 19 at 5:25

1 Answer 1

2
$\begingroup$

Apply[Sequence]:

termTwo[k_, α_, θ_, A_] := 
 Sum[((1 + A^2) Cos[m θ] (Sin[(m k)/2])^2)/
   m^(1 + α), {m, 1, 200}]
termOne[k_, θ_, α_, A_] := 
 Sum[((1 + A^2) Cos[m θ] (Sin[(m k)/2])^2 - 
     A^2 Cos[m θ])/m^(1 + α), {m, 1, 200}]
data = Table[{A, 
   Sequence @@ 
    FindArgMin[{termOne[k, θ, α, A]*
        termTwo[k, θ, α, A] /. α -> 1, -Pi <= 
       k <= Pi, -Pi <= θ <= Pi}, {θ, 1}, {k, 1}]}, {A, 
   0, 1, 0.05}]

For versions after v12.1, you can use Splice@FindArgMin[...].

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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