I want to use StreamPlot to map out the field lines of an electric field $\mathbf{E}$ given by $$ \mathbf{E} = \frac{3D}{4r^{4}}(3\cos(\theta)^{2}-1)\mathbf{\hat{r}} +\frac{3D}{4r^{4}}\sin(2\theta)\boldsymbol{\hat{\theta}} $$ I could convert it to Cartesian coordinates, but I have quite a few more fields to plot, so I would rather leave it in polar coordinates. How can I get StreamPlot to accept polar coordinates?
|
|
One way to do it is to write our own wrapper function which does the conversion and feeds it to
to cartesian form by preparing a set of conversion rules from polar to cartesian coordinates
and a rule to make this into a list afterwards
Then we can let Mathematica repeatedly apply (
For convenient usage we define our own
and now we can feed it our original $r$-$\theta$ field definition directly
|
|||||||
|
|
If you have version 9, the
It uses the Edit The field in the question was given in spherical coordinates, but I copied it from a comment and assumed it was cartesian components. So to correct that, in the definition of The definition of |
|||||||
|
|
Ok the stream plot on the polar space is given by say
Now, IF you want this stream plot embedded on cartesian space you can either transform the vector field to cartesian space as you correctly say or do the following:
I suppose your question is if there is a function like |
|||||
|



