I am teaching myself simple classical mechanics and have a model of a particle moving in a central,conservative force field in 2D. As a function of time, I can plot the radius vector (nice ellipse as expected) or the velocity vector (…). What I want to do is try and plot this as a vector field so I can visualize the velocity and positions changing with time in one plot. ListVectorPlot is supposed to be able to take a list of {xi,yi} points (I think that these would be the x and y components of my radial position vector at time i) and, at each such point, plot an associated vector field point {vxi,vyi}. I have assumed that the vxi and vyi would be the corresponding x and y components of my velocity vector at the same time step. Clearly I have misunderstood the Mathematica inline help for the function as I just get an error message saying that I am not presenting a valid vector field dataset or list of datasets.
I would be most grateful if someone can point out where I am going wrong. In the trivial example attached I attempt to plot the system at t=0 when my position vector is {5,0} and my velocity vector is {0,2}. I had hoped to see a vertical line, 2 units long, plotted 5 units to the right of the origin on the x-axis.
I have always found ListVectorPlot confusing and dysfunctional. It really wants a data set that it can consider to be sampled points in a continuous field. It then interpolates and plots a representation of the field, but not necessarily at the sampled points. The documentation says that VectorPoints->All will cause it to plot at the given points, rather than interpolate. But even then it seems to want a dataset that is a qualified representative of a continuous field. There does not seem any way to tell it to forget about the need to interpolate – just plot the points given. Below there are three vectors. But if given only one you will get an error that it is not a valid vector field dataset.
I would really like to see a future release change the handling of the vector field arguments when VectorPoints->All is elected. It is clear that for the case in which the vector field elements represent sampled values from a continuous field, and interpolation is required, the interpolation routine needs to place constraints on the field description to make interpolation meaningful. But in the case where the individual base-direction pairs are to be plotted as-given, there is no need for interpolation. It would be nice if the interpolation requirements were eliminated, and the vectors just plotted.
This update should be innocuous. I don’t see that is should break past usage, since it only relieves a constraint, and cannot then force an error onto any previously working use.