Symbolic elimination in dynamic optimization based on block-triangular ordering. (2nd January 2018)