This book provides systematic coverage of the beam-based techniques that accelerator physicists use to improve the performance of large particle accelerators, including synchrotrons and linacs. It begins by discussing the basic principles of accelerators, before exploring the various error sources in accelerators and their impact on the machine's performances. The book then demonstrates the latest developments of beam-based correction techniques that can be used to address such errors and covers the new and expanding area of beam-based optimization. This book is an ideal, accessible reference book for physicists working on accelerator design and operation, and for postgraduate studying accelerator physics. Features: Entirely self-contained, exploring the theoretic background, including algorithm descriptions, and providing application guidance Accompanied by source codes of the main algorithms and sample codes online Uses real-life accelerator problems to illustrate principles, enabling readers to apply techniques to their own problems Xiaobiao Huang is an accelerator physicist at the SLAC National Accelerator Laboratory at Stanford University, USA. He graduated from Tsinghua University with a Bachelor of Science in Physics and a Bachelor of Engineering in Computer Science in 1999. He earned a PhD in Accelerator Physics from Indiana University, Bloomington, Indiana, USA, in 2005. He spent three years on thesis research work at Fermi National Accelerator Laboratory from 2003-2005. He has worked at SLAC as a staff scientist since 2006. He became Accelerator Physics Group Leader of the SPEAR3 Division, Accelerator Directorate in 2015. His research work in accelerator physics ranges from beam dynamics, accelerator design, and accelerator modelling and simulation to beam based measurements, accelerator control, and accelerator optimization. He has taught several courses at US Particle Accelerator School (USPAS), including Beam Based Diagnostics, Accelerator Physics, Advanced Accelerator Physics, and Special Topics in Accelerator Physics.