  Due to the highly nonlinear nature of the beam-loading, it is at present not
possible to analytically determine the beam parameters needed in a two-bunch
plasma wakefield accelerator for maintaining a low energy spread. Therefore in
this paper, by using the Broyden-Fletcher-Goldfarb-Shanno algorithm for the
parameter scanning with the code QuickPIC and the polynomial regression
together with k-fold cross-validation method, we obtain two fitting formulas
for calculating the parameters of tri-Gaussian electron beams when minimizing
the energy spread based on the beam-loading effect in a nonlinear plasma
wakefield accelerator. One formula allows the optimization of the normalized
charge per unit length of a trailing beam to achieve the minimal energy spread,
i.e. the optimal beam-loading. The other one directly gives the transformer
ratio when the trailing beam achieves the optimal beam-loading. A simple
scaling law for charges of drive beams and trailing beams is obtained from the
fitting formula, which indicates that the optimal beam-loading is always
achieved for a given charge ratio of the two beams when the length and
separation of two beams and the plasma density are fixed. The formulas can also
help obtain the optimal plasma densities for the maximum accelerated charge and
the maximum acceleration efficiency under the optimal beam-loading
respectively. These two fitting formulas will significantly enhance the
efficiency for designing and optimizing a two-bunch plasma wakefield
acceleration stage.
