2
$\begingroup$

I have a phrase that in it x is a function of y but I need to plot y as a function of x. I tried InverseFunction but because my phrase is not single-valued in some points Mathematica can not give me a plot. After that, I tried ParametricPlot but this code has not any answer. In fact I wanna inverse x and y axes. what should I do?

0.008 y + 
 125. (2. - 
    0.0000271476 (659.714/(1 - 0.169673 y) + (
       2 (2.30388*10^-6 + 0.169673 y)^2)/(1 - 0.169673 y)^2) - (
    0.00271476 (2.30388*10^-6 + 0.169673 y))/(1 - 0.169673 y))^2 y=x 

Plot[{0.008 y + 
 125. (2. - 
    0.0000271476 (659.714/(1 - 0.169673 y) + (
       2 (2.30388*10^-6 + 0.169673 y)^2)/(1 - 0.169673 y)^2) - (
    0.00271476 (2.30388*10^-6 + 0.169673 y))/(1 - 0.169673 y))^2 y}, {y, 5.6, 6}] 
$\endgroup$
1
  • $\begingroup$ I change the coefficients in my code: Plot[2.3864*10^-15 y + 9.5456*10^-15 (25. - 2.78813*10^-9 (659.714/(1 - 5.57627*10^-9 y) + ( 2 (9.21551*10^-6 + 1.39407*10^-6 y)^2)/(1 - 5.57627*10^-9 y)^2) - ( 1.39407*10^-6 (9.21551*10^-6 + 1.39407*10^-6 y))/( 1 - 5.57627*10^-9 y))^2 y, {y, 1.7*10^8, 1.9*10^8}] when I plotted these function no minus region appear but when I plotted inverse function with ParametricPlot some region that are minus in sign will appear, why is that? $\endgroup$
    – nafis gh
    Dec 9, 2020 at 22:46

1 Answer 1

5
$\begingroup$
f[y_] := 0.008 y + 
   125. (2. - 
       0.0000271476 (659.714/(1 - 
             0.169673 y) + (2 (2.30388*10^-6 + 0.169673 y)^2)/(1 - 
              0.169673 y)^2) - (0.00271476 (2.30388*10^-6 + 
            0.169673 y))/(1 - 0.169673 y))^2 y;
fun = Plot[f[y], {y, 0, 6}, PlotStyle -> Blue, AspectRatio -> 1];
invfun = ParametricPlot[{f[y], y}, {y, 0, 6}, PlotStyle -> Red, 
   AspectRatio -> 1];
GraphicsRow[{fun, invfun}]

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ ContourPlot is another way. $\endgroup$
    – cvgmt
    Nov 30, 2020 at 11:22
  • $\begingroup$ I change the coefficients in my code: Plot[2.3864*10^-15 y + 9.5456*10^-15 (25. - 2.78813*10^-9 (659.714/(1 - 5.57627*10^-9 y) + ( 2 (9.21551*10^-6 + 1.39407*10^-6 y)^2)/(1 - 5.57627*10^-9 y)^2) - ( 1.39407*10^-6 (9.21551*10^-6 + 1.39407*10^-6 y))/( 1 - 5.57627*10^-9 y))^2 y, {y, 1.7*10^8, 1.9*10^8}] when I plotted these function no minus region appear but when I plotted inverse function with ParametricPlot some region that are minus in sign will appear, why is that? $\endgroup$
    – nafis gh
    Dec 12, 2020 at 10:34
  • $\begingroup$ @nafisgh Since MMA change the origin automatic. you can set AxesOrigin -> {0, 0} etc. $\endgroup$
    – cvgmt
    Dec 12, 2020 at 10:43

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.