Differential Dynamic Algorithm