2
$\begingroup$
(1 + r^2 + x)^2 - (-1 + r)^2 ((1 + x)^2 + y^2)=0

2 (2 r^3 + (1 + x)^2 + y^2 - r (-1 + x^2 + y^2))=0

I am trying to plot $x$ and $y$ which are giving by the equations above so what I did is that I solve the second equation for $c$ then substituted the value of $c$ in the first equation and then used the ContourPlot function to plot $x$ and $y$. The problem is that when solving for $c$ in the second equation we get three solutions and each one results in a different plot when substituted in the first equation. Also, there seems to be some disconnect at some areas. Why is this happening and is there a way to fix it?

Thanks.

$\endgroup$
5
  • 2
    $\begingroup$ Have you tried using Eliminate[] to get rid of c from the system of equations? $\endgroup$
    – Michael E2
    Commented Nov 18, 2016 at 2:53
  • $\begingroup$ By the way, people here generally like users to post code as Mathematica code instead of images or TeX, so they can copy-paste it. It makes it convenient for them and more likely you will get someone to help you. You may find this this meta Q&A helpful $\endgroup$
    – Michael E2
    Commented Nov 18, 2016 at 2:53
  • $\begingroup$ @MichaelE2, I have just tried Eliminate and it seems that it does work but what in the case of a more complicated equations when you need to solve for $c$? $\endgroup$
    – MrDi
    Commented Nov 18, 2016 at 2:59
  • $\begingroup$ Do you have such an example? There are going to be uncomputable problems due to the finite limitations of the hardware and software. But have some doubt that there is a pair of polynomials for which you could solve for c but not eliminate it. That's just intuition and I could be wrong. It's also possible that computing Eliminate[] takes much more time, so that it cannot effectively be done. $\endgroup$
    – Michael E2
    Commented Nov 18, 2016 at 3:28
  • 1
    $\begingroup$ There's no c in your equations. I guess you meant r. $\endgroup$
    – corey979
    Commented Nov 18, 2016 at 10:27

2 Answers 2

4
$\begingroup$
soln = {x, y} /. Solve[{
      (1 + r^2 + x)^2 - (-1 + r)^2 ((1 + x)^2 + y^2) == 0,
      2 (2 r^3 + (1 + x)^2 + y^2 - r (-1 + x^2 + y^2)) == 0},
     {x, y}, Reals] // Normal // Simplify

(*  {{-1 - 2*r + r^2, 
     -Sqrt[(-(-4 + r))*r^3]}, 
   {-1 - 2*r + r^2, 
     Sqrt[(-(-4 + r))*r^3]}}  *)

ParametricPlot[Evaluate@soln, {r, 0, 4}]

enter image description here

$\endgroup$
2
$\begingroup$
eq = {(1 + r^2 + x)^2 - (-1 + r)^2 ((1 + x)^2 + y^2) == 0, 
    2 (2 r^3 + (1 + x)^2 + y^2 - r (-1 + x^2 + y^2)) == 0};

el = Eliminate[eq, r]

enter image description here

ContourPlot[Evaluate @ el, {x, -3, 7}, {y, -6, 6}]

enter image description here

$\endgroup$

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.