Particle accelerators are versatile machines which make both particle physics research and probing nature at microscopic scales possible. At advanced light source facilities, high energy charged particles are used to produce energetic photons. The light generated can resolve atomic structures at Angstrom length scales and observing processes occurring at femtosecond time scales. To achieve this, advancements in methods for designing and controlling nonlinear phenomena in the accelerator is crucial. In machines with periodic structures such as storage rings, nonlinear effects can compound and result in beam loss limiting the radiation power emitted for experimental use. In this thesis, a method for understanding how resonance elimination can be done without relying on extensive numerical optimization, as well as how to design such lattices is developed. In cases when numerical methods are necessary, such as for machines which are already built, machine-learning methods can be used to accurately model the machine behavior. These models can then be used for model-based operation and control of the accelerator. A novel approach to training machine-learning measurement-based models was developed and demonstrated, furthering the goal of improving methods for modelling and controlling accelerators for scientific purposes.