1
$\begingroup$

I have two functions as follows:

-((5 + 2 k - 3 l - 4 x - 2 k x + 2 l x)/(3 (-2 - k + l))) - 
  (2^(1/3) (-(5 + 2 k - 3 l - 4 x - 2 k x + 2 l x)^2 + 3 (-2 - k + l) (-8 - 4 k + 6 x + 4 k x - 2 l x - 2 x^2 - k x^2 + l x^2)))/
   (3 (-2 - k + l) (146 + 60 k - 57 k^2 - 25 k^3 - 18 l + 90 k l + 54 k^2 l - 135 l^2 - 81 k l^2 + 54 l^3 - 84 x - 282 k x - 204 k^2 x - 42 k^3 x - 102 l x + 
      84 k l x + 60 k^2 l x + 180 l^2 x + 36 k l^2 x - 54 l^3 x + 24 x^2 + 84 k x^2 + 66 k^2 x^2 + 15 k^3 x^2 + 12 l x^2 - 36 k l x^2 - 21 k^2 l x^2 - 30 l^2 x^2 - 
      3 k l^2 x^2 + 9 l^3 x^2 - 16 x^3 - 24 k x^3 - 12 k^2 x^3 - 2 k^3 x^3 + 24 l x^3 + 24 k l x^3 + 6 k^2 l x^3 - 12 l^2 x^3 - 6 k l^2 x^3 + 2 l^3 x^3 + 
      Sqrt[(146 + 60 k - 57 k^2 - 25 k^3 - 18 l + 90 k l + 54 k^2 l - 135 l^2 - 81 k l^2 + 54 l^3 - 84 x - 282 k x - 204 k^2 x - 42 k^3 x - 102 l x + 84 k l x + 
          60 k^2 l x + 180 l^2 x + 36 k l^2 x - 54 l^3 x + 24 x^2 + 84 k x^2 + 66 k^2 x^2 + 15 k^3 x^2 + 12 l x^2 - 36 k l x^2 - 21 k^2 l x^2 - 30 l^2 x^2 - 
          3 k l^2 x^2 + 9 l^3 x^2 - 16 x^3 - 24 k x^3 - 12 k^2 x^3 - 2 k^3 x^3 + 24 l x^3 + 24 k l x^3 + 6 k^2 l x^3 - 12 l^2 x^3 - 6 k l^2 x^3 + 2 l^3 x^3)^2 + 
        4 (-(5 + 2 k - 3 l - 4 x - 2 k x + 2 l x)^2 + 3 (-2 - k + l) (-8 - 4 k + 6 x + 4 k x - 2 l x - 2 x^2 - k x^2 + l x^2))^3])^(1/3)) + 
  (1/(3 2^(1/3) (-2 - k + l))) (146 + 60 k - 57 k^2 - 25 k^3 - 18 l + 90 k l + 54 k^2 l - 135 l^2 - 81 k l^2 + 54 l^3 - 84 x - 282 k x - 204 k^2 x - 42 k^3 x - 
     102 l x + 84 k l x + 60 k^2 l x + 180 l^2 x + 36 k l^2 x - 54 l^3 x + 24 x^2 + 84 k x^2 + 66 k^2 x^2 + 15 k^3 x^2 + 12 l x^2 - 36 k l x^2 - 21 k^2 l x^2 - 
     30 l^2 x^2 - 3 k l^2 x^2 + 9 l^3 x^2 - 16 x^3 - 24 k x^3 - 12 k^2 x^3 - 2 k^3 x^3 + 24 l x^3 + 24 k l x^3 + 6 k^2 l x^3 - 12 l^2 x^3 - 6 k l^2 x^3 + 
     2 l^3 x^3 + Sqrt[(146 + 60 k - 57 k^2 - 25 k^3 - 18 l + 90 k l + 54 k^2 l - 135 l^2 - 81 k l^2 + 54 l^3 - 84 x - 282 k x - 204 k^2 x - 42 k^3 x - 102 l x + 
         84 k l x + 60 k^2 l x + 180 l^2 x + 36 k l^2 x - 54 l^3 x + 24 x^2 + 84 k x^2 + 66 k^2 x^2 + 15 k^3 x^2 + 12 l x^2 - 36 k l x^2 - 21 k^2 l x^2 - 
         30 l^2 x^2 - 3 k l^2 x^2 + 9 l^3 x^2 - 16 x^3 - 24 k x^3 - 12 k^2 x^3 - 2 k^3 x^3 + 24 l x^3 + 24 k l x^3 + 6 k^2 l x^3 - 12 l^2 x^3 - 6 k l^2 x^3 + 
         2 l^3 x^3)^2 + 4 (-(5 + 2 k - 3 l - 4 x - 2 k x + 2 l x)^2 + 3 (-2 - k + l) (-8 - 4 k + 6 x + 4 k x - 2 l x - 2 x^2 - k x^2 + l x^2))^3])^(1/3)

 -((5 + 2*k - 3*l - 4*z - 2*k*z + 2*l*z)/(3*(-2 - k + l))) - 
  (2^(1/3)*(-(5 + 2*k - 3*l - 4*z - 2*k*z + 2*l*z)^2 + 3*(-2 - k + l)*(-8 - 4*k + 6*z + 4*k*z - 2*l*z - 2*z^2 - k*z^2 + l*z^2)))/
   (3*(-2 - k + l)*(146 + 60*k - 57*k^2 - 25*k^3 - 18*l + 90*k*l + 54*k^2*l - 135*l^2 - 81*k*l^2 + 54*l^3 - 84*z - 282*k*z - 204*k^2*z - 42*k^3*z - 102*l*z + 
      84*k*l*z + 60*k^2*l*z + 180*l^2*z + 36*k*l^2*z - 54*l^3*z + 24*z^2 + 84*k*z^2 + 66*k^2*z^2 + 15*k^3*z^2 + 12*l*z^2 - 36*k*l*z^2 - 21*k^2*l*z^2 - 30*l^2*z^2 - 
      3*k*l^2*z^2 + 9*l^3*z^2 - 16*z^3 - 24*k*z^3 - 12*k^2*z^3 - 2*k^3*z^3 + 24*l*z^3 + 24*k*l*z^3 + 6*k^2*l*z^3 - 12*l^2*z^3 - 6*k*l^2*z^3 + 2*l^3*z^3 + 
      Sqrt[(146 + 60*k - 57*k^2 - 25*k^3 - 18*l + 90*k*l + 54*k^2*l - 135*l^2 - 81*k*l^2 + 54*l^3 - 84*z - 282*k*z - 204*k^2*z - 42*k^3*z - 102*l*z + 84*k*l*z + 
          60*k^2*l*z + 180*l^2*z + 36*k*l^2*z - 54*l^3*z + 24*z^2 + 84*k*z^2 + 66*k^2*z^2 + 15*k^3*z^2 + 12*l*z^2 - 36*k*l*z^2 - 21*k^2*l*z^2 - 30*l^2*z^2 - 
          3*k*l^2*z^2 + 9*l^3*z^2 - 16*z^3 - 24*k*z^3 - 12*k^2*z^3 - 2*k^3*z^3 + 24*l*z^3 + 24*k*l*z^3 + 6*k^2*l*z^3 - 12*l^2*z^3 - 6*k*l^2*z^3 + 2*l^3*z^3)^2 + 
        4*(-(5 + 2*k - 3*l - 4*z - 2*k*z + 2*l*z)^2 + 3*(-2 - k + l)*(-8 - 4*k + 6*z + 4*k*z - 2*l*z - 2*z^2 - k*z^2 + l*z^2))^3])^(1/3)) + 
  (1/(3*2^(1/3)*(-2 - k + l)))*(146 + 60*k - 57*k^2 - 25*k^3 - 18*l + 90*k*l + 54*k^2*l - 135*l^2 - 81*k*l^2 + 54*l^3 - 84*z - 282*k*z - 204*k^2*z - 42*k^3*z - 
     102*l*z + 84*k*l*z + 60*k^2*l*z + 180*l^2*z + 36*k*l^2*z - 54*l^3*z + 24*z^2 + 84*k*z^2 + 66*k^2*z^2 + 15*k^3*z^2 + 12*l*z^2 - 36*k*l*z^2 - 21*k^2*l*z^2 - 
     30*l^2*z^2 - 3*k*l^2*z^2 + 9*l^3*z^2 - 16*z^3 - 24*k*z^3 - 12*k^2*z^3 - 2*k^3*z^3 + 24*l*z^3 + 24*k*l*z^3 + 6*k^2*l*z^3 - 12*l^2*z^3 - 6*k*l^2*z^3 + 
     2*l^3*z^3 + Sqrt[(146 + 60*k - 57*k^2 - 25*k^3 - 18*l + 90*k*l + 54*k^2*l - 135*l^2 - 81*k*l^2 + 54*l^3 - 84*z - 282*k*z - 204*k^2*z - 42*k^3*z - 102*l*z + 
         84*k*l*z + 60*k^2*l*z + 180*l^2*z + 36*k*l^2*z - 54*l^3*z + 24*z^2 + 84*k*z^2 + 66*k^2*z^2 + 15*k^3*z^2 + 12*l*z^2 - 36*k*l*z^2 - 21*k^2*l*z^2 - 
         30*l^2*z^2 - 3*k*l^2*z^2 + 9*l^3*z^2 - 16*z^3 - 24*k*z^3 - 12*k^2*z^3 - 2*k^3*z^3 + 24*l*z^3 + 24*k*l*z^3 + 6*k^2*l*z^3 - 12*l^2*z^3 - 6*k*l^2*z^3 + 
         2*l^3*z^3)^2 + 4*(-(5 + 2*k - 3*l - 4*z - 2*k*z + 2*l*z)^2 + 3*(-2 - k + l)*(-8 - 4*k + 6*z + 4*k*z - 2*l*z - 2*z^2 - k*z^2 + l*z^2))^3])^(1/3)

As you see the first one depens on x, k and l and the second one depends on z, k and l. The parameters take values between 0 to 1. I have to plot these two functions against each other as those parameters changes from 0 to 1. I think they should look like symmetric to each other.

Could you please help me?

Thanks,

$\endgroup$
  • 1
    $\begingroup$ Please come up with a minimalistic example of your problem. E.g. how to plot Sin[x] vs Cos[x] $\endgroup$ – BlacKow Jan 4 '17 at 20:30
  • 1
    $\begingroup$ "As you see the first one depends on z, k [...]" - you made laugh out loud here! I'll gladly give it a shot as soon as you provide us with a smaller example $\endgroup$ – Aisamu Jan 4 '17 at 20:42
  • 1
    $\begingroup$ So your have two functions $f(x,k,l)$ and $g(y,k,l)$ and, if I understand correctly, they are defined on the unit cube $[0,1]^3$. What exactly do you want to plot? What do you expect for a simple case, for ex. $f=x+k+l$ and $g=y+k-l$ ? $\endgroup$ – A.G. Jan 5 '17 at 3:36
  • $\begingroup$ @A.G. Yes I have two functions f(x,k,l) and g(z,k,l). You can think like f=x+k+l and g=z+k+l. I want to plot f vs g with respect to x element of [0,1], k element of [0,1] and l element of [0,1] $\endgroup$ – ecco Jan 5 '17 at 11:07
  • 1
    $\begingroup$ I don't see how you can visualise that many variables in one plot. $\endgroup$ – Feyre Jan 5 '17 at 11:13
1
$\begingroup$

With four variables you are dealing with a 4-dimensional region. One way to tackle this problem is to slice the object by fixing two of the variables. If you do this for $x$ and $z$ you may then explore the region by combining Manipulate and RegionPlot:

Manipulate[
 ParametricPlot[
  {f[x, k, l], g[z, k, l]}, {k, 0, 1}, {l, 0, 1},
  PlotRange -> {{0, .8}, {0, .8}},
  AxesOrigin -> {0, 0}, AxesLabel -> {"f", "g"},
  Frame -> None,
  ColorFunction -> "Rainbow"
  ],
 {x, 0, 1}, {z, 0, 1}]

with output:

Sliced region

Of course you can choose to use a different configuration on Manipulate/ParametricPlot variables. Here is another example the exhibits some symetry:

Manipulate[
 ParametricPlot[
  {f[x, k, l], g[z, k, l]}, {x, 0, 1}, {z, 0, 1},
  PlotRange -> {{0, .8}, {0, .8}},
  AxesOrigin -> {0, 0}, AxesLabel -> {"f", "g"},
  Frame -> None,
  ColorFunction -> "Rainbow", AspectRatio -> 1
  ],
 {k, 0, 1}, {l, 0, 1}]

Parametric plot 2

Hope this helps!

For reference here is the rest of the code:

f[x_,k_,l_]:=-((5+2 k-3 l-4 x-2 k x+2 l x)/(3 (-2-k+l)))-(2^(1/3) (-(5+2 k-3 l-4 x-2 k x+2 l x)^2+3 (-2-k+l) (-8-4 k+6 x+4 k x-2 l x-2 x^2-k x^2+l x^2)))/(3 (-2-k+l) (146+60 k-57 k^2-25 k^3-18 l+90 k l+54 k^2 l-135 l^2-81 k l^2+54 l^3-84 x-282 k x-204 k^2 x-42 k^3 x-102 l x+84 k l x+60 k^2 l x+180 l^2 x+36 k l^2 x-54 l^3 x+24 x^2+84 k x^2+66 k^2 x^2+15 k^3 x^2+12 l x^2-36 k l x^2-21 k^2 l x^2-30 l^2 x^2-3 k l^2 x^2+9 l^3 x^2-16 x^3-24 k x^3-12 k^2 x^3-2 k^3 x^3+24 l x^3+24 k l x^3+6 k^2 l x^3-12 l^2 x^3-6 k l^2 x^3+2 l^3 x^3+Sqrt[(146+60 k-57 k^2-25 k^3-18 l+90 k l+54 k^2 l-135 l^2-81 k l^2+54 l^3-84 x-282 k x-204 k^2 x-42 k^3 x-102 l x+84 k l x+60 k^2 l x+180 l^2 x+36 k l^2 x-54 l^3 x+24 x^2+84 k x^2+66 k^2 x^2+15 k^3 x^2+12 l x^2-36 k l x^2-21 k^2 l x^2-30 l^2 x^2-3 k l^2 x^2+9 l^3 x^2-16 x^3-24 k x^3-12 k^2 x^3-2 k^3 x^3+24 l x^3+24 k l x^3+6 k^2 l x^3-12 l^2 x^3-6 k l^2 x^3+2 l^3 x^3)^2+4 (-(5+2 k-3 l-4 x-2 k x+2 l x)^2+3 (-2-k+l) (-8-4 k+6 x+4 k x-2 l x-2 x^2-k x^2+l x^2))^3])^(1/3))+(1/(3 2^(1/3) (-2-k+l))) (146+60 k-57 k^2-25 k^3-18 l+90 k l+54 k^2 l-135 l^2-81 k l^2+54 l^3-84 x-282 k x-204 k^2 x-42 k^3 x-102 l x+84 k l x+60 k^2 l x+180 l^2 x+36 k l^2 x-54 l^3 x+24 x^2+84 k x^2+66 k^2 x^2+15 k^3 x^2+12 l x^2-36 k l x^2-21 k^2 l x^2-30 l^2 x^2-3 k l^2 x^2+9 l^3 x^2-16 x^3-24 k x^3-12 k^2 x^3-2 k^3 x^3+24 l x^3+24 k l x^3+6 k^2 l x^3-12 l^2 x^3-6 k l^2 x^3+2 l^3 x^3+Sqrt[(146+60 k-57 k^2-25 k^3-18 l+90 k l+54 k^2 l-135 l^2-81 k l^2+54 l^3-84 x-282 k x-204 k^2 x-42 k^3 x-102 l x+84 k l x+60 k^2 l x+180 l^2 x+36 k l^2 x-54 l^3 x+24 x^2+84 k x^2+66 k^2 x^2+15 k^3 x^2+12 l x^2-36 k l x^2-21 k^2 l x^2-30 l^2 x^2-3 k l^2 x^2+9 l^3 x^2-16 x^3-24 k x^3-12 k^2 x^3-2 k^3 x^3+24 l x^3+24 k l x^3+6 k^2 l x^3-12 l^2 x^3-6 k l^2 x^3+2 l^3 x^3)^2+4 (-(5+2 k-3 l-4 x-2 k x+2 l x)^2+3 (-2-k+l) (-8-4 k+6 x+4 k x-2 l x-2 x^2-k x^2+l x^2))^3])^(1/3);

g[z_,k_,l_]:=-((5+2*k-3*l-4*z-2*k*z+2*l*z)/(3*(-2-k+l)))-(2^(1/3)*(-(5+2*k-3*l-4*z-2*k*z+2*l*z)^2+3*(-2-k+l)*(-8-4*k+6*z+4*k*z-2*l*z-2*z^2-k*z^2+l*z^2)))/(3*(-2-k+l)*(146+60*k-57*k^2-25*k^3-18*l+90*k*l+54*k^2*l-135*l^2-81*k*l^2+54*l^3-84*z-282*k*z-204*k^2*z-42*k^3*z-102*l*z+84*k*l*z+60*k^2*l*z+180*l^2*z+36*k*l^2*z-54*l^3*z+24*z^2+84*k*z^2+66*k^2*z^2+15*k^3*z^2+12*l*z^2-36*k*l*z^2-21*k^2*l*z^2-30*l^2*z^2-3*k*l^2*z^2+9*l^3*z^2-16*z^3-24*k*z^3-12*k^2*z^3-2*k^3*z^3+24*l*z^3+24*k*l*z^3+6*k^2*l*z^3-12*l^2*z^3-6*k*l^2*z^3+2*l^3*z^3+Sqrt[(146+60*k-57*k^2-25*k^3-18*l+90*k*l+54*k^2*l-135*l^2-81*k*l^2+54*l^3-84*z-282*k*z-204*k^2*z-42*k^3*z-102*l*z+84*k*l*z+60*k^2*l*z+180*l^2*z+36*k*l^2*z-54*l^3*z+24*z^2+84*k*z^2+66*k^2*z^2+15*k^3*z^2+12*l*z^2-36*k*l*z^2-21*k^2*l*z^2-30*l^2*z^2-3*k*l^2*z^2+9*l^3*z^2-16*z^3-24*k*z^3-12*k^2*z^3-2*k^3*z^3+24*l*z^3+24*k*l*z^3+6*k^2*l*z^3-12*l^2*z^3-6*k*l^2*z^3+2*l^3*z^3)^2+4*(-(5+2*k-3*l-4*z-2*k*z+2*l*z)^2+3*(-2-k+l)*(-8-4*k+6*z+4*k*z-2*l*z-2*z^2-k*z^2+l*z^2))^3])^(1/3))+(1/(3*2^(1/3)*(-2-k+l)))*(146+60*k-57*k^2-25*k^3-18*l+90*k*l+54*k^2*l-135*l^2-81*k*l^2+54*l^3-84*z-282*k*z-204*k^2*z-42*k^3*z-102*l*z+84*k*l*z+60*k^2*l*z+180*l^2*z+36*k*l^2*z-54*l^3*z+24*z^2+84*k*z^2+66*k^2*z^2+15*k^3*z^2+12*l*z^2-36*k*l*z^2-21*k^2*l*z^2-30*l^2*z^2-3*k*l^2*z^2+9*l^3*z^2-16*z^3-24*k*z^3-12*k^2*z^3-2*k^3*z^3+24*l*z^3+24*k*l*z^3+6*k^2*l*z^3-12*l^2*z^3-6*k*l^2*z^3+2*l^3*z^3+Sqrt[(146+60*k-57*k^2-25*k^3-18*l+90*k*l+54*k^2*l-135*l^2-81*k*l^2+54*l^3-84*z-282*k*z-204*k^2*z-42*k^3*z-102*l*z+84*k*l*z+60*k^2*l*z+180*l^2*z+36*k*l^2*z-54*l^3*z+24*z^2+84*k*z^2+66*k^2*z^2+15*k^3*z^2+12*l*z^2-36*k*l*z^2-21*k^2*l*z^2-30*l^2*z^2-3*k*l^2*z^2+9*l^3*z^2-16*z^3-24*k*z^3-12*k^2*z^3-2*k^3*z^3+24*l*z^3+24*k*l*z^3+6*k^2*l*z^3-12*l^2*z^3-6*k*l^2*z^3+2*l^3*z^3)^2+4*(-(5+2*k-3*l-4*z-2*k*z+2*l*z)^2+3*(-2-k+l)*(-8-4*k+6*z+4*k*z-2*l*z-2*z^2-k*z^2+l*z^2))^3])^(1/3);
$\endgroup$

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.