Electric Field Simulation Cyclotron

Hi there!

I recently gave a tutorial for a physics course, where we discussed how a cyclotron works. Often one reads that in the gap between the electrodes the electric field is uniform, similar to a plate capacitor and within the electrodes the electric field is zero. However, if one read thinks about this, there is certainly some penetration of the electric field into the electrodes.
Reading the original papers by Lawrence and Livingston they also discuss this effect.

To show to my students how big this effect is, I wanted to simulate the electric fields and was searching for a Julia package to do this. Then I stumbled over SolidStateDetectors.jl.

This is the yaml file I came up with:
The cyclotron has an radius of 76cm, 3cm gap between the electrodes and a high voltage of 87kV.

name: Cyclotron
units:
  length: cm
  angle: deg
grid:
  coordinates: cylindrical
  axes:
    r: 80
    z:
      from: -3
      to: 3
medium: vacuum
detectors:
- semiconductor:
    material: Vacuum
    geometry:
      tube:
        r: 
          from: 0.0
          to: 77
        h: 5.5
  contacts:
    - material: Cu
      id: 1
      potential: 0
      geometry:
        difference:
          - tube:
              r:
                from: 0
                to: 76
              phi:
                from: 0 
                to: 180
              h: 5
              origin: [0, 1.5cm, 0]
          - tube:
              r:
                from: 0
                to: 75.8
              phi:
                from: 0 
                to: 360
              h: 4.8
              origin: [0, 1.5cm, 0]

    - material: Cu
      id: 2
      potential: 87000
      geometry:
        difference:
          - tube:
              r:
                from: 0
                to: 76
              phi:
                from: 180 
                to: 360
              h: 5
              origin: [0, -1.51cm, 0]
          - tube:
              r:
                from: 0
                to: 75.8
              phi:
                from: 0 
                to: 360
              h: 4.9
              origin: [0, -1.5cm, 0]

I was wondering whether this is the correct usage of the package, as usually one defines a detector with a semiconductor, but in my case I only want to simulate the electric field of two electrodes. With that yaml I do the following:

using SolidStateDetectors
using Plots
using Unitful
sim = Simulation{Float64}("path/to/cyclotron.yaml")
calculate_electric_potential!(sim)
calculate_electric_field!(sim, n_points_in_φ = 300)
plot(sim.electric_field, full_det = true, size = (1000,500), clims = (0,3e6), 
        φ = 90u"°", ratio=2)
plot_electric_fieldlines!(sim, full_det = true, φ = 90u"°", sampling = 5u"mm",
                  offset = -2u"mm")
xlims!(-0.1, 0.1)

The field look similar to what I have expected. Next I wanted to do a 1D Plot along \phi=90 and z=0. I did not find the necessary functions within the package thats why I did the following.

plot(sim.electric_field.grid.axes[1].ticks, norm.(sim.electric_field)[:, 99, 25])

Which is not really nice. There must surely be some way of doing this slicing better.
I really liked working with this package awesome work! I would hope that maybe someone who has more experience either with the package or with electric field simulations in general can take a look at this and tell me whether what I do is halfway correct.

Thanks!

2 Likes