Kernel: SageMath 9.2
Plotting vector fields
Similar to the previous notebook, which plotted slope fields, this notebook contains an interactive element which plots a vector field. Into the box input a vector function of the variables and of the form
In [1]:
Out[1]:
Interactive function <function show_vector_field at 0x7fe48cbe6c10> with 4 widgets
xrange: TransformFloatSli…
Plotting vector field with flow lines
If you see above, checking the "steamline" button produced a "streamline plot" with solutions curves. We can select a few initial conditions and plot them with the vector field below. Now instead of specifying only as in the Slope_Fields notebook, we can specify a starting point. (Feel free to modify the other page to work in this more general situation!)
In [1]:
Out[1]:
Interactive function <function show_vector_field_curves at 0x7f8765bc0d30> with 4 widgets
xrange: TransformF…
3D Vector Fields
We can also fairly straightforwardly generalize this to the next dimension we can visualize and plot 3d vector fields. Now
has three components.
In [3]:
Out[3]:
Interactive function <function show_vector_field at 0x7faa082c4940> with 4 widgets
xrange: TransformFloatSli…
In [7]:
Out[7]:
In [0]: