Quantcast

better plotting of magnetic field lines

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

better plotting of magnetic field lines

Slavin, Jonathan
Hi all,

I would like to plot the magnetic field lines for a simulation and am finding that streamplot is in adequate in a few ways.  First, it breaks lines when they get too close together.  I think this can be configured with the density parameter.  More fundamentally, one usually wants the density of field lines to indicate the strength of the magnetic field.  So a clever selection of start_points could in principle accomplish this, I think.  That may be the way I go, but I wonder if someone hasn't already come up with a solution for this.  If so, I'd love to hear about it.

Regards,
Jon

--
________________________________________________________
Jonathan D. Slavin                 Harvard-Smithsonian CfA
[hidden email]       60 Garden Street, MS 83
phone: (617) 496-7981       Cambridge, MA 02138-1516
cell: (781) 363-0035             USA
________________________________________________________


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: better plotting of magnetic field lines

Nathan Goldbaum

On Thu, Dec 15, 2016 at 10:38 AM, Slavin, Jonathan <[hidden email]> wrote:
Hi all,

I would like to plot the magnetic field lines for a simulation and am finding that streamplot is in adequate in a few ways.  First, it breaks lines when they get too close together.  I think this can be configured with the density parameter.  More fundamentally, one usually wants the density of field lines to indicate the strength of the magnetic field.  So a clever selection of start_points could in principle accomplish this, I think.  That may be the way I go, but I wonder if someone hasn't already come up with a solution for this.  If so, I'd love to hear about it.

Regards,
Jon

--
________________________________________________________
Jonathan D. Slavin                 Harvard-Smithsonian CfA
[hidden email]       60 Garden Street, MS 83
phone: <a href="tel:(617)%20496-7981" value="+16174967981" target="_blank">(617) 496-7981       Cambridge, MA 02138-1516
cell: <a href="tel:(781)%20363-0035" value="+17813630035" target="_blank">(781) 363-0035             USA
________________________________________________________


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users



_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: better plotting of magnetic field lines

Slavin, Jonathan
Thanks Nathan.  I'll check it out.

Jon

On Thu, Dec 15, 2016 at 11:41 AM, Nathan Goldbaum <[hidden email]> wrote:

On Thu, Dec 15, 2016 at 10:38 AM, Slavin, Jonathan <[hidden email]> wrote:
Hi all,

I would like to plot the magnetic field lines for a simulation and am finding that streamplot is in adequate in a few ways.  First, it breaks lines when they get too close together.  I think this can be configured with the density parameter.  More fundamentally, one usually wants the density of field lines to indicate the strength of the magnetic field.  So a clever selection of start_points could in principle accomplish this, I think.  That may be the way I go, but I wonder if someone hasn't already come up with a solution for this.  If so, I'd love to hear about it.

Regards,
Jon

--
________________________________________________________
Jonathan D. Slavin                 Harvard-Smithsonian CfA
[hidden email]       60 Garden Street, MS 83
phone: <a href="tel:(617)%20496-7981" value="+16174967981" target="_blank">(617) 496-7981       Cambridge, MA 02138-1516
cell: <a href="tel:(781)%20363-0035" value="+17813630035" target="_blank">(781) 363-0035             USA
________________________________________________________


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users





--
________________________________________________________
Jonathan D. Slavin                 Harvard-Smithsonian CfA
[hidden email]       60 Garden Street, MS 83
phone: (617) 496-7981       Cambridge, MA 02138-1516
cell: (781) 363-0035             USA
________________________________________________________


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: better plotting of magnetic field lines

Slavin, Jonathan
Hi Nathan,

That's interesting but not quite what I had in mind.  See the attached figure to see what I'm looking for.  I created that by using uniformly spaced start_points along the upper boundary of the plot.  The only problem then is that I need to use the negative of Bx and By to get the field lines to get propagated in the correct directions.  And then the arrows are in the wrong direction.

One thought I had was to do this, get the output streamlines and then use the end points of those streamlines for start points.  However it's not clear to me how to get those end points from the LineCollection that is part of the StreamplotSet container that's returned by streamplot.  I can get segments from the LineCollection, but I don't know how to get the line endpoint out of those.  Do you know how to do that?

Jon

On Thu, Dec 15, 2016 at 12:00 PM, Slavin, Jonathan <[hidden email]> wrote:
Thanks Nathan.  I'll check it out.

Jon

On Thu, Dec 15, 2016 at 11:41 AM, Nathan Goldbaum <[hidden email]> wrote:

On Thu, Dec 15, 2016 at 10:38 AM, Slavin, Jonathan <[hidden email]> wrote:
Hi all,

I would like to plot the magnetic field lines for a simulation and am finding that streamplot is in adequate in a few ways.  First, it breaks lines when they get too close together.  I think this can be configured with the density parameter.  More fundamentally, one usually wants the density of field lines to indicate the strength of the magnetic field.  So a clever selection of start_points could in principle accomplish this, I think.  That may be the way I go, but I wonder if someone hasn't already come up with a solution for this.  If so, I'd love to hear about it.

Regards,
Jon

--
________________________________________________________
Jonathan D. Slavin                 Harvard-Smithsonian CfA
[hidden email]       60 Garden Street, MS 83
phone: <a href="tel:(617)%20496-7981" value="+16174967981" target="_blank">(617) 496-7981       Cambridge, MA 02138-1516
cell: <a href="tel:(781)%20363-0035" value="+17813630035" target="_blank">(781) 363-0035             USA
________________________________________________________


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users





--
________________________________________________________
Jonathan D. Slavin                 Harvard-Smithsonian CfA
[hidden email]       60 Garden Street, MS 83
phone: <a href="tel:(617)%20496-7981" value="+16174967981" target="_blank">(617) 496-7981       Cambridge, MA 02138-1516
cell: <a href="tel:(781)%20363-0035" value="+17813630035" target="_blank">(781) 363-0035             USA
________________________________________________________




--
________________________________________________________
Jonathan D. Slavin                 Harvard-Smithsonian CfA
[hidden email]       60 Garden Street, MS 83
phone: (617) 496-7981       Cambridge, MA 02138-1516
cell: (781) 363-0035             USA
________________________________________________________


_______________________________________________
Matplotlib-users mailing list
[hidden email]
https://mail.python.org/mailman/listinfo/matplotlib-users

Bmag_w_fieldlines.png (349K) Download Attachment
Loading...