Vector plot does not take an equation as an argument

In summary, the command to create a vector plot did not work. The error that was generated was that the equation x[t] could not be evaluated at x=10.
  • #1
Nusc
760
2
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?
 
Physics news on Phys.org
  • #2


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}]
 
  • #3


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. >>
 
  • #4


Oops, I missed that.

VectorPlot[{x (4 - y - x^2), y (-1 + x)}, {x, -10, 10}, {y, -10, 10}]
 
  • #5


How do I get mathematica to show the origin? it just fades in the middle.
 
  • #7


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)?
 
  • #8


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.
 
  • #9


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:
  • #10


Unfortunately I am traveling 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.
 

1. Why can't I use an equation as an argument for a vector plot?

Vector plots require numerical data points as input, not equations. This is because equations represent a relationship between variables, but do not provide specific values for those variables. A vector plot needs specific data points to create directional vectors.

2. Can I convert my equation into numerical data for the vector plot?

Yes, you can use a mathematical software or programming language to solve your equation for specific values and then use those values as input for the vector plot. This will allow you to visualize the directional vectors represented by your equation.

3. What if I have an equation with multiple variables?

In this case, you will need to specify values for each variable in order to create a vector plot. You can do this by choosing specific values for each variable or by using a range of values and creating multiple vector plots to see how the directional vectors change.

4. Are there any alternatives to using an equation for a vector plot?

Yes, there are other types of data that can be used for vector plots. These include numerical data points, vector fields, and functions that generate vector data.

5. How can I make my vector plot more accurate?

To improve the accuracy of your vector plot, you can increase the density of data points or use a more precise mathematical software or programming language to generate the data. You can also adjust the scale and size of the plot to better visualize the directional vectors.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
259
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
132
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
18
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
842
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
937
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
Back
Top