function y=ddopt(k)

global U_pred A F;

U = 1/k*inv(A)*F;

y = 2*(-1/k^2*inv(A)*F)'*(-1/k^2*inv(A)*F)+2*(U-U_pred)'*(2/k^3*inv(A)*F);