Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Vector plot does not take an equation as an argument

  1. Nov 28, 2009 #1
    VectorPlot[{D[x[t], t] == x[t] (4 - y[t] - x[t]^2),
    D[y[t], t] == y[t] (-1 + x[t])}, {x, -10, 10}, {y, -10,
    10}, {t, -10, 10}]

    I'm trying to graph the phase plane of these equations. I get an error, what's wrong with my command?
     
  2. jcsd
  3. Nov 28, 2009 #2

    Dale

    Staff: Mentor

    Re: Vecotplot

    Vector plot does not take an equation as an argument. You need to put the expressions in instead of the equations. Also, if you have the expression x[t] you cannot evaluate it at x=10 since that would be 10[t] which is going to throw an error. I think the correct command is:

    VectorPlot[{x (4 - y - x^2), y (-1 + x)}, {x, -10, 10}, {y, -10, 10}, {t, -10, 10}]
     
  4. Nov 28, 2009 #3
    Re: Vecotplot

    VectorPlot::nonopt: Options expected (instead of {t,-10,10}) beyond position 3 in VectorPlot[{x (4-y-x^2),y (-1+x)},{x,-10,10},{y,-10,10},{t,-10,10}]. An option must be a rule or a list of rules. >>
     
  5. Nov 28, 2009 #4

    Dale

    Staff: Mentor

    Re: Vecotplot

    Oops, I missed that.

    VectorPlot[{x (4 - y - x^2), y (-1 + x)}, {x, -10, 10}, {y, -10, 10}]
     
  6. Nov 28, 2009 #5
    Re: Vecotplot

    How do I get mathematica to show the origin? it just fades in the middle.
     
  7. Nov 29, 2009 #6

    Dale

    Staff: Mentor

    Re: Vecotplot

    Use the option

    Axes->True
     
  8. Nov 29, 2009 #7
    Re: Vecotplot

    What about the arrows that fade towards the y-axis

    and how do I plot circles around the points (-2,0),(1,3),(2,0),(0,0)?
     
  9. Nov 29, 2009 #8

    Dale

    Staff: Mentor

    Re: Vecotplot

    The arrows towards the y-axis appear to fade because VectorPlot plots both the magnitude and the direction of each vector, so a region with a lower magnitude is represented by shorter vectors. If you do not like this behavior you might consider using StreamDensityPlot instead of VectorPlot. Stream density plot shows the direction of the field using arrows and the magnitude using a background shading.
     
  10. Nov 29, 2009 #9
    Re: Vecotplot

    Thanks for the help!!!!!!

    and how do I plot circles around the points (-2,0),(1,3),(2,0),(0,0)?

    StreamDensityPlot[{x (4 - y - x^2),
    y (-1 + x)}, {Circle[{-2, 0}, 1]}, {x, -10, 10}, {y, -10, 10},
    Axes -> True]

    StreamDensityPlot::nonopt: Options expected (instead of {y,-10,10}) beyond position 3 in StreamDensityPlot[{x (4-y-x^2),y (-1+x)},{Circle[{-2,0},1]},{x,-10,10},{y,-10,10},Axes->True]. An option must be a rule or a list of rules. >>
     
    Last edited: Nov 29, 2009
  11. Nov 30, 2009 #10

    Dale

    Staff: Mentor

    Re: Vecotplot

    Unfortunately I am travelling and can't access Mathematica until thursday. However, if my memory is correct there is an option called Epilogue or something similar that you can use to plot any arbitrary list of graphics primitives. Try a search for "Epilogue" in the online help and if I misremembered the name then you will have to look through the list of options for StreamDensityPlot, Plot, and Graphics until you find it.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Similar Discussions: Vector plot does not take an equation as an argument
Loading...