<p>This study presents the design and evaluation of a model-based predictive control (MPC) system for precise temperature regulation during the mashing stage of beer production. The mashing process requires a strict temperature <br /> profile to ensure optimal enzymatic activity, maximize sugar yield, and maintain consistent product quality. A dynamic mathematical model of the mash tun, derived from energy balance equations that account for heat input and thermal <br /> losses, was employed as the predictive core of the controller. The MPC algorithm forecasts future temperature trajectories over a finite horizon and determines optimal heating inputs while enforcing operational constraints on temperature and energy usage. Numerical simulations were carried out in Python with the NumPy, Matplotlib, and Control libraries, enabling accurate process modeling, optimization, and visualization of control performance. Results show that MPC achieves a maximum temperature deviation of ±0.2°C, reduces total heating energy consumption by approximately 15%, and demonstrates significantly faster recovery from disturbances. These findings demonstrate that MPC offers a robust and energy-efficient solution for industrial mashing control, with potential benefits for improving beer quality and reducing production costs.</p>