Differentiable Preisach Modeling for Characterization and Optimization of Particle Accelerator Systems with Hysteresis.