Fixed some well-hidden simulation bugs. One was putting the magnetic gradient dB/dx where the magnetic field B should be. The other was using u^v to write vector cross product in C, but precedence means a+u^v evaluates as (a+u)^v, so I needed brackets! #physics #accelerators