LB=[0 0 0 0 0 0 ]; UB=[2 2 2 2 2 2 ]; [x,fval] = particleswarm(@(r) VGM_1Nri(r),length(LB),LB,UB)