2
$\begingroup$

I'm trying to plot a vector field over a circle, Particularly the vector field in this plot:

VectorPlot[{(Sin[x])^3, 0}, {x, 0, 2 \[Pi]}, {y, -0.001, 0.001}, FrameTicks -> {{\[Pi]/2, \[Pi], 3 \[Pi]/2, 2 \[Pi]}, {-1, 1}}, Epilog -> Plot[(Sin[x])^3, {x, 0, 2 \[Pi]}, PlotStyle -> Red, Ticks -> None][[1]], PlotRange -> {{0, 2 \[Pi]}, {-1, 1}}, GridLines -> Automatic ] 

That was my way to plot a vector field over the line. But I want to plot this one-dimensional over a circle.

$\endgroup$
1
  • $\begingroup$ The same vector field {Sin[x]^3, 0} ? (Note: No parentheses needed around Sin[x]. On exactly what circle? (The xy-rectangle in your main plot would only accommodate a very tiny circle, given the constraints on y there.) $\endgroup$ Commented Jun 23, 2019 at 14:46

2 Answers 2

3
$\begingroup$

Perhaps this?

With[{rad = 1, center = {0, 0}}, Show[ PolarPlot[{Sin[t]^2, 1}, {t, 0, 2 Pi}, PlotStyle -> Thickness[Medium], PlotRange -> 1.15 rad, PolarGridLines -> Automatic], VectorPlot[(Sin[ArcTan[x, y]])^3 {-y, x}/rad, {x, -1.1 rad, 1.1 rad}, {y, -1.1 rad, 1.1 rad}, VectorPoints -> CirclePoints[center, rad, 24]] ] ] 

enter image description here

$\endgroup$
1
$\begingroup$

In your example, the horizontal lengths of the vectors are the y-values of the function for the given x-values; that is Sin[x]^3

Using that same approach, the horizontal lengths of the vectors should be the y-values of the points on the circle. For each x-value there are two points on the circle - for the one-dimensional vector field below I picked the positive ones.

Each point on the unit half-circle above the x-axis is of the form {Cos[theta], Sin[theta]} for some angle theta between 0 and pi. The vector field is defined in terms of x and y - so we need the theta for a given x-value: this can be computed using ArcCos[x].

The code below shows a red unit circle with the one-dimensional vector field similar to the one you used.

Show[Graphics[{Red, Circle[]}], VectorPlot[{Sin[ArcCos[x]], 0}, {x, -1, 1}, {y, -0.001, 0.001}]] 

Mathematica graphics

To only show the positive half-circle you can use

Show[ParametricPlot[{Cos[theta], Sin[theta]}, {theta, 0, \[Pi]}, PlotStyle -> Red], VectorPlot[{Sin[ArcCos[x]], 0}, {x, -1, 1}, {y, -0.001, 0.001}]] 

Mathematica graphics

For a circle which has a radius other than 1, you may use the code below (which uses radius = 3) which looks pretty much the same, except the scale, which is why the axes are shown.

radius = 3; Show[Graphics[{Red, Circle[{0, 0}, radius]}], VectorPlot[{radius Sin[ArcCos[x/radius]], 0}, {x, -radius, radius}, {y, -0.001, 0.001}], Axes -> True] 

Mathematica graphics

$\endgroup$

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.