# 6) How does computer software plot magnetic field lines?

1. Apr 25, 2010

### quantum123

How does computer software plot magnetic field lines where the density of lines represent flux density? How does the software know which points to start plotting from in order to come out with a true representation?

2. Apr 25, 2010

### diazona

I've seen one example in which you would have to click on a point and the software would plot the line that goes through that point. Of course, in that case the density of lines may or may not represent the flux density, depending on where you click.

Off the top of my head, I suppose you could start at the point of largest magnetic field (call the value B) and plot the field line going through there. Then move some reasonable distance R to one side (perpendicular to the magnetic field vector); call the magnetic field value there B' and plot another field line going through that point. Then move over again by the distance R'= RB/B' and plot another line, etc. until you reach the edge of the graph or something.

If you don't wind up getting a good answer here, you might have better luck asking on a computer programming Q&A site (such as stackoverflow.com).

3. Apr 25, 2010

### Simon43254

well the best way I could think of doing it is this: Do you remember during your studies (if you've got this far) when you came across a bar magnet that looked like a tear drop? and you'd have noticed that the smaller the area the higher the density of magnetic field points intersecting the surface. (lets for now keep it 2d). Then you could plot the magnetic field lines with the differential of the curvature of the object. That being the quicker the curve fell or the larger the value of the differential, then the more lines you will plot. Say if you plotted 1 line for every degree of curvature, you should in theory plot the magnetic field lines. The only issue with this is, obviously magnetic field lines curve to join up with the opposite conventional pole. So you'd have to write the code so that the corresponding angle from the other pole joined up with the original. And to my knowledge that should work for most circumstances, although it sounds in my head like that would really work for a conventional rectangular bar magnet. :S.

4. Apr 25, 2010

### quantum123

Thank you.
I have recently downloaded this software for drawing magnetic field lines. It is very good! Go try it.
http://www.vizimag.com/
Upon successfully using the software to draw the field lines that I wanted( very fast performance) on the PC, this question of how the software works is really haunting me.

5. Oct 13, 2011

### nomi_9me

the information above was useful, i need a software that will plot me the magnetic field, the link above is not working, if any one have the setup please give me the link