1

I want to plot a time dependant vector field, and see variation with time,

Like this :

U = 0.5 + 0.8 x;
V = 1.5 + 2.5 Sin[2 Pi t] - 0.8 y;

But when I do:

Manipulate[VectorPlot[{U, V}, {x, -5, 5}, {y, 0, 5}], {t, 0, 1}]

or

Animate[VectorPlot[{U, V}, {x, 0, 5}, {y, -1, 5}], {t, 0, 10}]

it shows blank space, nothing is visible. And VectorPlot3D is confusing, I mean it shows all variations on top of other but I wanted to see it as in Manipulate. because Manipulate and Animate returned blank box. Its not answered in How are parameters evaluated for a Plot in Manipulate

Pls Help

  • This http://mathematica.stackexchange.com/questions/120842/how-can-i-better-mimic-the-graphics-at-earth-nullschool-net/121019#121019 might be useful – yarchik Feb 17 '17 at 00:32
  • While used functions are different I believe it is effectively a duplicate. Let me know if you disagree. – Kuba Feb 17 '17 at 06:59

1 Answers1

2

There are 3 things wrong in your code:

1) The brackets around Pi in the definition of V;

2) You use x,y in the definitions, but a,b in Manipulate;

3) You need to "expose" t to manipulate.

This works:

U = 0.5 + 0.8 x;

V = 1.5 + 2.5 Sin[2 Pi t] - 0.8 y;

Manipulate[
 VectorPlot[{U, V} /. t -> tt, {x, -5, 5}, {y, 0, 5}], {tt, 0, 1}]

Edit: Regarding "exposing" parameters to Manipulate, the documentation on Manipulate under Possible Issues notes that "Manipulate only "notices" explicit visible parameters" and gives an example of making a hidden parameter visible by exposing it as an argument in a function. The use of the Rule and Replace does essentially the same thing. The t->tt with tt being the parameter being manipulated makes it visible to Manipulate. In some cases, this could also be done by forcing evaluation of the expression being manipulated. But that can't be used in this case because it would force evaluation of VectorPlot with its range specified by a non-numeric value.

David Keith
  • 4,340
  • 1
  • 12
  • 28