Some notes for the Sagan cavity documentation:

* Voltage is true voltage. That is, the energy change of a particle with charge q will be
voltage*q. For example, if q is negative, a positive voltage with a positive phase factor 
will result in an energy loss. This is different from Bmad where the energy change will
be voltage*q/q_ref where q_ref is the reference charge.

* The RF is applied over L_active. 

* The multipoles and solenoid are applied over the whole length of the element.

* If normalized multipoles/solenoid strength are used, the normalization for the multipoles 
uses the reference momentum at the downstream end 

* With standing wave cavities: 
The pondermotive kick is ignored with `L_active` zero (Otherwise the kick would be infinite).
A very small `L_active` will lead to unphysical results.

* L_active cannot be greater than L.

* zero L_active means that the fringe and pondermotive forces will not be applied. Note that
with fixed voltage, decreasing L_active towards zero will produce huge fringe and pondermotive forces.
This means that tracking results with L_active tiny will be quite different from tracking 
results with L_active zero.

* num_cells is ignored if L_active is zero.
* num_cells = 0 gives one kick at the center
* num_cells > 0 gives a kick at the edges of the cell with the first and last kicks being half strength.

----------------------------------------------------------------------------------------------------

Other notes:

* Something like:
  if rad < 0; error("Change in reference energy too negative."); end
with the advent of batch parameters, almost everything is (potentially) a vector operation.
So this should be rewriten using vifelse.
  