function [out_arg]=ObjectiveFun(PG,PGi,PD,PD0,wD) t3=wD.*((PD-PD0).*(PD-PD0)); out_arg= sum(t3); end