0
$\begingroup$

I have two long functions g12 and g14 in terms of g2:

g12 = √(-(30374999/480000) - g2^2 + 44401/(150000000 2^(2/3) (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625 + √(4 (-(231106915244401/390625) - (107745652224 g2^2)/625)^3 + (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625)^2))^(1/3)) + (96294548 2^(1/3))/(125 (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625 + √(4 (-(231106915244401/390625) - (107745652224 g2^2)/625)^3 + (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625)^2))^(1/3)) + (140293818 2^(1/3) g2^2)/(625 (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625 + √(4 (-(231106915244401/390625) - (107745652224 g2^2)/625)^3 + (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625)^2))^(1/3)) + (1/(768 2^(1/3)))((7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625 + √(4 (-(231106915244401/390625) - (107745652224 g2^2)/625)^3 + (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625)^2))^(1/3)))
g14 = √(-(30374999/480000) - g2^2 - 34681467/(100000000 2^(2/3) (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625 + √(4 (-(231106915244401/390625) - (107745652224 g2^2)/625)^3 + (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625)^2))^(1/3)) - (144441757 2^(1/3))/(375 (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625 + √(4 (-(231106915244401/390625) - (107745652224 g2^2)/625)^3 + (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625)^2))^(1/3)) + (1150640 I 2^(1/3))/(Sqrt[3] (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625 + √(4 (-(231106915244401/390625) - (107745652224 g2^2)/625)^3 + (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625)^2))^(1/3)) + (34681467 I Sqrt[3])/(100000000 2^(2/3) (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625 + √(4 (-(231106915244401/390625) - (107745652224 g2^2)/625)^3 + (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625)^2))^(1/3)) + (203919 I 2^(1/3)Sqrt[3])/(125 (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625 + √(4 (-(231106915244401/390625) - (107745652224 g2^2)/625)^3 + (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625)^2))^(1/3)) - (70146909 2^(1/3)g2^2)/(625 (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625 + √(4 (-(231106915244401/390625) - (107745652224 g2^2)/625)^3 + (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625)^2))^(1/3)) + (70146909 I 2^(1/3) Sqrt[3] g2^2)/(625 (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625 + √(4 (-(231106915244401/390625) - (107745652224 g2^2)/625)^3 + (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625)^2))^(1/3)) - (1/(1536 2^(1/3)))((7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625 + √(4 (-(231106915244401/390625) - (107745652224 g2^2)/625)^3 + (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625)^2))^(1/3)) - (1/(512 2^(1/3) Sqrt[3]))I (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625 + √(4 (-(231106915244401/390625) - (107745652224 g2^2)/625)^3 + (7026667556070696253202/244140625 - (1637971061985345024 g2^2)/78125 - (190911920799744 g2^4)/625)^2))^(1/3))

And I wish to plot two parametric curves by parameterizing g2:

ParametricPlot[{{g2, g12}, {g2, g14}}, {g2, 0, 10}, PlotRange -> {{0, 6}, {0, 2.5}}, PlotStyle -> {Directive[Blue], Directive[Orange]}, LabelStyle -> 12, AspectRatio -> 1, PlotPoints -> 100, WorkingPrecision -> 20, Exclusions -> None, Frame -> True, FrameTicksStyle -> Directive[Thick, Black], PlotRangePadding -> None]

I arrive with: enter image description here Where the blue curve is represents g12 and orange represents g14. I intend to shade the area bounded by the blue curve, orange curve and the x-y axes. How should I go about doing so?

$\endgroup$
  • $\begingroup$ Why not define explicitly as functions of g2: g12[g2_] := (* stuff *); g14[g2_] := (* stuff *)? $\endgroup$ – J. M. will be back soon Oct 18 '18 at 0:18
2
$\begingroup$

This also works.

Plot[{g12, g14}, {g2, 0, 5.24}, PlotRange -> {{0, 6}, {0, 2.5}}, 
    ImageSize -> Large, LabelStyle -> {12, Black, Bold}, AspectRatio -> 1, 
    WorkingPrecision -> 20, Frame -> True, Filling -> {1 -> Axis, 2 -> {Axis, White}}]

enter image description here

For some reason, it is necessary to adjust the upper limit on g2 to eliminate a faint vertical line.

$\endgroup$
1
$\begingroup$

EDIT: Changed PlotStyle and PlotRange

{maxg2, maxy} = 
 Ceiling[{g2, g12} /. 
     NSolve[{g12 == g14, g2 > 0}, g2, WorkingPrecision -> 20][[1]] // 
    N // Chop, 0.05]

(* {5.25, 2.1} *)

Show[
 RegionPlot[{Re[g14] < y < Re[g12] && 0 < g2 < 6}, {g2, 0, maxg2}, {y,
    0, maxy},
  PlotStyle -> LightGreen,
  PlotPoints -> 100,
  BoundaryStyle -> None],
 ParametricPlot[{{g2, g12}, {g2, g14}}, {g2, 0, 10},
  PlotRange -> {{0, maxg2}, {0, maxy}},
  PlotStyle -> {Directive[Blue], Directive[Orange]},
  LabelStyle -> 12,
  AspectRatio -> 1,
  PlotPoints -> 100,
  WorkingPrecision -> 20,
  Exclusions -> None,
  Frame -> True,
  FrameTicksStyle -> Directive[Thick, Black],
  PlotRangePadding -> None,
  PlotLegends -> Placed[{"g12", "g14"}, {0.35, 0.65}]]]

enter image description here

$\endgroup$
  • $\begingroup$ Thanks! Just a few follow up questions: It seems even with PlotRangePadding->None there still exists padding in the plot. Is there any way to remove the padding? Also how would I go about changing the color of the shade? (say Grey to Green) Edit: I figured out the color. I would just do PlotStyle->(color) $\endgroup$ – kowalski Oct 18 '18 at 0:39

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.