Hi I'm trying to visualize a 2D equation that I have previously solved as I vary a parameter 'b'. First I solve for 'y' in terms of 'x' and 'b', then I intend to use Manipulate.

sol = Solve[y+b==2*x,y]

In this simplified example I'm expecting a line of slope 2 to move up and down as I vary 'b' but I just get a blank graph.


This is a tricky. The problem is that the argument b needs to appear explicitly in the Manipulate expression. One solution, perhaps not simplest, is as follows

sol = Solve[y + b == 2*x, y]
y1[x_, b_] = y /. sol[[1, 1]]
Manipulate[Plot[y1[x, b], {x, -1, 1}], {b, -2, 2}]
| improve this answer | |
  • $\begingroup$ I understand, thank you! It's strange that Manipulate can't handle 'b' implicitly.. but this still works :) Thanks! $\endgroup$ – Matthew James Sep 30 '18 at 11:45

Not the answer you're looking for? Browse other questions tagged or ask your own question.