Differences between MAD-X and MAD-NG

SEQUENCE command:
—————————————————

- MAD does not use global workspace for sequences.
- MAD does not generate implicit start and stop markers.
- MAD does not generate implicit drifts.
- MAD does not generate implicit nodes.
- MAD does not need USE or FLATTEN commands (automatic).
- MAD allows to to store any kind of key-value pairs.
- MAD allows to combine elements as users wish.
- MAD allows to detect negative drift during construction.
- MAD allows to have non-unique element in sequences.
- MAD allows to mix lines and subsequences definitions.
- MAD allows to inherit from sequences (override # operator).
- MAD allows to set ‘refer’ for each elements.
- MAD allows to set ‘from’ with counts.
- MAD allows to set different ‘refpos’ for each subsequence inclusion.
- MAD adjust automatically sequence length is too short.
- MAD allows to tie two sequences together.
- MAD set tolerance on position to 1e-12 (MAD-X use 1e-6).
      e.g. 215.39-1.55-213.84 = -2.842170943e-14

SURVEY command:
———————————————
- MAD-X does not consider the command sequence attribute.[BUG]
- MAD-X does not apply bv flag to tilt, theta, phi, psi.[BUG]
- MAD-X does not save tilt (and others angles?) when ranges are specified.[BUG]
- MAD-X does not consider the RBARC option (forced to true).
- MAD-X does not support xrotation and translation elements (frame). 
- MAD-X does not allow to survey only one element or few elements at a time.
- MAD-X considers multipoles k0l and k0sl to compute angle and tilt.
- MAD-X consider the sequence and the range from USE command.

- MAD use matrix formula (simpler).
- MAD considers sequences directions (i.e. MAD-X bv flag).
- MAD considers always angle and tilt instead of k0l and k0sl of multipoles. 
- MAD does not save slot_id, assembly_id, mech_sep and v_pos by default (N/A).
- MAD does not consider the add_pass (rbend) option (N/A).
- MAD allows to call survey in a much more flexible way.
- MAD allows to call survey with an already existing table and/or map.
- MAD allows to call survey on ranges specified by indexes, element or element names.
- MAD allows to save (or not) survey data on exit.
- MAD allows to not save data for implicit drifts.
- MAD allows to create customised survey commands.
- MAD allows to attach customised survey commands to objects (i.e. sequences).

BEAM command:
—————————————
- MAD-X does not check the validity of the input values.[BUG]
- MAD-X uses alfa = 1/gamma^2, but -eta is missing.[BUG]
- MAD-X keeps deltap separately -> E0, beta0 and gamma0.
- MAD renames arad -> radius, kbunch -> nbunch, npart -> nparticle.
- MAD removes sequence and deltap (N/A).
- MAD adds spin, etn, sigx and sigy for consistency.
- MAD removes all attributes that require some tracking:
   circ      total path,
   freq0     revolution frequency,
   dtbyds    phase slip factor [eta],
   bcurrent  beam current,
   alfa      momentum compaction factor,
   u0        radiation loss [GeV] (set by emit),
   qs        synchrotron tune (set by emit and ptc_twiss),
   pdamp     damping partition number (set by emit),
   n1min     min available aperture (set by aperture).

TRACK command:
—————————————— 

- MAD-X do not make differences between k0 and angle.
- MAD-X PTC multipole element defined only with knl[1] and/or ksl[1] are turned into a marker.
- MAD-X PTC multipole doesn't take knl[1] and/or ksl[1] into account (zeroed).
- MAD-X PTC (ptc_track) stop calculation if quadrupole have k0 defined.
- MAD-X PTC (ptc_trackline) quadrupole can only have k1, k1s, k0 but not k0s, k2, etc.
- MAD-X PTC (ptc_trackline), everystep option has observed places shifted by one.
- MAD unify the use of k0, k0s, k1, k3s, knl, ksl, dknl, dksl.
