Streamlines for a vector field

In summary, the conversation discusses the use of LaTeX to graph the electric field around a dipole. The code used creates a quiver plot of the vector field, with all vectors having the same length. However, the thickness of the vectors is not uniform due to the rapid drop-off in intensity of the field. The individual would like to also add field lines to the plot, but is unsure of how to do so without explicitly plotting them. They suggest using a streamline plot, but are seeking assistance with implementing this in LaTeX.
  • #1
jack476
328
125
I'm trying to use LaTeX to graph both the vectors of the electric field around a dipole and the field lines. So far I have a quiver plot of the vector field:

bXuS0fO.png


I obtained this by using the code

Code:
\begin{tikzpicture}

\def \U{(x-1)/((x-1)^2+y^2)^(3/2) - (x+1)/((x+1)^2+y^2)^(3/2)}
\def \V{y/((x-1)^2+y^2)^(3/2)-y/((x+1)^2+y^2)^(3/2)}
\def \LEN{(sqrt((\U)^2 + (\V)^2)}

\begin{axis}
[domain = -3:3, domain = -3:3, view={0}{90}]
\addplot3
[
blue,
point meta={\LEN},
quiver={
        u={(\U)/\LEN},
        v={(\V)/\LEN},
        scale arrows=0.2,
        every arrow/.append style={line width=\pgfplotspointmetatransformed/1000 * 2pt},
        },
        -stealth,
        samples=15,
    ] {0};
\end{axis}
\end{tikzpicture}

The code makes all of the vectors have the same length. In theory, it would also scale their thickness but as you can see nearly all of the vectors besides those right next to the charges at (-1,0) and (+1,0) have the minimum thickness, I guess because the field drops off in intensity so quickly. I would take that out but for some reason doing so makes it look just a little bit off.

Anyway, what I'd like to do now is also draw some field lines on top of this quiver plot, so that I can have a graphic that shows how the electric field vectors are tangent to the field lines. Is there any way I can do this elegantly in LaTeX without having to plot the field lines explicitly?
 

Attachments

  • bXuS0fO.png
    bXuS0fO.png
    8.5 KB · Views: 1,240
Physics news on Phys.org
  • #2
I imagine something with a streamline plot maybe, but I'm not sure how to go about this. Any help would be appreciated!
 

1. What are streamlines for a vector field?

Streamlines for a vector field are imaginary lines that represent the direction in which a fluid or a particle will flow when placed in the vector field. They are tangent to the velocity vector at every point and are used to visualize the flow patterns of a vector field.

2. How are streamlines calculated?

Streamlines can be calculated by solving a differential equation known as the streamline equation, which takes into account the velocity vector and the position of a point in the vector field. This equation can be solved numerically using computational methods to generate a set of points that form the streamline.

3. What is the significance of streamlines in fluid dynamics?

Streamlines are important in fluid dynamics as they provide a visual representation of the flow patterns and direction of fluids. They are also used to calculate important properties such as flow rate, pressure, and vorticity. Streamlines are also helpful in understanding the behavior of objects moving through a fluid, such as airplanes or ships.

4. Can streamlines intersect?

No, streamlines cannot intersect as they represent the path of a single particle or fluid element. If streamlines were to intersect, it would mean that the particle or fluid element is changing direction at that point, which is not possible in a steady flow. However, streamlines can get close to each other, indicating regions of high fluid velocity or vorticity.

5. How do streamlines differ from streaklines and pathlines?

Streamlines, streaklines, and pathlines are all used to visualize and analyze vector fields, but they differ in their definitions and applications. Streamlines represent the instantaneous direction of flow at a given point, while streaklines show the path of all particles that have passed through a specific point in the past. Pathlines, on the other hand, represent the actual path taken by a single particle or fluid element.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
961
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
575
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
888
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Back
Top