0

I would like to overplot a single fieldline at some radius or starting point, onto a contour of a magnetic field model without using the streamline function.

For example, here are the cartesian components of a dipole in the xz-plane:

  N=20
  
  z=(findgen(N)/(N-1))*10. - 5.
  x=z
  
  ; 2D arrays
  xx=rebin(reform(x, n, 1), n, n)
  zz=rebin(reform(z, 1, n), n, n)
  
  rr=sqrt(zz^2 + xx^2)
  
  mu=1.
  M=100.
  Bx=mu/(4.*!PI)*(3.*M*zz*xx/rr^5)
  Bz=mu/(4.*!PI)*(3.*M*zz^2/rr^5 - M/rr^3)
  
  B=sqrt(Bz^2 + Bx^2)

  ;s=STREAMLINE(Bx, Bz, x, z, XTITLE='X', YTITLE='Z')

The streamline function does show the dipole field as expected. I suppose I would have to iterate through the field at some starting point and calculate the tangent, but I'm not sure how to implement and plot the resultant line.

Many thanks for any help.

freja
  • 47
  • 1
  • 6
  • Why do you not want to use `STREAMLINE`? What is your requirement? – mgalloy Jul 31 '22 at 02:28
  • I will be adding it to a simulation in 3D, and plotting a field line within a 2D plane. I think the particle_trace will work fine here. – freja Jul 31 '22 at 09:39

1 Answers1

1

You can compute streamlines with PARTICLE_TRACE and do your own graphics however you want.

mgalloy
  • 2,356
  • 1
  • 12
  • 10