In this work, a generalized mathematical formulation is proposed to model a generic public transport system, and a mixed-integer linear programming (MILP) optimization is used to determine the optimal design of the system in terms of charging infrastructure deployment (with on-route and off-route charging), battery sizing, and charging schedules for each route in the network. Three case studies are used to validate the proposed model while demonstrating its universal applicability. First, the design of three individual routes with different characteristics is demonstrated. Then, a large-scale generic transport system with 180 routes, consisting of urban and suburban routes with varying characteristics is considered and the optimal design is obtained. Afterwards, the use of the proposed model for a long-term transport system planning problem is demonstrated by adapting the system to a 2030 scenario based on forecasted technological advancements. The proposed formulation is shown to be highly versatile in modeling a wide variety of components in an electric bus (EB) transport system and in achieving an optimal design with minimal TOC. INDEX TERMS Electric Buses, Mixed-Integer Linear Programming, Charging Infrastructure NOMENCLATURE Acronyms AML Algebraic Modeling System CC City Center DC Depot Charger DER Distributed Energy Resource EB Electric Bus ESS Energy Storage System EV Electric Vehicle FC Flash Charger FLC Fuzzy Logic Controller GA Genetic Algorithm HF High Frequency LD Long Distance LF Low Frequency LV Low Voltage MD Medium Distance MILP Mixed-Integer Linear Programming MIP Mixed-Integer Programming MPC Model Predictive Control MV Medium Voltage NLP Non-Linear Programming SD Short Distance SoC State-of-Charge SU Binary variable indicating presence of on-route charger type h, at stop i, in route r Annual ownership cost of on-route charger type h. , , Energy charged at stop i, during trip j, in route r. , , Energy cost per unit at stop i during trip j, in route r.