0
$\begingroup$

I have a generated a data set of a function $\alpha(\lambda_2,\varepsilon):\mathbb{R}_+ \times (0,1) \mapsto (0,1)$. I used mathematica to generate a list by varying $\lambda_2$ and $\varepsilon$; $\varepsilon$ is very small, and $\lambda$ is in between 0.5 and 1.0.

{Nλ1, Nμ1, Nμ2, NCN} = {0., 1., 1., 7060};
Clear[Tableϵ, Tableλ, Tableαϵλ];
Tableϵ = Table[10^-m, {m, 3, 15, 1/3}];
Tableλ = Table[m, {m, 0.5, 1.0, 1/20}];
Tableαϵλ = {};

For[j = 1, j <= Length[Tableλ], j++, {
    lastkϵ = NCN - 1;
    For[i = 1, i <= Length[Tableϵ], i++, {
        With[{Nλ2 = Tableλ[[j]], ϵ = Tableϵ[[i]]}, {
            For[k = lastkϵ, k > Nλ2 NCN, k--, {
                If[ε[Nλ1, Nλ2, Nμ1, Nμ2, k/NCN, NCN] < ϵ && Nλ2 < k/NCN < 2 Nλ2, {
            AppendTo[Tableαϵλ, {ϵ, Nλ2, N[k/NCN]}],
            Break[]
                }];
            }]
        }];
    lastkϵ = k;
    }];
}];

Now, I'd like to generate some nice plots. In fact, I wanted to see the curves of $\alpha \approx k/NCN$ as a function of $\varepsilon$ using $\lambda_2$ as series (eventually excluding some to look nicer.

My question is, how do I break this data set into series that I can filter for some plots?

Thank you in advance.

Δ1[λ1_, λ2_, μ1_, μ2_, c0_ ] :=  1/4 + (μ2/(λ1 + λ2) (c0 μ1 - λ1 - λ2 )/( 2 μ1 - μ2));
Sp1[λ1_, λ2_, μ1_, μ2_, c0_ ] := 1/2 + Sqrt[Δ1[λ1, λ2, μ1, μ2, c0]]; Sp2[λ1_, λ2_, μ1_, μ2_, c0_ ] := 1/2 - Sqrt[Δ1[λ1, λ2, μ1, μ2, c0]];
Δ2[λ1_, λ2_, μ1_, μ2_, c0_ ] := (2 λ1 μ1 + 2 λ2 μ1 - λ1 μ2 - λ2 μ2)^2 -     3 (2 λ2 μ1 - λ2 μ2) (-2 λ1 μ1 - 2 λ2 μ1 + λ1 μ2 + λ2 μ2); Δ3[λ1_, λ2_, μ1_, μ2_, c0_ ] :=  2 (2 λ1 μ1 + 2 λ2 μ1 - λ1 μ2 - λ2 μ2)^3 - 9 (2 λ2 μ1 - λ2 μ2) (2 λ1 μ1 + 2 λ2 μ1 - λ1 μ2 - λ2 μ2) (-2 λ1 μ1 - 2 λ2 μ1 + λ1 μ2 + λ2 μ2) + 27 (2 λ2 μ1 - λ2 μ2)^2 (λ1 μ2 + λ2 μ2 - c0 μ1 μ2);  
Sq1[λ1_, λ2_, μ1_, μ2_, c0_ ] := -1/(3 λ2) (λ1 + λ2 + 2 Sqrt[Δ2[λ1, λ2, μ1, μ2, c0]] Cos[1/3 ArcTan[Sqrt[4 Δ2[λ1, λ2, μ1, μ2, c0]^3/Δ3[λ1, λ2, μ1, μ2, c0]^2 - 1]] + (2 π )/3]); 
Sq2[λ1_, λ2_, μ1_, μ2_, c0_ ] := -1/(3 λ2) (λ1 + λ2 + 2 Sqrt[Δ2[λ1, λ2, μ1, μ2, c0]] Cos[1/3 ArcTan[Sqrt[4 Δ2[λ1, λ2, μ1, μ2, c0]^3/Δ3[λ1, λ2, μ1, μ2, c0]^2 - 1]] + (4 π )/3]); 
Sq3[λ1_, λ2_, μ1_, μ2_, c0_ ] := -1/(3 λ2) (λ1 + λ2 + 2 Sqrt[Δ2[λ1, λ2, μ1, μ2, c0]] Cos[1/3 ArcTan[Sqrt[4 Δ2[λ1, λ2, μ1, μ2, c0]^3/Δ3[λ1, λ2, μ1, μ2, c0]^2 - 1]]]);
F[λ1_, λ2_, μ1_, μ2_, c0_, n_] := 1 - (2 λ2 μ1 + λ1 μ2 - c0 μ1 μ2 )/(λ2 (2 μ1 - μ2)) (    1 - Sq3[λ1, λ2, μ1, μ2, c0]/Sp1[λ1, λ2, μ1, μ2, c0]  )/(1 - Sq3[λ1, λ2, μ1, μ2, c0]) Sp1[λ1, λ2, μ1, μ2, c0]^-n  
ε[λ1_, λ2_, μ1_, μ2_, c0_, CN_] := Chop[(2 λ2 μ1 + λ1 μ2 - c0 μ1 μ2)/(λ2 (2 μ1 - μ2)) (1 - Sq3[λ1, λ2, μ1, μ2, c0]/Sp1[λ1, λ2, μ1, μ2, c0])/(1 - Sq3[λ1, λ2, μ1, μ2, c0]) Sp1[λ1, λ2, μ1, μ2, c0]^Round[-CN (1 - c0)] ] 
πminus[λ1_, λ2_, μ1_, μ2_, c0_] := (c0 - (λ1 + λ2)/μ1)/(λ2 (2/μ2 - 1/μ1))
$\endgroup$
9
  • 1
    $\begingroup$ By using those symbol names you're looking for trouble! Defne your symbols starting with a lowercase letter $\endgroup$ Mar 22, 2016 at 13:43
  • $\begingroup$ there is no alpha in your code.. so its not clear what you are asking. You probably just need do use Select to pull out what you want from the list though. $\endgroup$
    – george2079
    Mar 22, 2016 at 13:55
  • $\begingroup$ Below the code, I say $\alpha \approx k / NCN$. $\endgroup$ Mar 22, 2016 at 14:01
  • $\begingroup$ right so something like ListPlot[{#[[3]],[[1]]}&/@Select[Tableael,#[[2]]==val&]] $\endgroup$
    – george2079
    Mar 22, 2016 at 14:23
  • 1
    $\begingroup$ Dear Guilherme, I urge you to read this: mathematica.stackexchange.com/q/7924/8 $\endgroup$
    – Verbeia
    Mar 22, 2016 at 21:35

1 Answer 1

2
$\begingroup$
ListPlot[Select[
  Table[#[[{3, 1}]] & /@ 
    Select[Table\[Alpha]\[Epsilon]\[Lambda], #[[2]] == lam & ],
   {lam, Table\[Lambda]}], Length[#] > 0 &], Joined -> True, 
 PlotRange -> All]

enter image description here

$\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.