2
$\begingroup$

This question already has an answer here:

I need to plot the following curve in a triangular (ternary) plot: $$|x_{BB}-x_{AA}|=(\sigma_c-2x_{AB}+1)^{\gamma}, \qquad (1)$$ subjected to the condition (this condition must satisfy for a ternary plot) $$x_{AA}+x_{AB}+x_{BB}=1, \qquad (2)$$

where $\sigma_c$ is a positive constant, say 1, and $\gamma=0.35$.

My attempt is to express $x_{AB}$ in terms of the other two variables from the equation (2) and substitute the resulting expression in (1), then I obtain the following:

Abs[b - a] == (2 - 2 (1 - a - b))^0.35

Questions:

a) Is this expression equivalent to the equations (1) and (2)?

b) How do I plot the curve (1) subjected to (2) in a ternary form?

$\endgroup$

marked as duplicate by bobthechemist, Kuba, Öskå, Karsten 7., gpap Nov 21 '14 at 13:25

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3
$\begingroup$

make use of ContourPlot to find solutions..

 dat = Table[ {#[[1]], #[[2]], 1 - #[[1]] - #[[2]]} & /@ 
      Select[ 
        Cases[ ContourPlot[ 
             Abs[ b - a] == ( sig - 2 (1 - b - a ) + 1  )^.35 ,
                {a, 0, 1}, {b, 0, 1}] ,
                   List[a_Real, b_Real] :> { a, b } , 
                      Infinity] , #[[1]] + #[[2]] <= 1 & ] ,
           {sig, -1, 1, .25}];

then transform to a ternary figure:

 Graphics[{Line[{{0, 0}, {1, 0}, {1/2, Sqrt[3]/2}, {0, 0}}],
     Point[{#[[2]] + #[[3]]/2  , Sqrt[3]/2 #[[3]] } & /@ #] & /@  dat}]

enter image description here

Edit -- same thing preserving the lines form ContourPlot

 tercp[cp_Graphics] :=
    Quiet@Cases[ Normal@First@Cases[cp, _GraphicsComplex, Infinity] ,
        Line[x_] :> Line[{
           1 - #[[1]] + #[[2]],
           Sqrt[3] (1 - #[[1]] - #[[2]])}/2 & /@
             Select[x, Total[#] <= 1 &] ], Infinity] 

 Graphics[{Line[{{0, 0}, {1, 0}, {1/2, Sqrt[3]/2}, {0, 0}}],
         {Dashed,
Table[ tercp [ ContourPlot[(1 - b - a) == ci , {a, 0, 1}, {b, 0, 1}] ],{ci, .1, .9, .1}],
Table[tercp [ ContourPlot[a == ci , {a, 0, 1}, {b, 0, 1}] ], {ci, .1, .9, .1}],
Table[ tercp [ ContourPlot[b == ci , {a, 0, 1}, {b, 0, 1}] ] , {ci, .1, .9, .1}]},
Table[ {Hue[RandomReal[]], 
   tercp [ ContourPlot[Abs[b - a] == (sig - 2 (1 - b - a) + 1)^.35,
       {a, 0, 1}, {b, 0, 1}] ] }, {sig, -1, 1, .2}]}]

enter image description here

$\endgroup$

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