Today I included the pieces that the electrons interact with the magnetic field and it seems to work. The current version I uploaded on GitHub. One the image above on the right side is the electron source shown as I already described in the Last Log. One the left side is the magnet with a cage of iron shown. In the middle a little bit above of the crossing beams is a light green field visible. This field is the reason for crossing traces of the electrons.
The principle why the electron change a direction in a magnetic field is a little bit more complex as in a electrical field. But I try it to explain. The electrons moves in the Y direction, because they are already accelerated by the electrical field. The movement in the Y direction with the magnetic field in X direction accelerate the electrons in Phi direction. The left hand rule is quite helpful. The thumb shows in the direction of the particle motion, the index finger shows in the direction of the field and the middle finger tells the direction of the acceleration of the particle. In the simulation the field in X-Axis is rotational symmetric. Therefore you can imagine that very time when the particle move a little bit you have to repeat the left hand rule and then you see that a circle come up. Now is clear why the electrons start to rotate on a orbit but not why the move in the X direction.
Let do the left hand rule for the magnetic field in Y direction. The thumb shows in the direction circular orbit of the electrons. The index finger shows in the Y direction of the magnetic field and tells that the electrons go on the X-Axis in the direction of the center.
In one of my previous logs, I explained how I calculate the position (Position Calculation). For the inclusion of the field in the position calculation I added the acceleration from the magnetic field to the acceleration of the electrical field. For this I need a additional variable vphi what contains the circular speed of the particle.