0

I have a equation

inv = (x + f) (y + g) == z;

But for some reason I cannot CountourPlot it, even though copy-pasting output, for example {(2 + x) (2 + y)} == {11} into CountourPlot works. I've tried both Hold and Defer to no luck.

What's happening and how I can fix this problem?

Actual code:

inv00 = (x + 1) (y + 1) == z
inv01 = inv00 /. {z -> 2}
ContourPlot[inv01, {x, 0, 1}, {y, 0, 1}]
ContourPlot[(1 + x) (1 + y) == 2, {x, 0, 1}, {y, 0, 1}]

Plot results

Moonwalker
  • 2,180
  • 1
  • 29
  • 48
  • 1
    If it is small enough that you could show all the actual code that fails, or you could provide a minimal non-working example, then someone might be able to spot the problem and offer a fix. Without that it is very unlikely that anyone will be able to guess what the problem is, especially since you have the actual code and have looked carefully at it and you can't spot it. – Bill Feb 12 '23 at 20:20
  • @Bill thank you, I've provided the code. But I think the problem is generic meaning I return the wrong type of expression or something among those lines – Moonwalker Feb 12 '23 at 20:44
  • 2
    Thank you for your code. If I run exactly what you showed then it returns nothing because I haven't also given it `getinvariant[1,1,1]` or something similar. If I give it that then it returns `(2.27893+x) (2.5638+y)==B^2 z^2` and part of that "looks funny." Did I give `getinvariant` bad input? Did I not initialize `B`? Did I not initialize `z`? Am I getting any closer? – Bill Feb 12 '23 at 21:49
  • @Bill thank you, I've simplified the not working example, now it is very easy to understand and try – Moonwalker Feb 14 '23 at 13:01
  • Thank you for the not working example. That makes the problem completely clear. If someone asked you to plot `a*x^2` for -2 – Bill Feb 14 '23 at 16:00

0 Answers0