Radiation doses are optimized by providing a model of the set of beams and a target dose in normalized forms. A Gram matrix is determined from the model. The target dose is subsampled to determine initial intensity values for the set of beams. Then, the following steps are iterated until convergence. A very small positive value, 0 < ε<< 1, is added to each intensity value to ensure the intensity value is greater than zero. Each intensity value is multiplied by the Gram matrix to determine a product, which is divided element-wise into the normalized target dose to determine corresponding ratios. If the ratios are all close to 1, within a numerical error tolerance, the intensity values of the set of beam are output. Otherwise, the intensity values are multipled by the ratios before a next iteration.