Determination of parameters for a multiple-source model of megavoltage photon beams using optimization methods