1. A method for optimizing radiation doses delivered by a set of beams, wherein each beam is a radiotherapy particle beam, comprising the steps of: providing a dose matrix A indicating a dose delivered to m target voxels by n beams; providing a target dosage pattern vector b required for a radiotherapy; and determining, using a processor, a non-negative beam weights vector x that specifies individual intensities of the beams of radiation for radiating a target according to the target dosage pattern, such that underdoses and overdoses of the radiation are minimized, wherein the determining comprises: determining the weights vector x according to 
 x ←diag(└ h+┌Q┐x ┘)diag(└ Q┘x ) −1 x; wherein Q is a matrix whose elements are the inner products of columns of the dose matrix A, Q{dot over (=)}A T Aε m×n , T is a transpose operator, R is a space of real numbers, h is a vector, h{dot over (=)}A T bε m , diag( ) indicates a diagonal matrix, ┌Q┐ is a matrix whose elements are positive elements of the matrix Q, ┌Q┐ is a matrix whose elements are absolute values of negative elements of the matrix Q.