A detailed understanding of the beam physics of accelerators is required to move towards a new beam tuning paradigm that involves automatic tuning of accelerators. A complete end-to-end model is required so that high level tuning algorithms can be applied. Therefore, an end-to-end simulation of the ISAC accelerators, which doesnot exist is now under development. We have established an analytical model of the linacs using the methodology of a Hamiltonian based description of beam line elements and implemented this through a sophisticated simulation code TRANSOPTR. This will enable an automatic re-phasing of cavities of the linac of TRIUMF’s Isotope Separator and ACelerator facility, to improve beam delivery in case of RF-phase drifts or failure of one of the SRF cavities in ISAC-II. This activities also prepare potential applications of machine learning in the tuning of complex accelerator systems.