dphi should be 0 in first iteration