Rank invariants for nonlinear systems