# Choosing a solution to plot

I'm solving a system of equations that gives me three solutions and then plot a series of solutions depending on a parameter. The problem is that I have to choose different solutions depending on parameters. For each combination of parameters the only one solution which makes physical sence - such solution is positive and always less then parameter P0. I guess the right solution is the minimal positive solution. In the proposed sample code the right solutions plotted in the first and third plot between 0 and 0.05 (parameter P0 = 0.1) How can I put all good solutions in a single plot automatically ? Quiet[solution =
Solve[{K1*P*M == PaM, K2*PaM*P == PMP, K3*PaM == PM,
P0 == P + PaM + PM + 2*PMP, r*P0 == M + PaM + PM + PMP}, {P, M,
PaM, PM, PMP}]];

Rmax = 5;
Rmin = 0.01;
K1 = 11;
K3 = 102;
P0 = 0.1;
K2values = {1, 10, 100, 1000, 10000, 100000, 1000000};
colors = ColorData[22, "ColorList"];

SetOptions[ParametricPlot, PlotStyle -> (Directive[#, AbsoluteThickness] & /@ colors), AspectRatio -> 0.7, AxesLabel -> {"R", "v"}, PlotRange -> {{0, 5}, {-0.05, 0.2}}];
SetOptions[Graphics, ImageSize -> Large];

Plot1 = ParametricPlot[Evaluate[
Table[{{r, Re[PMP /. solution[]]}}, {K2, K2values}]], {r, Rmin,
Rmax}, PlotLabel -> "Solution 1"] ;
Plot2 = ParametricPlot[Evaluate[
Table[{{r, Re[PMP /. solution[]]}}, {K2, K2values}]], {r, Rmin,
Rmax}, PlotLabel -> "Solution 2"] ;
Plot3 = ParametricPlot[Evaluate[
Table[{{r, Re[PMP /. solution[]]}}, {K2, K2values}]], {r, Rmin,
Rmax}, PlotLabel -> "Solution 3"] ;

GraphicsGrid[{{Graphics[Plot1], Graphics[Plot2], Graphics[Plot3], Column[K2values, Background -> colors]}}, Frame -> None]

• If you only want to merge these plots, the command Show[] should be, what you need. Feb 22, 2013 at 12:28

I'd define :

pmpSolAux[r_, P0_, K1_, K2_, K3_] = PMP /. solution;

pmpSol[r_?NumericQ, P0_?NumericQ, K1_?NumericQ, K2_?NumericQ, K3_?NumericQ] :=
Min[Select[Re[pmpSolAux[r, P0, K1, K2, K3]], # > 0 && # < P0 &]]

(* No need for ParametricPlot *)
Plot[Evaluate[pmpSol[r, P0, K1, #, K3] & /@ K2values], {r, Rmin, Rmax}, PlotRange -> {All, {0, P0}}] If you must use ParametricPlot then the code below works; however I don't think it's possible to specify the x and y plotting ranges separately, so you'll have to compromise.

ParametricPlot[Evaluate[Table[{r, pmpSol[r, P0, K1, k2, K3]} , {k2, K2values}]],
{r,Rmin, Rmax}, PlotRange -> {0, 1}] • Cool! It works! But it was an example.. I really need ParametricPlot. How to make it works with ParametricPlot?
– user4545
Feb 22, 2013 at 13:11
• What doesn't work ? Feb 22, 2013 at 13:26
• Basing on good solutions I should make ParametricPlots like this: fr = Re[PM /. solution[]] + 2*Re[PMP /. solution[]] + Re[PaM /. solution[]]; v = fr/P0; p = P0 - fr; ParametricPlot[ Evaluate[Table[{{v, v/p}}, {K2, K2values}]], {r, Rmin, Rmax}, PlotRange -> Automatic, AxesLabel -> {"v", "v/[L]"}, PlotLabel -> "Scatchard"]
– user4545
Feb 22, 2013 at 13:42